/* ==========================================================================
   Design tokens — single source of truth for the new widgets.
   Load this BEFORE any component CSS. Never hardcode new hex values or
   font stacks elsewhere; reference these variables instead.
   ========================================================================== */

:root {
  --lh-bg: #0B0E11;
  --lh-surface: #12161B;
  --lh-border: #1F252B;
  --lh-text: #E6E8EB;
  --lh-text-secondary: #8B9099;
  --lh-text-muted: #6B7280;
  --lh-accent: #2DD4BF;
  --lh-accent-dim: rgba(45, 212, 191, 0.12);
  --lh-success: #5DCAA5;
  --lh-warn: #C99A5B;       /* "in progress" / WIP status — muted amber, no neon */
  --lh-danger: #C96F6F;     /* rare emphasis (e.g. destructive command) — desaturated */
  --lh-radius-card: 10px;
  --lh-radius-md: 8px;
  --lh-radius-pill: 999px;
  --lh-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --lh-font-sans: 'Inter', system-ui, sans-serif;

  /* Nur für die Architektur-Kategorien (Abschnitt 2) — sonst nirgends einsetzen */
  --lh-cat-network: #5BA3E0;
  --lh-cat-automation: #9089E8;
  --lh-cat-monitoring: var(--lh-accent);
  --lh-cat-devtools: #E0775A;

  /* Visitor-Map Quantize-Skala (5 Stufen, Teal-Familie, passend zu --lh-accent) */
  --lh-map-empty: var(--lh-surface);
  --lh-map-1: #E1F5EE;
  --lh-map-2: #A7DFCF;
  --lh-map-3: #5DBFA2;
  --lh-map-4: #2E9173;
  --lh-map-5: #0F6E56;
}

/* ----- Basis-Card-Klasse: alle Widgets erben davon ----------------------- */
.lh-card {
  background: var(--lh-surface);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-card);
  padding: 14px 16px;
}

.lh-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-family: var(--lh-font-mono); font-size: 11px;
  color: var(--lh-text-muted); letter-spacing: 0.3px;
}

.lh-value {
  font-family: var(--lh-font-mono); font-size: 20px; font-weight: 500; color: var(--lh-text);
}

.lh-sub {
  font-family: var(--lh-font-mono); font-size: 11px; color: var(--lh-text-secondary); margin-top: 6px;
}

/* ----- Card-Grid (Abschnitt 4) ------------------------------------------- */
.lh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Subtiler Hover-State, keine Auto-Play-/Partikel-Effekte */
.lh-card-interactive {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.lh-card-interactive:hover {
  transform: scale(0.98);
  border-color: var(--lh-accent);
}

.lh-card-wide { grid-column: 1 / -1; }

/* ----- Pipeline-Badge (Abschnitt 1) -------------------------------------- */
.lh-pipeline-value { color: var(--lh-accent); }
.lh-pipeline-value.is-failed { color: var(--lh-text-muted); }

.lh-pipeline-badge-img {
  display: block;
  margin-top: 8px;
  height: 20px;
}

.lh-pipeline-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text-secondary);
  text-decoration: none;
  letter-spacing: 0.3px;
}
.lh-pipeline-link:hover { color: var(--lh-accent); }

/* ----- Visitor-Map (Abschnitt 3) ----------------------------------------- */
.lh-map-card { min-height: 280px; }

.lh-map-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--lh-bg);
  border-radius: var(--lh-radius-md);
}

.lh-map-country {
  fill: var(--lh-map-empty);
  stroke: var(--lh-border);
  stroke-width: 0.4px;
  transition: fill 0.15s ease;
}

.lh-map-tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  background: var(--lh-surface);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-md);
  padding: 6px 10px;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text);
  z-index: 600;
  white-space: nowrap;
}

.lh-map-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text-muted);
}
.lh-map-legend-swatch {
  width: 16px; height: 10px;
  border-radius: 2px;
  border: 0.5px solid var(--lh-border);
}

.lh-privacy-note {
  margin-top: 12px;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text-muted);
  line-height: 1.6;
}

/* ----- Footer-Status-Bar (Abschnitt 4, optional) ------------------------- */
.lh-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.lh-statusbar .lh-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lh-statusbar .lh-stat .lh-value { font-size: 16px; }
.lh-statusbar .lh-stat .lh-label { margin-bottom: 0; }

/* ----- Architektur-Diagramm (Abschnitt 2) -------------------------------- */
.lh-arch-page {
  background: var(--lh-bg);
  color: var(--lh-text);
  font-family: var(--lh-font-sans);
  min-height: 100vh;
  margin: 0;
}

.lh-arch-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.lh-arch-head { margin-bottom: 24px; }
.lh-arch-head h1 {
  font-family: var(--lh-font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--lh-text);
  margin: 0 0 6px;
}
.lh-arch-head p {
  font-family: var(--lh-font-mono);
  font-size: 12px;
  color: var(--lh-text-secondary);
  margin: 0;
}
.lh-arch-back {
  display: inline-block;
  margin-bottom: 20px;
  font-family: var(--lh-font-mono);
  font-size: 12px;
  color: var(--lh-text-secondary);
  text-decoration: none;
}
.lh-arch-back:hover { color: var(--lh-accent); }

