/* Toast notifications */

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 2px);
  right: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  color: var(--color-text);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: toastIn 0.3s var(--ease-out);
}

.toast--error { border-left-color: var(--color-danger); }
.toast--success { border-left-color: var(--color-success); }
.toast--warning { border-left-color: var(--color-warning); }

.toast__close {
  margin-left: auto;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: background-color var(--t-fast);
}

.toast__close:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.is-leaving {
  animation: toastOut 0.25s var(--ease-out) forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* toast: on small screens span the top so it's fully visible and doesn't clip */
@media (max-width: 640px) {
  .toast-container { left: 12px; right: 12px; top: 10px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
