/* ============================================================
   OVERLAYS AND NAVIGATION WIDGETS
   ------------------------------------------------------------
   Split out of the original 3,093-line css/components.css on
   2026-08-29. The seven files are loaded in their original
   source order, so the cascade is byte-for-byte unchanged:
     layout -> components -> views-content -> views-cards
     -> overlays -> views-progress -> utilities
   Section numbers below are the original components.css numbering.

     15. Modals
     16. Toast notifications
     17. Search
     18. Tabs
   ============================================================ */

/* ──────────────────────────────────────────
   15. MODALS
   ────────────────────────────────────────── */

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-medium);
}

#modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#modal-container {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: translateY(24px) scale(0.97);
  transition: transform var(--transition-medium);
  overflow: hidden;
}

#modal-overlay.active #modal-container {
  transform: translateY(0) scale(1);
}

#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

#modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

#modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-shrink: 0;
}

#modal-footer:empty {
  display: none;
}


/* ──────────────────────────────────────────
   16. TOAST NOTIFICATIONS
   ────────────────────────────────────────── */

#toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

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

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

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

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.toast-close {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--transition);
  background: none;
  border: none;
}

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

/* Toast progress bar */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  animation: progressFill 4s linear forwards;
}

/* Toast variants */
.toast-success {
  border-left: 3px solid var(--accent-emerald);
  color: var(--accent-emerald);
}

.toast-success .toast-title { color: var(--accent-emerald); }

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

.toast-error .toast-title { color: var(--accent-red); }

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

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

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

.toast-warning .toast-title { color: var(--accent-gold); }


/* ──────────────────────────────────────────
   17. SEARCH
   ────────────────────────────────────────── */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-medium);
}

.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-container {
  width: 100%;
  max-width: 640px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-16px);
  transition: transform var(--transition-medium);
}

.search-overlay.active .search-container {
  transform: translateY(0);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.search-input-icon {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: var(--text-lg);
  color: var(--text-primary);
  caret-color: var(--accent);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-size: var(--text-xs);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.search-results {
  max-height: 480px;
  overflow-y: auto;
  padding: var(--space-3);
}

.search-results-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.search-category-label {
  font-size: 10px;
  font-weight: var(--font-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}

.search-result-item:hover,
.search-result-item.focused {
  background: var(--surface-hover);
  text-decoration: none;
}

.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.search-result-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.search-result-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 1px;
}

.search-shortcut {
  font-size: 10px;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
  flex-shrink: 0;
}

.search-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.search-footer-hint {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}


/* ──────────────────────────────────────────
   18. TABS
   ────────────────────────────────────────── */

.tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tabs-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-header::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  padding: var(--space-6) 0;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

