/* ===== THEME SYSTEM ===== */
:root, [data-theme="cyber"] {
  --bg-body: #050d1a;
  --bg-card: #0a1628;
  --bg-panel: #060f1e;
  --bg-track: #1a2332;
  --bg-hover: #0d1f35;
  --bg-input: #050d1a;

  --accent: #00ff88;
  --accent-hover: #00cc6a;
  --accent-contrast: #050d1a;
  --accent-bg: rgba(0,255,136,0.067);
  --accent-bg-strong: rgba(0,255,136,0.133);
  --accent-border: rgba(0,255,136,0.267);

  --text-primary: #c0c8d0;
  --text-secondary: #667788;
  --text-tertiary: #445566;
  --text-muted: #334455;
  --text-dimmed: #2a3a4a;
  --text-label: #8899aa;
  --text-link: #1a3a5c;
  --text-subtle: #556677;

  --border: #1a3a5c;
  --border-light: #0d1f35;

  --color-green: #00ff88;
  --color-red: #ff4466;
  --color-orange: #ffaa00;
  --color-blue: #00aaff;

  --green-bg: rgba(0,255,136,0.033);
  --green-border: rgba(0,255,136,0.133);
  --red-bg: rgba(255,68,102,0.033);
  --red-border: rgba(255,68,102,0.133);
  --orange-bg: rgba(255,170,0,0.033);
  --orange-border: rgba(255,170,0,0.133);

  --bull-text: #5a8a6a;
  --bear-text: #8a5a5a;
  --summary-text: #7a9ab8;

  --font-main: 'Courier New', monospace;
  --shadow-card: none;
  --radius: 8px;

  --grid-opacity: 0.04;
  --scan-opacity: 1;
  --glow: 0 0 10px #00ff88;
  --glow-strong: 0 0 25px #00ff88, 0 0 50px rgba(0,255,136,0.4);
  --flicker: flicker 8s infinite;
}

[data-theme="minimal"] {
  --bg-body: #ffffff;
  --bg-card: #fbfbfa;
  --bg-panel: #f7f7f5;
  --bg-track: #ebebea;
  --bg-hover: #f0efed;
  --bg-input: #ffffff;

  --accent: #37352f;
  --accent-hover: #2f2e2b;
  --accent-contrast: #ffffff;
  --accent-bg: rgba(55,53,47,0.03);
  --accent-bg-strong: rgba(55,53,47,0.08);
  --accent-border: rgba(55,53,47,0.13);

  --text-primary: #37352f;
  --text-secondary: #787774;
  --text-tertiary: #9b9a97;
  --text-muted: #c7c6c4;
  --text-dimmed: #ddddd9;
  --text-label: #37352f;
  --text-link: #9b9a97;
  --text-subtle: #787774;

  --border: #e3e2e0;
  --border-light: #ebebea;

  --color-green: #2da44e;
  --color-red: #cf222e;
  --color-orange: #d9730d;
  --color-blue: #2f80ed;

  --green-bg: rgba(45,164,78,0.06);
  --green-border: rgba(45,164,78,0.2);
  --red-bg: rgba(207,34,46,0.06);
  --red-border: rgba(207,34,46,0.2);
  --orange-bg: rgba(217,115,13,0.06);
  --orange-border: rgba(217,115,13,0.2);

  --bull-text: #2da44e;
  --bear-text: #cf222e;
  --summary-text: #555555;

  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06);
  --radius: 6px;

  --grid-opacity: 0;
  --scan-opacity: 0;
  --glow: none;
  --glow-strong: none;
  --flicker: none;
}

/* Theme toggle - pill-shaped segmented control */
.theme-toggle-btn {
  display: inline-flex;
  border: none;
  border-radius: 20px;
  padding: 3px;
  cursor: pointer;
  transition: background 0.3s;
  gap: 0;
}
[data-theme="cyber"] .theme-toggle-btn { background: #0d1f35; }
[data-theme="minimal"] .theme-toggle-btn { background: #e3e2e0; }

.theme-toggle-btn .toggle-opt {
  padding: 6px 16px;
  border-radius: 17px;
  font-family: var(--font-main);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: bold;
  transition: all 0.3s;
  pointer-events: none;
  line-height: 1.2;
}

[data-theme="cyber"] .toggle-opt[data-t="cyber"] {
  background: var(--accent);
  color: var(--accent-contrast);
}
[data-theme="cyber"] .toggle-opt[data-t="minimal"] {
  background: transparent;
  color: #445566;
}
[data-theme="minimal"] .toggle-opt[data-t="minimal"] {
  background: var(--accent);
  color: var(--accent-contrast);
}
[data-theme="minimal"] .toggle-opt[data-t="cyber"] {
  background: transparent;
  color: #9b9a97;
}
