/* Toast / Snackbar Notification System */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid transparent;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.21, 1.02, 0.73, 1), opacity 0.3s ease;
  will-change: transform, opacity;
}

.toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast.toast-exit {
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 1, 1), opacity 0.2s ease;
}

/* Toast icon */
.toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 0.875rem;
  height: 0.875rem;
}

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

.toast-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #3A3228;
}

.toast-message {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #6E604A;
  margin-top: 0.125rem;
}

/* Toast dismiss */
.toast-dismiss {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: #A89878;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  border: none;
  background: none;
  padding: 0;
}

.toast-dismiss:hover {
  color: #524838;
  background-color: rgba(0, 0, 0, 0.05);
}

.toast-dismiss svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 0;
  height: 3px;
  border-radius: 0 0 0.75rem 0;
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toast-progress-shrink linear forwards;
}

@keyframes toast-progress-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ─── Type Variants ──────────────────────────────────────────────── */

.toast-success {
  border-left-color: #4E6B4E;
}

.toast-success .toast-icon {
  background-color: #E4ECE4;
  color: #3F563F;
}

.toast-success .toast-progress-bar {
  background-color: #4E6B4E;
}

.toast-error {
  border-left-color: #A83250;
}

.toast-error .toast-icon {
  background-color: #FAE2E7;
  color: #8B2842;
}

.toast-error .toast-progress-bar {
  background-color: #A83250;
}

.toast-warning {
  border-left-color: #D97706;
}

.toast-warning .toast-icon {
  background-color: #FEF3C7;
  color: #92400E;
}

.toast-warning .toast-progress-bar {
  background-color: #D97706;
}

.toast-info {
  border-left-color: #2563EB;
}

.toast-info .toast-icon {
  background-color: #DBEAFE;
  color: #1E40AF;
}

.toast-info .toast-progress-bar {
  background-color: #2563EB;
}

/* ─── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: 5rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }

  .toast {
    transform: translateY(120%);
  }

  .toast.toast-visible {
    transform: translateY(0);
  }

  .toast.toast-exit {
    transform: translateY(120%);
  }
}
