/* spotlight.css - Styles fuer Cmd+K Spotlight + states + toasts + print.
 * Paket UIA-3 Phasen 1, 3, 10, 13.
 * Token-Verwendung: alle Farben/Spacings via var(--...) aus tokens.css.
 */

/* ── Spotlight (Cmd/Ctrl+K + Header-Suche) — Cockpit-Design (#1324) ──
   Cockpit-Tokens statt der alten --color-*-Fallbacks; Backdrop/Frame nach
   #1231-Overlay-Standard (Sidebar bleibt sichtbar), Command-Palette oben. */
.spotlight-overlay {
  position: fixed; inset: 0 0 0 264px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 11vh 24px 24px;
}
@media (max-width: 1100px) { .spotlight-overlay { inset: 0; } }
.spotlight-modal {
  width: min(640px, 100%);
  background: var(--bg-surface);
  color: var(--tx-0);
  border: 1px solid var(--bdr-def);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column;
  max-height: 76vh;
  overflow: hidden;
}
.spotlight-input-row {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--bdr-faint);
}
.spotlight-input {
  flex: 1; padding: 15px 18px; font-size: 15px;
  background: transparent; border: 0; outline: 0;
  color: var(--tx-0);
}
.spotlight-input::placeholder { color: var(--tx-2); }
/* Kein kräftiger Focus-Ring am Such-Input — der Modal-Kontext macht den Fokus
   ohnehin klar; die globale :focus-visible-Outline wäre hier zu deutlich. */
.spotlight-input:focus,
.spotlight-input:focus-visible { outline: none; }
.spotlight-close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 14px; color: var(--tx-2);
}
.spotlight-close:hover { color: var(--tx-0); }
.spotlight-tabs {
  display: flex; gap: 4px; padding: 8px 12px;
  border-bottom: 1px solid var(--bdr-faint);
  overflow-x: auto;
}
.spotlight-tab {
  background: transparent; border: 0; padding: 5px 11px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 12.5px; color: var(--tx-2); white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.spotlight-tab:hover { background: var(--bg-el); color: var(--tx-1); }
.spotlight-tab.on   { background: var(--ac-bg); color: var(--ac-2); font-weight: 600; }
.spotlight-results { flex: 1; overflow-y: auto; padding: 6px; }
.spotlight-loading,
.spotlight-error,
.spotlight-empty {
  padding: 28px; text-align: center; font-size: 13px;
  color: var(--tx-2);
}
.spotlight-error { color: var(--er); }
.spotlight-list { list-style: none; margin: 0; padding: 0; }
.spotlight-group {
  list-style: none; padding: 9px 12px 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tx-2);
}
.spotlight-group:not(:first-child) { border-top: 1px solid var(--bdr-faint); margin-top: 4px; }
.spotlight-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; cursor: pointer; border-radius: var(--r-sm);
}
.spotlight-item.active,
.spotlight-item:hover { background: var(--ac-bg); }
.spotlight-icon {
  flex: none; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tx-2);
}
.spotlight-item.active .spotlight-icon { color: var(--ac-2); }
.spotlight-icon svg { width: 16px; height: 16px; }
.spotlight-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.spotlight-label { font-size: 13.5px; font-weight: 600; color: var(--tx-0); line-height: 1.35; }
.spotlight-sublabel { font-size: 11.5px; color: var(--tx-2); margin-top: 1px; }
.spotlight-footer {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--bdr-faint);
  font-size: 11px; color: var(--tx-2);
}
.spotlight-footer kbd {
  background: var(--bg-el);
  border: 1px solid var(--bdr-faint);
  border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono); font-size: 10.5px;
  margin: 0 2px; color: var(--tx-1);
}

/* ── EmptyState / LoadingState / ErrorState ─────────────────── */
.state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 24px; text-align: center;
  color: var(--color-text-muted, #888);
}
.state h3 { margin: 0; color: var(--color-text, #111); }
.state p  { margin: 0; max-width: 380px; }
.state-icon { font-size: 40px; opacity: 0.55; line-height: 1; }
.state-cta {
  padding: 8px 16px; border-radius: 6px;
  border: 1px solid var(--color-border, #e6e6e6);
  background: var(--color-surface, #fff); cursor: pointer; color: inherit;
}
.state-cta:hover { background: var(--color-surface-hover, rgba(0,0,0,0.05)); }
.state-error .state-icon { color: var(--color-danger, #c0392b); opacity: 1; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--bdr-def);
  border-top-color: var(--ac-2);
  border-radius: 50%;
  animation: mma-spin 0.6s linear infinite;
}
@keyframes mma-spin { to { transform: rotate(360deg); } }

/* ── Toasts ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 5000;
  display: flex; flex-direction: column; gap: 8px; max-width: 420px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  animation: mma-toast-in 0.22s ease-out;
  font-size: 14px; line-height: 1.4;
}
.toast-success { background: var(--color-success, #16a34a); color: #fff; }
.toast-error   { background: var(--color-danger,  #dc2626); color: #fff; }
.toast-warning { background: var(--color-warning, #d97706); color: #fff; }
.toast-info    { background: var(--color-primary, #0a5e3e); color: #fff; }
.toast-msg { flex: 1; min-width: 0; word-break: break-word; }
.toast-close {
  background: transparent; border: 0; color: inherit;
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 0 4px;
}
@keyframes mma-toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── A11y Focus + Skip-Link ────────────────────────────────── */
:focus-visible {
  /* #1438: neutrale Akzent-/Fokus-Farbe statt Grün — Grün ist Erfolg/Bestätigung
     vorbehalten. (--color-primary existiert nicht -> Fallback war grün #0a5e3e.) */
  outline: 2px solid var(--ac-2);
  outline-offset: 2px;
  border-radius: 4px;
}
.mma-skip-to-content {
  position: absolute; left: -9999px; top: 8px;
  background: var(--color-primary, #0a5e3e); color: #fff;
  padding: 8px 16px; border-radius: 6px; z-index: 6000;
  text-decoration: none;
}
.mma-skip-to-content:focus { left: 8px; }

/* ── Print Stylesheet ───────────────────────────────────────── */
@media print {
  header, nav, aside,
  .header-search, .spotlight-overlay, .spotlight-modal,
  .toast-container, .mma-skip-to-content,
  button:not(.print-keep), .tweaks-panel {
    display: none !important;
  }
  body  { color: black; background: white; font-size: 11pt; }
  main  { width: 100%; max-width: none; padding: 0; margin: 0; }
  table { border-collapse: collapse; width: 100%; page-break-inside: avoid; }
  th, td { border: 1px solid #bbb; padding: 4px 8px; }
  thead { display: table-header-group; }
  tr    { page-break-inside: avoid; }
  h1, h2 { page-break-after: avoid; }
  h1 + *, h2 + * { page-break-before: avoid; }
  a[href]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
  a[href^="#"]:after, a[href^="javascript:"]:after, a[href^="mailto:"]:after { content: ""; }
  @page { margin: 2cm 1.5cm; size: A4; }
}
