/**
 * shared.css
 * Canonical shared component styles used across all pages.
 * Load after theme.css, before any page-specific stylesheet.
 *
 * Phase 1: Contains the Toast notification component (previously duplicated
 *          between admin.css and submit.css).
 * Phase 2: Will absorb header, nav, footer, buttons, forms, modals, etc.
 */

/* ─── Toast Notifications ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 20050;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: auto;
}

.toast {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastSlideIn 0.3s ease-out;
  position: relative;
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-left: 4px solid;
}

/* Bootstrap compatibility: Bootstrap defines .toast:not(.show) { display: none; }
   which hides our custom toasts. Keep custom toasts visible without requiring
   Bootstrap's .show class lifecycle. */
.toast-container .toast:not(.show) {
  display: flex;
  opacity: 1;
}

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

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

.toast.hiding {
  animation: toastSlideOut 0.3s ease-out forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.toast-message {
  font-size: 13px;
  margin: 0;
  color: #666;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  color: #999;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #333;
}

/* Toast variants */
.toast.success { border-left-color: var(--toast-success-color, #4CAF50); }
.toast.success .toast-icon,
.toast.success .toast-title { color: var(--toast-success-color, #4CAF50); }

.toast.error { border-left-color: var(--toast-error-color, #f44336); }
.toast.error .toast-icon,
.toast.error .toast-title { color: var(--toast-error-color, #f44336); }

.toast.warning { border-left-color: var(--toast-warning-color, #ff9800); }
.toast.warning .toast-icon,
.toast.warning .toast-title { color: var(--toast-warning-color, #ff9800); }

.toast.info { border-left-color: var(--toast-info-color, #2196F3); }
.toast.info .toast-icon,
.toast.info .toast-title { color: var(--toast-info-color, #2196F3); }
