/* ==========================================================
   toast.css — Toast notification styles
   ========================================================== */

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

.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: toastIn var(--duration-base) var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.toast.dismissing {
  animation: toastOut var(--duration-fast) var(--ease-in) both;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 100px; }
  to   { opacity: 0; transform: translateX(32px); max-height: 0; padding: 0; margin: 0; }
}

/* Progress bar at bottom */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 0 var(--radius-lg);
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: 1.3;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all var(--duration-micro) var(--ease-out);
  padding: 0;
}

.toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Variants */
.toast-success { border-color: var(--success); }
.toast-success .toast-progress { background: var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-color: var(--danger); }
.toast-error .toast-progress { background: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-warning { border-color: var(--warning); }
.toast-warning .toast-progress { background: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-info .toast-icon { color: var(--info); }

@media (max-width: 767px) {
  .toast-container {
    bottom: 90px;
    left: var(--space-4);
    right: var(--space-4);
  }
  .toast { min-width: unset; max-width: 100%; }
}
