/* ==========================================================================
   CoolRoute Lab — "Compact Lab" design tokens (Stitch SCREEN_1)
   Kaynak: Stitch projesi "CoolRoute Research Portal Redesign",
   ekran "CoolRoute Compact Lab & API Specifications".
   Eski açık-temalı sistem korunuyor: css/style.css + index-warm-paper.html.
   Bu dosya SADECE yeni koyu compact lab sayfası (index.html) içindir.
   Tailwind CDN layout'u üretir; buradaki token'lar tek doğruluk kaynağıdır.
   ========================================================================== */

/* ---------- 1. token'lar ---------- */
:root {
  --lab-bg: #09090b;
  --lab-surface: #121215;
  --lab-surface-subtle: #18181b;
  --lab-panel: #0c0c0e;
  --lab-border: #27272a;
  --lab-primary: #f4f4f5;
  --lab-muted: #a1a1aa;
  --lab-faint: #71717a;
  --lab-accent: #38bdf8;
  --lab-heat: #f97316;
  --lab-good: #34d399;
  --lab-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --lab-radius: 0px;
}

/* ---------- 2. taban ---------- */
body {
  background-color: var(--lab-bg);
  color: #d4d4d8;
  font-family: var(--lab-font-mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #3f3f46;
  color: #fafafa;
}

/* ---------- 3. form elemanları ---------- */
input[type="range"] {
  accent-color: var(--lab-accent);
}

input[type="range"]:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

.hairline-border {
  border-color: var(--lab-border);
}

/* ---------- 4. fallback gating ----------
   js/main.js <html>'e .js ekler; JS çalışınca statik fallback SVG gizlenir,
   canvas'lar devralır. JS yoksa fallback görünür kalır. */
.demo-fallback {
  display: block;
}

html.js .demo-fallback {
  display: none;
}

html.js .demo-fallback.absolute {
  display: block;
  visibility: hidden;
}

/* ---------- 5. canvas boyutları ---------- */
#heat-canvas,
#pareto-map {
  width: 100%;
  height: 100%;
  display: block;
}

#pareto-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

#heat-canvas {
  cursor: crosshair;
}

#soh-canvas {
  width: 100%;
  display: block;
}

/* ---------- 5b. harita katmanı (JS'in ürettiği SVG için) ---------- */
.map-grid line {
  stroke: #1e293b;
  stroke-width: 1;
}

.map-warm-street {
  transition: opacity 0.5s ease;
}

.map-coast {
  stroke: #38bdf8;
  stroke-width: 2.5;
  fill: none;
}

.map-water-label {
  font-family: var(--lab-font-mono);
  font-style: italic;
  font-size: 13px;
  fill: #38bdf8;
  opacity: 0.8;
}

.map-district-dot {
  fill: #71717a;
}

.map-district-label {
  font-family: var(--lab-font-mono);
  font-size: 12px;
  font-weight: 600;
  fill: #e4e4e7;
}

.map-od {
  fill: #f4f4f5;
  stroke: #09090b;
  stroke-width: 2;
}

.map-route {
  stroke: #38bdf8;
  stroke-width: 4.5;
  stroke-linecap: round;
  fill: none;
}

.map-route-ghost {
  stroke: #71717a;
  stroke-width: 2;
  stroke-dasharray: 5 5;
  opacity: 0.35;
  fill: none;
}

/* ---------- 5c. pareto scatter ---------- */
#pareto-scatter {
  width: 100%;
  height: auto;
}

.scatter-grid line {
  stroke: #3f3f46;
  stroke-width: 1.5;
}

.axis-label {
  font-family: var(--lab-font-mono);
  font-size: 10px;
  fill: #a1a1aa;
}

.frontier-point {
  cursor: pointer;
}

.frontier-point circle {
  fill: #121215;
  stroke: #38bdf8;
  stroke-width: 2;
}

.frontier-point.is-near circle {
  fill: #38bdf8;
}

.frontier-label {
  font-family: var(--lab-font-mono);
  font-size: 8.5px;
  fill: #a1a1aa;
}

#pareto-selected {
  fill: none;
  pointer-events: none;
}

/* ---------- 5d. batarya efsanesi ---------- */
.curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-family: var(--lab-font-mono);
  font-size: 11px;
  color: #a1a1aa;
}

.curve-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.curve-legend li.is-near {
  font-weight: 700;
  color: #f4f4f5;
}

.curve-legend li:not(.is-near) {
  opacity: 0.6;
}

.curve-legend .dot {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  display: inline-block;
}

/* ---------- 6. sekmeler ---------- */
.tab-btn {
  cursor: pointer;
  background: transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.tab-btn.active {
  border-bottom-color: var(--lab-accent);
  color: #f4f4f5;
  background-color: rgba(39, 39, 42, 0.4);
}

/* ---------- 7. ince kaydırma ---------- */
.custom-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--lab-border);
}

.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 8. hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
