/* ===================================================================
   devCon Status Page — Sapphire-inspired health board
   ===================================================================
   - status-hero       : volle-Breite Banner mit "All Systems Operational"
   - status-service    : ein-/ausklappbare Service-Karte mit Uptime-Bars
   - status-bar-track  : die Tagesblock-Reihe (eine pro Service)
   - status-shard      : Shard/Cluster-Zelle im aufgeklappten Main-Bot-Panel
   - .status-pill      : Range- + Reset-Buttons (Pill-Stil aus dem Panel)
   =================================================================== */

/* Hero — exakt store-hero/dc-hero-Schema: simple Title + Desc + dezenter
   orange radial-glow ::before. Status-Headline-Pill ist die kleine
   Live-Anzeige darunter, KEIN großer Banner. */
.status-hero {
  padding: calc(var(--header-height) + 60px) 0 20px;
  position: relative;
}
.status-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse 50% 50% at 50% 0%, rgba(255, 140, 26, 0.10), transparent 70%);
  pointer-events: none;
}
/* 2-Spalten-Hero: links Title/Desc, rechts Wartungsarbeiten-Card.
   1:1-Schema von .dc-hero-grid / .tools-hero-grid — bei <960px stack. */
.status-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 960px) {
  .status-hero-grid { grid-template-columns: 1fr; gap: 28px; }
}
.status-hero-text { min-width: 0; }
.status-title {
  /* Type-scale + Tracking 1:1 wie .dc-hero-title:
     .display setzt schon font-family + letter-spacing:-0.03em, hier
     nur noch Größe + Weight (700 wie auf /discord) + line-height. */
  font-size: clamp(38px, 5.6vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 18px;
  position: relative;
}

/* Hero-Stats — 2×2-Grid, 1:1 nach /tools-Pattern (.tools-stat). Großes
   72×72-Ghost-Icon mittig-vertikal halb hinter dem rechten Rand (right:-10px),
   Value clamp(26,3vw,32) Weight 800, Hover translateY(-2px) + orange Border.
   Lead = orange Wert, Success = grün mit Border-Akzent + sanftem Gradient. */
.status-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}
@media (max-width: 460px) {
  .status-hero-stats { grid-template-columns: 1fr; }
}
.status-hero-stat {
  position: relative;
  padding: 18px 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.status-hero-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 130, 40, 0.30);
}
.status-hero-stat--lead .status-hero-stat-value { color: var(--orange); }
.status-hero-stat--lead .status-hero-stat-icon  { color: var(--orange); opacity: 0.14; }
.status-hero-stat--success {
  border-color: rgba(74, 222, 128, 0.30);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.04), transparent 65%), var(--bg-card);
}
.status-hero-stat--success:hover { border-color: rgba(74, 222, 128, 0.55); }
.status-hero-stat--success .status-hero-stat-value { color: #4ade80; }
.status-hero-stat--success .status-hero-stat-icon  { color: #4ade80; opacity: 0.18; }
.status-hero-stat--success:hover .status-hero-stat-icon { color: #4ade80; opacity: 0.30; }
.status-hero-stat-icon {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  height: 72px;
  color: var(--text-muted);
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  transition: opacity .25s ease, color .25s ease;
}
.status-hero-stat-icon svg { width: 100%; height: 100%; display: block; }
.status-hero-stat:hover .status-hero-stat-icon {
  opacity: 0.20;
  color: var(--orange);
}
/* Erfolgs-Variante: Hover-Icon bleibt GRÜN (matcht den grünen Border/Glow);
   muss NACH dem generic :hover stehen weil gleiche Specificity, source-order wins. */
.status-hero-stat--success:hover {
  border-color: rgba(74, 222, 128, 0.55);
}
.status-hero-stat--success:hover .status-hero-stat-icon {
  color: #4ade80;
  opacity: 0.30;
}
/* Lead-Variante: bleibt durchgehend orange (Hover-Default = orange, also kein
   Override nötig, aber explizit für Klarheit). */
.status-hero-stat--lead:hover .status-hero-stat-icon {
  color: var(--orange);
  opacity: 0.26;
}
.status-hero-stat-value,
.status-hero-stat-label { position: relative; z-index: 1; }
.status-hero-stat-value {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}
.status-hero-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.status-title-prefix {
  display: block;
  color: var(--text);
}
.status-title-state {
  display: block;
  color: #4ade80;
  transition: color .25s ease;
}
.status-hero[data-state="degraded"] .status-title-state { color: #fbbf24; }
.status-hero[data-state="outage"]   .status-title-state { color: #ef4444; }
.status-desc {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 620px;
  line-height: 1.65;
  position: relative;
}
.status-desc strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}
.status-monitoring {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 560px;
  position: relative;
}

/* ─── Section ───────────────────────────────────────────────────────── */

.status-section {
  padding: 36px 0 80px;
}
.status-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Toggle-Switch rechts neben den Range-Pills - DEVCON_TOGGLE_GREEN_RED_v1
   1:1 wie .vb-switch im Bot-Dashboard: rot=off, grün=on, weißer Thumb. */
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.status-switch input { display: none; }
.status-switch-label {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}
.status-switch-slider {
  width: 36px; height: 20px;
  background: rgba(237, 66, 69, 0.55);     /* off → red */
  border-radius: 999px;
  position: relative;
  transition: background .15s;
  flex: 0 0 auto;
}
.status-switch-slider::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}
.status-switch input:checked + .status-switch-slider { background: rgba(67, 181, 129, 0.85); } /* on → green */
.status-switch input:checked + .status-switch-slider::after { left: 18px; }
.status-range-pills {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 2px;
}
.status-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms ease;
}
.status-pill:hover { color: var(--text); }
.status-pill.is-active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(255, 138, 34, 0.65);
}
.status-pill.is-ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 12px;
}
.status-pill.is-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ─── Service Cards ─────────────────────────────────────────────────── */

