/* ============================================================
   GOD'S EYE VIEW × KINETIC ENTERPRISE — THEME v2
   Drop AFTER GEV's own stylesheets in index.html.
   No JS changes required.

   HOW IT WORKS
   GEV's components read from CSS custom properties on :root
   (--accent, --bg-dark, --glass-bg, --text-primary, --font-mono,
   etc.). This file overrides those properties so every GEV
   component that uses var(--accent) automatically gets Kinetic's
   green. The structural rules below handle components that hardcode
   colours instead of reading the vars.
   ============================================================ */

/* ------------------------------------------------
   0. FONTS (must be first)
   ------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Inter:wght@400;500;600&family=Geist+Mono:wght@400;600&display=swap');

/* ------------------------------------------------
   1. OVERRIDE GEV'S :root TOKENS
   This is the core of the reskin. Every component
   that reads var(--accent) or var(--bg-dark) now
   gets the Kinetic value.
   ------------------------------------------------ */
:root {
  /* Canvas — Kinetic's dark, not GEV's #0a0a0f */
  --bg-dark:          #101418;

  /* Surface — the panels and glass layers */
  --glass-bg:         rgba(23, 29, 35, 0.92);
  --glass-border:     #2A323B;
  --glass-border-hover: #364049;

  /* The one accent — Kinetic green replaces GEV's cyan */
  --accent:           #3CB44B;
  --accent-dim:       rgba(60, 180, 75, 0.10);
  --accent-glow:      rgba(60, 180, 75, 0.25);
  --scroll-thumb:     rgba(60, 180, 75, 0.40);
  --scroll-track:     rgba(255, 255, 255, 0.04);

  /* Text — warm off-white instead of cool grey */
  --text-primary:     #E9E7E2;
  --text-secondary:   rgba(155, 161, 168, 0.72);
  --text-dim:         rgba(130, 139, 149, 0.55);

  /* Menu background (opaque, for native <select> popups) */
  --menu-bg:          #171D23;

  /* Fonts — three voices, not two */
  --font-mono: 'Geist Mono', 'SF Mono', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
  /* Kinetic adds a serif voice for display headings */
  --font-serif: 'Cormorant Garamond', Georgia, serif;

  /* Radius — Kinetic uses 6px, not 16/10 */
  --panel-radius:     6px;
  --btn-radius:       6px;

  /* Motion */
  --transition-fast:  120ms cubic-bezier(.25,.1,.25,1);
  --transition-smooth: 180ms cubic-bezier(.25,.1,.25,1);

  /* Dock label colour — shift from blue-tinted to neutral */
  --dock-label-color: rgba(200, 210, 200, 0.72);
}

/* ------------------------------------------------
   2. BODY / CANVAS
   ------------------------------------------------ */
html, body {
  background: var(--bg-dark) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
}

#cesiumContainer {
  background: var(--bg-dark) !important;
}

/* Selection — the one green */
::selection {
  background: var(--accent-dim) !important;
  color: var(--accent) !important;
}

/* Keyboard focus ring */
:where(
  button, a[href], input, select, textarea,
  summary, [tabindex], [role='button'], [role='switch'],
  [role='tab'], [role='checkbox'], [role='radio']
):focus-visible {
  outline-color: var(--accent) !important;
}

/* ------------------------------------------------
   3. PANELS / GLASS SURFACES
   ------------------------------------------------ */
[class*="panel"],
[class*="glass"],
[class*="side"],
[data-panel] {
  background: var(--glass-bg) !important;
  border-color: var(--glass-border) !important;
  border-radius: var(--panel-radius) !important;
}

[class*="panel"] h3,
[class*="panel"] h4,
[data-panel] h3,
[data-panel] h4,
.dock-label,
[class*="label-title"] {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: .24em !important;
  text-transform: uppercase !important;
  color: var(--text-dim) !important;
}

/* ------------------------------------------------
   4. BUTTONS
   ------------------------------------------------ */
button,
[class*="btn"],
[class*="action-button"] {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .1em !important;
  border-radius: var(--btn-radius) !important;
  transition: all var(--transition-fast) !important;
}

button.primary,
[class*="btn--primary"],
[class*="action-button"].active,
button[aria-pressed="true"] {
  background: var(--accent) !important;
  color: #0A0A0A !important;
  border-color: var(--accent) !important;
}
button.primary:hover,
[class*="btn--primary"]:hover {
  background: #5BD86B !important;
  border-color: #5BD86B !important;
}

button.danger,
[class*="btn--danger"] {
  color: #C97F72 !important;
  border-color: rgba(201,127,114,.4) !important;
  background: transparent !important;
}
button.danger:hover {
  border-color: #C97F72 !important;
  background: rgba(201,127,114,.08) !important;
}

button:disabled,
[class*="btn"]:disabled {
  opacity: .35 !important;
  cursor: not-allowed !important;
}

/* ------------------------------------------------
   5. ACCENT COLOUR — catches all hardcoded cyan
   ------------------------------------------------ */
[class*="accent"],
.text-accent {
  color: var(--accent) !important;
}
[class*="border-accent"],
.outline-accent {
  border-color: var(--accent) !important;
}
.bg-accent-dim,
[class*="bg-accent"] {
  background: var(--accent-dim) !important;
}

/* ------------------------------------------------
   6. INPUTS
   ------------------------------------------------ */
input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea,
[class*="search"],
[class*="omnibar"] input {
  background: #12171C !important;
  border: 1px solid #364049 !important;
  border-radius: var(--btn-radius) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  caret-color: var(--accent) !important;
  transition: border-color var(--transition-fast) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-dim) !important;
  outline: none !important;
}

label,
[class*="field-label"],
[class*="input-label"] {
  font-family: var(--font-mono) !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  color: var(--text-secondary) !important;
}

