/* ==========================================================================
   Exactor v2 — GXOR Logic Engine Shared Stylesheet
   Adopts exact Google Stitch Dark-Lab Design System
   Project: 2135775711314860949 | Design System: e5e47cda5b9b45a29e94504ede801c21
   ========================================================================== */

:root {
  /* Core Surfaces */
  --bg-background: #02161d;
  --bg-surface: #02161d;
  --bg-surface-dim: #02161d;
  --bg-surface-lowest: #001017;
  --bg-surface-low: #0a1e25;
  --bg-surface-container: #0e2229;
  --bg-surface-high: #192d34;
  --bg-surface-highest: #25373f;
  --bg-surface-bright: #293c43;

  /* Brand & Semantic Accents */
  --color-primary: #43e5bb;
  --color-primary-container: #00c8a0;
  --color-primary-fixed: #60fbd0;
  --color-primary-fixed-dim: #3adeb5;
  --color-on-primary: #00382b;
  --color-on-primary-container: #004d3c;

  --color-secondary: #68d5ec;
  --color-secondary-container: #1e9eb4;
  --color-secondary-fixed: #a5eeff;
  --color-on-secondary: #00363f;
  --color-on-secondary-container: #002f37;

  --color-tertiary: #b8d0df;
  --color-on-surface: #d1e6ef;
  --color-on-surface-variant: #bacac2;
  --color-outline: #85948d;
  --color-outline-variant: #3c4a44;

  --color-error: #ffb4ab;
  --color-error-container: #93000a;
  --color-on-error-container: #ffdad6;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Glows */
  --glow-emerald: 0 0 20px rgba(0, 200, 160, 0.25);
  --glow-ice: 0 0 20px rgba(104, 213, 236, 0.2);
}

html {
  scroll-behavior: smooth;
  /* Offset anchor jumps so fixed headers never cover section titles */
  scroll-padding-top: 5.5rem;
  background-color: var(--bg-background);
  color: var(--color-on-surface);
  font-family: var(--font-body);
}

body {
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  background-color: var(--bg-background);
  color: var(--color-on-surface);
}

/* Custom sleek dark-lab scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface-lowest);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-highest);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-outline-variant);
}

/* Photonic Matrix Grid Backdrops */
.exactor-dot-grid {
  background-image: radial-gradient(rgba(67, 229, 187, 0.22) 1px, transparent 1px);
  background-size: 24px 24px;
}

.exactor-hairline-top {
  position: relative;
}

.exactor-hairline-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 229, 187, 0.65), transparent);
  pointer-events: none;
}

/* Range Slider Styling for Flat SU Calculator */
input[type="range"].exactor-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-surface-highest);
  outline: none;
}

input[type="range"].exactor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--color-primary);
  border: 2px solid var(--bg-surface-lowest);
  box-shadow: 0 0 10px rgba(67, 229, 187, 0.55);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

input[type="range"].exactor-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--color-secondary);
}

input[type="range"].exactor-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--color-primary);
  border: 2px solid var(--bg-surface-lowest);
  box-shadow: 0 0 10px rgba(67, 229, 187, 0.55);
  cursor: pointer;
}

/* Code blocks & syntax highlighting helpers */
.code-viewport {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
}

.tok-kw { color: #68d5ec; font-weight: 600; }
.tok-fn { color: #43e5bb; font-weight: 600; }
.tok-num { color: #60fbd0; }
.tok-op { color: #43e5bb; font-weight: 700; }
.tok-cmt { color: #6a8288; font-style: italic; }
.tok-str { color: #a5eeff; }
.tok-var { color: #d1e6ef; }

/* Interactive SVG DAG nodes */
.dag-node-group {
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.dag-node-group:hover rect {
  stroke: #68d5ec;
  stroke-width: 1.6;
}

.dag-node-selected rect {
  stroke: #43e5bb !important;
  stroke-width: 2 !important;
}

/* Form Error / Success Alerts */
.alert-error {
  background: rgba(147, 0, 10, 0.25);
  border: 1px solid rgba(255, 180, 171, 0.55);
  color: #ffdad6;
}

.alert-success {
  background: rgba(0, 200, 160, 0.12);
  border: 1px solid rgba(67, 229, 187, 0.45);
  color: #60fbd0;
}

/* Pulse dot utility */
.status-led {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}

/* Mobile drawer visibility */
.mobile-nav-open {
  display: flex !important;
}

@media (max-width: 1023px) {
  .console-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .console-sidebar.open {
    transform: translateX(0);
  }
}
