/* ==========================================================================
   DESIGN TOKENS — POLIGON DYDAKTYCZNY
   Spójna paleta i zmienne dla trybu "Sala" (jasny) i "Poligon" (ciemny)
   ========================================================================== */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --topbar-height: 60px;
  --sidebar-width: 276px;

  --transition-fast: 140ms ease;
  --transition-med: 220ms ease;
  --touch-min: 38px;
}

/* Tryb Sala (Domyślny — czysty, czytelny pod rzutnik i oświetlenie dzienne) */
[data-theme="light"] {
  --bg-app: #f3f2ec;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f3f2ec;
  --bg-stage: #eceae2;
  --bg-hover: #e7e5dc;
  --bg-active: #dfe6dc;

  /* Aliasy semantyczne (spójna baza pod tryb poligonowy / ciemny) */
  --bg: var(--bg-app);
  --surface: var(--bg-surface);
  --surface-muted: #f3f2ec;
  --surface-key-fn: #eceae4;
  --accent: var(--accent-primary);
  --border: var(--border-subtle);

  --text-primary: #141d17;
  --text-secondary: #3f4f43;
  --text-muted: #58655a;
  --text-inverse: #ffffff;

  --border-subtle: #dcd9ce;
  --border-strong: #b4b0a2;
  --focus-ring: #24492d;
  --focus-shadow: rgba(47, 93, 58, 0.24);

  /* Akcenty taktyczne i funkcyjne */
  --accent-primary: #2f5d3a;      /* Wojskowa zieleń oliwkowa / NATO olive */
  --accent-primary-hover: #24492d;
  --accent-primary-soft: rgba(47, 93, 58, 0.12);

  --accent-amber: #b45309;        /* Bursztyn / Coyote — główna akcja CTA */
  --accent-amber-hover: #92400e;
  --accent-amber-soft: rgba(180, 83, 9, 0.13);

  --accent-blue: #1d4ed8;         /* Siatka kilometrowa / północ siatkowa */
  --accent-blue-soft: rgba(37, 99, 235, 0.12);

  --accent-red: #dc2626;          /* Igła magnetyczna (N) / błędy */
  --accent-red-soft: rgba(220, 38, 38, 0.12);

  --accent-green: #15803d;        /* Potwierdzenie / poprawne */
  --accent-green-soft: rgba(22, 163, 74, 0.13);

  /* Dwutonowe ikony kategorii: zgaszona oliwka (W terenie) i ciepły piasek (Na mapie) */
  --tone-field-bg: #e7ede4;
  --tone-field-fg: #2f5d3a;
  --tone-field-border: rgba(47, 93, 58, 0.2);
  --tone-map-bg: #f3ecdd;
  --tone-map-fg: #8c5a2b;
  --tone-map-border: rgba(140, 90, 43, 0.22);

  /* Etykiety HUD i arkusze kartograficzne */
  --hud-bg: rgba(252, 251, 247, 0.9);
  --hud-border: rgba(143, 136, 120, 0.36);
  --hud-text: #1c241e;
  --map-frame-border: #cdc8b9;
  --map-neatline: #8f8878;
  --map-sheet-shadow: 0 6px 20px rgba(24, 32, 24, 0.09), 0 1px 3px rgba(24, 32, 24, 0.06);

  --shadow-sm: 0 1px 2px rgba(16, 24, 18, 0.05);
  --shadow-md: 0 4px 14px rgba(16, 24, 18, 0.08);
  --shadow-lg: 0 12px 30px rgba(16, 24, 18, 0.14);

  /* Specyficzne dla map i przyrządów (styl polskiej mapy wojskowej 1:25 000) */
  --map-paper: #faf8f1;
  --map-contour: #a65c2e;
  --map-forest: #b8e186;
  --map-water: #bae6fd;
  --map-water-stroke: #0369a1;
  --map-grid: rgba(29, 78, 216, 0.56);
  --map-road: #c96a32;
  --map-road-stroke: #292524;
}

/* Tryb Poligon (Ciemny — grafitowo-oliwkowy, wysoki kontrast w słabym świetle) */
[data-theme="dark"] {
  --bg-app: #0f1411;
  --bg-surface: #171e19;
  --bg-surface-alt: #1e2721;
  --bg-stage: #121814;
  --bg-hover: #243028;
  --bg-active: #2b3a30;

  --bg: var(--bg-app);
  --surface: var(--bg-surface);
  --surface-muted: #1e2721;
  --surface-key-fn: #26322a;
  --accent: var(--accent-primary);
  --border: var(--border-subtle);

  --text-primary: #ecf2ec;
  --text-secondary: #b4c2b6;
  --text-muted: #829386;
  --text-inverse: #0f1411;

  --border-subtle: #2a372e;
  --border-strong: #405245;

  --accent-primary: #4c9a5e;
  --accent-primary-hover: #5db270;
  --accent-primary-soft: rgba(76, 154, 94, 0.18);

  --accent-amber: #d97706;
  --accent-amber-hover: #f59e0b;
  --accent-amber-soft: rgba(217, 119, 6, 0.18);

  --accent-blue: #60a5fa;
  --accent-blue-soft: rgba(96, 165, 250, 0.16);

  --accent-red: #f87171;
  --accent-red-soft: rgba(248, 113, 113, 0.16);

  --accent-green: #4ade80;
  --accent-green-soft: rgba(74, 222, 128, 0.16);

  --tone-field-bg: rgba(76, 154, 94, 0.16);
  --tone-field-fg: #8fd19e;
  --tone-field-border: rgba(76, 154, 94, 0.32);
  --tone-map-bg: rgba(217, 166, 98, 0.16);
  --tone-map-fg: #e2be86;
  --tone-map-border: rgba(217, 166, 98, 0.32);

  --hud-bg: rgba(21, 28, 23, 0.9);
  --hud-border: rgba(76, 100, 84, 0.55);
  --hud-text: #ecf2ec;
  --map-frame-border: #3a483d;
  --map-neatline: #6b7265;
  --map-sheet-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);

  /* Mapa w trybie poligonowym ma lekko przygaszony papier, aby nie oślepiać */
  --map-paper: #dedbc8;
  --map-contour: #967247;
  --map-forest: #bdd1ad;
  --map-water: #9cc6df;
  --map-water-stroke: #2c6e9e;
  --map-grid: rgba(37, 99, 235, 0.42);
  --map-road: #d3a657;
  --map-road-stroke: #6d4c1b;
}
