/* ============================================================================
   TOAST SYSTEM — Sonner-inspired neutral card design
   Class rules only. Zero variable definitions.
   All CSS variables come from themes.py (single source of truth).
   Container positioning overrides in system-core.css (menu-aware).
   ============================================================================ */

/* Fallback container for pages without system-core.css */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 280px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
}

.toast-container .simple-toast {
  pointer-events: auto;
}

/* Toast card */
.simple-toast {
  background: var(--toast-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-default);
  border: 1px solid var(--toast-border);
  font-size: 0.875rem;
  font-weight: 400;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  color: var(--toast-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
  will-change: transform;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 44px;
  max-height: 140px;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.simple-toast:hover {
  transform: translateY(-1px);
}

/* Icon-only type differentiation */
.simple-toast .toast-icon { color: var(--toast-info-icon); }
.simple-toast.toast-success .toast-icon { color: var(--toast-success-icon); }
.simple-toast.toast-danger .toast-icon,
.simple-toast.toast-error .toast-icon { color: var(--toast-danger-icon); }
.simple-toast.toast-warning .toast-icon { color: var(--toast-warning-icon); }
.simple-toast.toast-info .toast-icon { color: var(--toast-info-icon); }

.toast-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Content takes remaining space, pushing action + close to the right */
.toast-content {
  flex: 1;
  line-height: 1.4;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--toast-text);
}

.toast-description {
  font-size: 0.8rem;
  color: var(--toast-text-muted);
  line-height: 1.4;
}

/* Action button — right of content, before close */
.toast-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--spacing-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--toast-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--toast-text);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.toast-action-btn:hover {
  background: var(--highlight-color);
}

/* Count badge — after icon */
.toast-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight-color);
  color: var(--toast-text);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 20px;
  flex-shrink: 0;
}

/* Close button — always visible, subtle */
.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--toast-text-muted);
  opacity: 0.3;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

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

@keyframes toastSlideIn {
  from {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

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