/* ------------------------------------------------
   7. STAT VALUES / NUMBERS
   ------------------------------------------------ */
[class*="stat"],
[class*="metric"],
[class*="hud-value"],
[class*="readout"] {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
}
[class*="stat"] .value,
[class*="metric"] .value,
[class*="hud-value"] {
  color: var(--accent) !important;
}

/* ------------------------------------------------
   8. CHIPS / BADGES / STATUS PILLS
   ------------------------------------------------ */
[class*="chip"],
[class*="pill"],
[class*="badge"],
[class*="status"] {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
  border-radius: 99px !important;
}

[class*="chip"].on,
[class*="chip"].active,
[class*="pill"].ok,
[class*="pill"].on,
[class*="status"].active {
  color: var(--accent) !important;
  border-color: rgba(60,180,75,.3) !important;
  background: var(--accent-dim) !important;
}

[class*="chip"].warn,
[class*="pill"].warn {
  color: #C79A4E !important;
  border-color: rgba(199,154,78,.35) !important;
  background: rgba(199,154,78,.08) !important;
}

[class*="chip"].bad,
[class*="pill"].bad,
[class*="status"].error {
  color: #C97F72 !important;
  border-color: rgba(201,127,114,.35) !important;
  background: rgba(201,127,114,.08) !important;
}

/* ------------------------------------------------
   9. TABS
   ------------------------------------------------ */
[role="tab"],
[class*="tab"] {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  border-bottom-color: transparent !important;
  transition: color var(--transition-fast) !important;
}
[role="tab"][aria-selected="true"],
[class*="tab"].on,
[class*="tab"].active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* ------------------------------------------------
   10. MODAL / DIALOG
   ------------------------------------------------ */
[role="dialog"],
[class*="modal"],
[class*="dialog"] {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--panel-radius) !important;
  backdrop-filter: blur(12px) !important;
}
[role="dialog"] h3,
[class*="modal"] h3,
[class*="dialog"] h3 {
  font-family: var(--font-serif) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}
[role="dialog"]::backdrop,
[class*="modal-overlay"],
[class*="dialog-overlay"] {
  background: rgba(16,20,24,.72) !important;
}

/* ------------------------------------------------
   11. TOAST / NOTIFICATION
   ------------------------------------------------ */
[class*="toast"],
[class*="notification"],
[class*="alert"] {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-left: 3px solid var(--accent) !important;
  border-radius: var(--panel-radius) !important;
  font-size: 12.5px !important;
  color: var(--text-secondary) !important;
}
[class*="toast"].warn,
[class*="notification"].warn {
  border-left-color: #C79A4E !important;
}
[class*="toast"].bad,
[class*="notification"].error {
  border-left-color: #C97F72 !important;
}

/* ------------------------------------------------
   12. PROGRESS BAR
   ------------------------------------------------ */
progress,
[class*="progress"],
[class*="linear-progress"] {
  height: 4px !important;
  border-radius: 99px !important;
}
progress::-webkit-progress-bar { background: var(--bg-dark) !important; }
progress::-webkit-progress-value { background: var(--accent) !important; }
progress::-moz-progress-bar { background: var(--accent) !important; }

/* ------------------------------------------------
   13. CESIUM VIEWER OVERRIDES
   ------------------------------------------------ */
.cesium-viewer-bottom {
  display: none !important;
}
.cesium-viewer-toolbar button {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--btn-radius) !important;
}
.cesium-viewer-toolbar button:hover {
  border-color: var(--glass-border-hover) !important;
}
#cesium-credits,
#gev-credits {
  color: var(--text-dim) !important;
  font-family: var(--font-mono) !important;
}

/* ------------------------------------------------
   14. HUD (intelligence readout)
   ------------------------------------------------ */
.hud-bottom-left,
[class*="hud"],
[data-hud] {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: .08em !important;
  color: var(--text-dim) !important;
}
.hud-bottom-left b,
[class*="hud"] b,
[data-hud] b {
  color: var(--accent) !important;
}

/* ------------------------------------------------
   15. SCROLLBARS
   ------------------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--glass-border-hover); }

/* ------------------------------------------------
   16. LAYER TOGGLES / CHECKBOXES
   ------------------------------------------------ */
[class*="layer"] input[type="checkbox"],
[data-layer] input[type="checkbox"] {
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 3px !important;
  background: var(--bg-dark) !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  position: relative !important;
}
[class*="layer"] input[type="checkbox"]:checked,
[data-layer] input[type="checkbox"]:checked {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
[class*="layer"] input[type="checkbox"]:checked::after,
[data-layer] input[type="checkbox"]:checked::after {
  content: "" !important;
  position: absolute !important;
  left: 5px !important;
  top: 2px !important;
  width: 4px !important;
  height: 8px !important;
  border: solid #0A0A0A !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}

input[type="checkbox"][role="switch"] {
  appearance: none !important;
  width: 34px !important;
  height: 19px !important;
  border-radius: 99px !important;
  background: #1C242B !important;
  border: 1px solid var(--glass-border) !important;
  position: relative !important;
  cursor: pointer !important;
  transition: background var(--transition-smooth) !important;
}
input[type="checkbox"][role="switch"]::after {
  content: "" !important;
  position: absolute !important;
  left: 2px !important;
  top: 2px !important;
  width: 13px !important;
  height: 13px !important;
  border-radius: 50% !important;
  background: var(--text-dim) !important;
  transition: all var(--transition-smooth) !important;
}
input[type="checkbox"][role="switch"]:checked {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
input[type="checkbox"][role="switch"]:checked::after {
  left: 17px !important;
  background: #0A0A0A !important;
}

/* ------------------------------------------------
   17. REDUCED MOTION
   ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
