/**
 * Toast Notifications - Clean, non-intrusive alerts
 */

/* ============================================
   CONTAINER
   ============================================ */

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  pointer-events: none;
}

/* ============================================
   TOAST
   ============================================ */

.toast {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  min-width: 300px;
  transition: all var(--transition-base);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  line-height: var(--line-height-normal);
}

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  color: var(--color-text-muted);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ============================================
   TOAST VARIANTS
   ============================================ */

.toast-success {
  border-left: 3px solid var(--color-success);
}

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

.toast-error {
  border-left: 3px solid var(--color-error);
}

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

.toast-warning {
  border-left: 3px solid var(--color-warning);
}

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

.toast-info {
  border-left: 3px solid var(--color-info);
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast {
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-exit {
  animation: toastSlideOut 0.2s ease-out forwards;
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .toast-container {
    top: auto;
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    max-width: none;
  }

  .toast {
    min-width: 0;
  }
}

/* ============================================
   HOVER STATES
   ============================================ */

.toast:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-1px);
}

/* ============================================
   PROGRESS BAR (Optional)
   ============================================ */

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-surface-600);
  overflow: hidden;
}

.toast-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  background: currentColor;
  animation: toastProgress linear forwards;
}

.toast-success .toast-progress::after {
  background: var(--color-success);
}

.toast-error .toast-progress::after {
  background: var(--color-error);
}

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

.toast-info .toast-progress::after {
  background: var(--color-info);
}

@keyframes toastProgress {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