.status-services {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.status-service {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease;
}
.status-service:hover { border-color: rgba(255, 255, 255, 0.10); }
.status-service-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
}
.status-service[data-expandable="false"] .status-service-head { cursor: default; }
.status-service-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 130, 40, 0.08);
  color: var(--orange);
}
.status-service-icon svg { width: 18px; height: 18px; }
.status-service-text {
  min-width: 0;
}
.status-service-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-service-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
/* State-Label (Operational/Degraded/Major Outage) — nur Text in State-Farbe,
   kein Dot, keine Pill-Umrandung, kein Hintergrund. */
.status-service-state {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-service-state--ok       { color: #4ade80; }
.status-service-state--degraded { color: #fbbf24; }
.status-service-state--outage   { color: #ef4444; }
.status-service-uptime {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 72px;
}
.status-service-uptime small {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 400;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.status-service-chevron {
  width: 18px; height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--text-dim);
  transition: transform .25s ease, color .2s ease;
  flex: 0 0 auto;
}
.status-service[data-expandable="false"] .status-service-chevron { display: none; }
.status-service.is-open .status-service-chevron { transform: rotate(180deg); color: var(--orange); }

.status-service-bars {
  padding: 4px 22px 18px;
}
.status-bar-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 1px;
  height: 36px;
  position: relative;
}
.status-bar {
  height: 100%;
  border-radius: 1.5px;
  background: rgba(74, 222, 128, 0.85);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.status-bar:hover { transform: scaleY(1.05); }
/* Bei sehr dichter Range (180d × 24h = 4320 Bars) wird der Hover-Hit zu klein
   - der ganze Track triggert dann grobere Bereich-Tooltips wäre besser, aber
   wir lassen die exakte Stunden-Granularität: User kann reinzoomen. */
.status-bar--ok       { background: rgba(74, 222, 128, 0.85); }
.status-bar--degraded { background: rgba(251, 191, 36, 0.85); }
.status-bar--outage   { background: rgba(239, 68, 68, 0.90); }
.status-bar--none     { background: rgba(255, 255, 255, 0.05); }
.status-bar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
}
.status-bar-foot .status-bar-foot-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

/* ─── Expanded body (Shards / Sub-services) ─────────────────────────── */

.status-service-body {
  display: none;
  padding: 4px 22px 22px;
  margin-top: 6px;
}
.status-service.is-open .status-service-body { display: block; }
.status-body-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin: 16px 0 10px;
}
.status-body-title:first-child { margin-top: 4px; }

.status-shard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.status-shard {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s ease;
}
.status-shard:hover { border-color: rgba(255, 255, 255, 0.10); }
.status-shard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.status-shard-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}
.status-shard-dot--degraded { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15); }
.status-shard-dot--outage   { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.status-shard-ping {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.status-shard-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.status-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.status-kv {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.status-kv-label {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.status-kv-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ─── Cluster-Hex-Grid (Sapphire-Style) ─────────────────────────────── */
.status-cluster-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 2px 0 8px;
  padding-left: 14px;
}
.status-cluster-grid {
  padding: 0 0 4px;
}
.status-cluster-explain {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 16px;
  padding-left: 14px;
  max-width: 720px;
}
.status-cluster-hex-row,
.status-cluster-meta {
  padding-left: 14px;
}
.status-cluster-loading,
.status-cluster-empty {
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 18px 4px;
}
.status-cluster-hex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.status-cluster-hex {
  /* Flat-top Hexagon (Sapphire-Style). 35×30 ≈ Width × √3/2-Ratio (-20%). */
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 35px;
  height: 30px;
  position: relative;
  cursor: pointer;
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.status-cluster-hex:hover { transform: translateY(-2px); }
.status-cluster-hex-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  /* Flat-top Hexagon: Top + Bottom Edges flach, Punkte links + rechts. */
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: #4ade80;
}
.status-cluster-hex-id {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-family: var(--font-display);
}

.status-cluster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
}
.status-cluster-meta strong {
  color: var(--text);
  font-weight: 700;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}


/* ─── Legend ────────────────────────────────────────────────────────── */

.status-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}
.status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.status-dot--ok       { background: rgba(74, 222, 128, 0.85); }
.status-dot--degraded { background: rgba(251, 191, 36, 0.85); }
.status-dot--outage   { background: rgba(239, 68, 68, 0.90); }
.status-dot--none     { background: rgba(255, 255, 255, 0.10); }

/* ─── Tooltip (Bar Hover) ───────────────────────────────────────────── */

.status-tooltip {
  position: fixed;
  z-index: 50;
  background: #1a1a1c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  transform: translate(-50%, -100%) translateY(-10px);
  white-space: nowrap;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
}
.status-tooltip-date {
  font-weight: 600;
  margin-bottom: 2px;
}
.status-tooltip-stat {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.status-tooltip-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