.lh-arch-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--lh-bg);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-card);
}

/* Knoten im Diagramm */
.lh-node rect {
  fill: var(--lh-surface);
  stroke: var(--lh-border);
  stroke-width: 0.5px;
  transition: stroke 0.15s ease, filter 0.15s ease;
}
.lh-node text {
  font-family: var(--lh-font-mono);
  fill: var(--lh-text);
  font-size: 13px;
}
.lh-node .lh-node-sub {
  fill: var(--lh-text-secondary);
  font-size: 10px;
}
.lh-node.is-interactive { cursor: pointer; }
.lh-node.is-interactive:hover rect { stroke: var(--lh-accent); }

/* Kategorie-Boxen: eigener Akzent (0.5px Rahmen + 12% Fill) */
.lh-cat-box.cat-network rect   { stroke: var(--lh-cat-network);    fill: color-mix(in srgb, var(--lh-cat-network) 12%, transparent); }
.lh-cat-box.cat-automation rect{ stroke: var(--lh-cat-automation); fill: color-mix(in srgb, var(--lh-cat-automation) 12%, transparent); }
.lh-cat-box.cat-monitoring rect{ stroke: var(--lh-cat-monitoring); fill: color-mix(in srgb, var(--lh-cat-monitoring) 12%, transparent); }
.lh-cat-box.cat-devtools rect  { stroke: var(--lh-cat-devtools);   fill: color-mix(in srgb, var(--lh-cat-devtools) 12%, transparent); }
.lh-cat-box.is-interactive:hover rect { filter: brightness(1.25); }

.lh-arch-edge {
  stroke: var(--lh-border);
  stroke-width: 1px;
  fill: none;
}
.lh-arch-edge-arrow { fill: var(--lh-text-muted); }

.lh-arch-tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  max-width: 260px;
  background: var(--lh-surface);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-md);
  padding: 8px 12px;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--lh-text);
  z-index: 600;
}
.lh-arch-tooltip .lh-tt-title { color: var(--lh-accent); display: block; margin-bottom: 4px; }

/* ----- Command palette (⌘K) ---------------------------------------------- */
.lh-cmdk-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: color-mix(in srgb, var(--lh-bg) 65%, transparent);
  backdrop-filter: blur(4px);
  z-index: 2000;
}
.lh-cmdk-overlay.is-open { display: flex; }

.lh-cmdk-panel {
  width: min(560px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--lh-surface);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-card);
  overflow: hidden;
  box-shadow: 0 16px 48px color-mix(in srgb, #000 55%, transparent);
}

.lh-cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 0.5px solid var(--lh-border);
  background: transparent;
  padding: 16px 18px;
  font-family: var(--lh-font-mono);
  font-size: 15px;
  color: var(--lh-text);
  outline: none;
}
.lh-cmdk-input::placeholder { color: var(--lh-text-muted); }

.lh-cmdk-list {
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
}

.lh-cmdk-group-label {
  font-family: var(--lh-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lh-text-muted);
  padding: 10px 12px 4px;
}

.lh-cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--lh-radius-md);
  font-family: var(--lh-font-sans);
  font-size: 14px;
  color: var(--lh-text-secondary);
  cursor: pointer;
}
.lh-cmdk-item.is-active {
  background: var(--lh-accent-dim);
  color: var(--lh-text);
}
.lh-cmdk-ic {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--lh-accent);
}
.lh-cmdk-item.is-active .lh-cmdk-ic { color: var(--lh-accent); }
.lh-cmdk-hint {
  margin-left: auto;
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text-muted);
}

.lh-cmdk-empty {
  padding: 24px 12px;
  text-align: center;
  font-family: var(--lh-font-mono);
  font-size: 12px;
  color: var(--lh-text-muted);
}

.lh-cmdk-footer {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border-top: 0.5px solid var(--lh-border);
  font-family: var(--lh-font-mono);
  font-size: 11px;
  color: var(--lh-text-muted);
}
.lh-cmdk-footer kbd {
  font-family: var(--lh-font-mono);
  background: var(--lh-bg);
  border: 0.5px solid var(--lh-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--lh-text-secondary);
}

/* Discoverable trigger pill (bottom-right) */
.lh-cmdk-trigger {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--lh-surface);
  border: 0.5px solid var(--lh-border);
  border-radius: var(--lh-radius-pill);
  font-family: var(--lh-font-mono);
  font-size: 12px;
  color: var(--lh-text-secondary);
  cursor: pointer;
  z-index: 1500;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.lh-cmdk-trigger:hover {
  color: var(--lh-text);
  border-color: color-mix(in srgb, var(--lh-accent) 55%, var(--lh-border));
}
.lh-cmdk-trigger kbd {
  font-family: var(--lh-font-mono);
  background: var(--lh-bg);
  border: 0.5px solid var(--lh-border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ----- Mobile: Karten-Grid auf eine Spalte ------------------------------- */
@media (max-width: 768px) {
  .lh-grid { grid-template-columns: 1fr; }
  .lh-statusbar { gap: 16px; }
  .lh-cmdk-trigger { display: none; }
}
