/* ── Toast Notifications ──────────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toast-in 0.25s ease;
  position: relative;
  overflow: hidden;
}

.toast.removing {
  animation: toast-out 0.25s ease forwards;
}

.toast__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast__body { flex: 1; min-width: 0; }

.toast__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semi);
  color: var(--color-text);
  margin-bottom: 2px;
}

.toast__msg {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.toast__close {
  background: none;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 16px;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}
.toast__close:hover { color: var(--color-text); }

/* Barra de progreso del timeout */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  animation: toast-progress var(--toast-duration, 4000ms) linear forwards;
}

/* Variantes por tipo */
.toast--success { border-color: var(--color-success); color: var(--color-success); }
.toast--error   { border-color: var(--color-error);   color: var(--color-error);   }
.toast--warning { border-color: var(--color-warning); color: var(--color-warning); }
.toast--info    { border-color: var(--color-info);    color: var(--color-info);    }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; max-height: 100px; }
  to   { transform: translateX(110%); opacity: 0; max-height: 0; padding: 0; }
}
@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0; }
}
