/* Utility Classes */
.hidden {
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes starPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 12px var(--shadow);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: none;
  border-left: 4px solid;
}

.toast-visible {
  animation: toastSlideIn 0.3s ease forwards;
}

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

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

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

/* Type colors — uses theme variables */
.toast-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-left-color: var(--success-primary);
}

.toast-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-left-color: var(--danger-primary);
}

.toast-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-left-color: var(--warning-border);
}

.toast-info {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  font-weight: bold;
}

.toast-message {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.6;
  flex-shrink: 0;
  line-height: 1;
}

.toast-close:hover {
  opacity: 1;
}

/* Mobile: full-width bottom toasts */
@media (max-width: 600px) {
  #toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}
