/*
  WyckoffPulse — New Theme (Design System v2)
  =============================================
  Link in the <head> of your index.html and pnf.html AFTER all inline <style>:
    <link rel="stylesheet" href="/static/css/wyckoff_new_theme.css">

  Nothing breaks — this is a pure override. We don't touch the JS.
  =============================================
*/

/* ── Geist fonts (Google Fonts CDN) ── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════
   TOKENS
══════════════════════════════════════ */
:root {
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  /* Surfaces */
  --bg-main:     #050a08;
  --bg-panel:    #080e0b;
  --bg-panel2:   #0a120f;
  --bg-elevated: #0d0d0d;

  /* Emerald brand */
  --emerald:        #115e59;
  --emerald-bright: #10b981;
  --emerald-text:   #34d399;
  --emerald-deep:   #047857;

  /* Ruby bear */
  --ruby:      #e11d48;
  --ruby-text: #fb7185;

  /* Gold (kept as an accent, but used more sparingly) */
  --gold: #a38c53;

  /* Semantic */
  --bull:       #10b981;
  --bull-text:  #34d399;
  --bull-deep:  #10e29c;
  --bear:       #e11d48;
  --bear-text:  #fb7185;
  --warn:       #f59e0b;
  --warn-text:  #fbbf24;
  --cyan:       #00f0ff;
  --cyan-text:  #5ff7ff;
  --violet:     #b14bf4;
  --violet-text:#c88dff;
}

/* ══════════════════════════════════════
   BASE
══════════════════════════════════════ */
body {
  font-family: var(--font-sans) !important;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.header {
  padding: 0 20px !important;
  height: 52px !important;
  gap: 16px !important;
}

.header h1 {
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: -0.2px !important;
  text-transform: none !important;
}

/* ── TABS ── */
.tabs {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  gap: 2px !important;
  padding: 3px !important;
}

.tab {
  height: 28px !important;
  padding: 0 13px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #71717a !important;
  border-radius: 6px !important;
  transition: all 120ms ease !important;
  display: flex !important;
  align-items: center !important;
}

.tab.active {
  background: #115e59 !important;
  color: #fff !important;
  box-shadow: none !important;
}

.tab:hover:not(.active) {
  color: #ededed !important;
  background: rgba(255,255,255,0.05) !important;
}

/* ── BUTTONS ── */
.btn {
  height: 32px !important;
  padding: 0 13px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: var(--font-sans) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transition: all 120ms ease !important;
  white-space: nowrap !important;
}

.btn-primary {
  background: #10b981 !important;
  color: #052a15 !important;
  border: 1px solid #10b981 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}
.btn-primary:hover {
  background: #34d399 !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2) !important;
  transform: none !important;
}
.btn-primary:active {
  background: #047857 !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-primary:disabled {
  background: #0a120f !important;
  color: #52525b !important;
  border-color: #115e59 !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-secondary {
  background: rgba(255,255,255,0.03) !important;
  color: #a1a1aa !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.07) !important;
  color: #ededed !important;
  border-color: rgba(255,255,255,0.2) !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-secondary:active {
  transform: none !important;
  box-shadow: none !important;
}

/* Mode switch (Candles / P&F) */
#mode-candles, #mode-pnf {
  height: 32px !important;
  padding: 0 13px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  font-family: var(--font-sans) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  transition: all 120ms !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

div:has(> #mode-candles) {
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}

/* Select */
select {
  height: 32px !important;
  padding: 0 10px !important;
  font-family: var(--font-sans) !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 6px !important;
  transition: border-color 120ms !important;
}
select:focus { border-color: #10b981 !important; }

/* Render native UI (the <select> dropdown popup, scrollbars, inputs, date pickers)
   in DARK — fixes the OS "grey-on-white" option list shown when a <select> opens. */
:root { color-scheme: dark; }

/* Brand-tint the dropdown popup itself (Chromium honours option background/color). */
select option,
select optgroup {
  background-color: #0a120f !important;
  color: #d4d4d8 !important;
  font-family: var(--font-sans) !important;
}
select option:checked {
  background: #115e59 !important;   /* emerald accent for the selected row */
  color: #ffffff !important;
}

/* ══════════════════════════════════════
   SCREENER PANEL
══════════════════════════════════════ */
.panel-title {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  color: #52525b !important;
}

/* Badges */
.badge-blue  {
  background: rgba(0,240,255,0.15) !important;
  color: #5ff7ff !important;
  border: 1px solid rgba(0,240,255,0.35) !important;
}
.badge-green {
  background: rgba(16,185,129,0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16,185,129,0.35) !important;
}

/* Filters */
.filters {
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  padding: 8px 14px !important;
}
.filter-btn {
  height: 24px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: transparent !important;
  color: #71717a !important;
  border-radius: 12px !important;
  font-family: var(--font-sans) !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  transition: all 120ms !important;
}
.filter-btn:hover {
  color: #ededed !important;
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.filter-btn.active {
  border-color: rgba(16,185,129,0.5) !important;
  color: #34d399 !important;
  background: rgba(16,185,129,0.1) !important;
  box-shadow: none !important;
}

/* Search input */
#symbol-search {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 5px !important;
  font-family: var(--font-sans) !important;
  height: 26px !important;
  padding: 0 8px !important;
  transition: border-color 120ms !important;
}
#symbol-search:focus { border-color: #10b981 !important; }

/* ── TABLE ── */
thead th {
  font-size: 10px !important;
  letter-spacing: 0.8px !important;
  color: #52525b !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  background: rgba(8,14,11,0.99) !important;
  backdrop-filter: none !important;
  font-weight: 700 !important;
  font-family: var(--font-sans) !important;
}
thead th:hover { color: #a1a1aa !important; }

tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03) !important; }
tbody tr:hover { background: rgba(255,255,255,0.025) !important; }
tbody tr.selected {
  background: rgba(16,185,129,0.07) !important;
  border-left: 2px solid #10b981 !important;
}

td { font-family: var(--font-sans) !important; }

.symbol-cell {
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
}

/* RS score — mono font */
.rs-score {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
}

/* Ratio cell — mono */
.ratio-cell {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
}

/* ── TREND BADGES ── */
.trend-badge {
  font-weight: 800 !important;
  letter-spacing: 0.4px !important;
}
.trend-STRONG_LONG {
  background: rgba(16,185,129,0.22) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16,185,129,0.5) !important;
}
.trend-IN-LINE_LONG {
  background: rgba(5,150,105,0.2) !important;
  color: #10e29c !important;
  border: 1px solid rgba(5,150,105,0.45) !important;
}
.trend-WEAK_SHORT {
  background: rgba(225,29,72,0.22) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(225,29,72,0.5) !important;
}
.trend-IN-LINE_SHORT {
  background: rgba(244,63,94,0.2) !important;
  color: #fda4af !important;
  border: 1px solid rgba(244,63,94,0.45) !important;
}
.trend-CHOP {
  background: rgba(161,161,170,0.15) !important;
  color: #d4d4d8 !important;
  border: 1px solid rgba(161,161,170,0.35) !important;
}

/* ── PATTERN BADGES ── */
.pattern-SPRING_PHASE_D {
  background: rgba(0,240,255,0.2) !important;
  color: #5ff7ff !important;
  border: 1px solid rgba(0,240,255,0.45) !important;
}
.pattern-SPRING {
  background: rgba(16,185,129,0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16,185,129,0.45) !important;
}
.pattern-UPTHRUST {
  background: rgba(225,29,72,0.2) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(225,29,72,0.45) !important;
}
.pattern-CONSOLIDATION {
  background: rgba(177,75,244,0.2) !important;
  color: #c88dff !important;
  border: 1px solid rgba(177,75,244,0.45) !important;
}
.pattern-TRENDING {
  background: rgba(161,161,170,0.15) !important;
  color: #d4d4d8 !important;
  border: 1px solid rgba(161,161,170,0.35) !important;
}

/* ── RATIO COLOURS ── */
.ratio-good {
  color: #10e29c !important;
  text-shadow: 0 0 8px rgba(5,150,105,0.55) !important;
  font-family: var(--font-mono) !important;
}
.ratio-ok {
  color: #fbbf24 !important;
  text-shadow: none !important;
  font-family: var(--font-mono) !important;
}
.ratio-bad {
  color: #fb7185 !important;
  text-shadow: none !important;
  font-family: var(--font-mono) !important;
}

/* ══════════════════════════════════════
   CHART PANEL
══════════════════════════════════════ */
.chart-header {
  background: #0d0d0d !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 10px 18px !important;
}

.chart-symbol {
  font-family: var(--font-mono) !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  letter-spacing: -0.5px !important;
}

.info-label {
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  color: #52525b !important;
  font-family: var(--font-sans) !important;
}
.info-value {
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
}

.wyckoff-info {
  background: rgba(177,75,244,0.08) !important;
  border: 1px solid rgba(177,75,244,0.25) !important;
  border-radius: 6px !important;
}
.wyckoff-badge {
  color: #c88dff !important;
  font-weight: 700 !important;
  text-shadow: 0 0 8px rgba(177,75,244,0.4) !important;
}

/* ── DRAW TOOLBAR BUTTONS ── */
#draw-toolbar button {
  background: rgba(8,14,11,0.92) !important;
  color: #71717a !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 5px !important;
  transition: all 120ms !important;
  font-size: 13px !important;
}
#draw-toolbar button:hover {
  color: #ededed !important;
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.16) !important;
}
#draw-toolbar button.active-tool {
  color: #34d399 !important;
  border-color: rgba(16,185,129,0.4) !important;
  background: rgba(16,185,129,0.1) !important;
}

/* Spinner — emerald accent */
.spinner {
  border-top-color: #10b981 !important;
  border-color: rgba(16,185,129,0.2) !important;
}

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-content {
  box-shadow: 0 8px 60px rgba(0,0,0,0.7) !important;
}
.modal-header h2 {
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
}

/* ══════════════════════════════════════
   RS PANEL
══════════════════════════════════════ */
#rs-panel {
  border-top: 1px solid rgba(255,255,255,0.05) !important;
}

/* ══════════════════════════════════════
   SCROLLBAR (thin and tidy)
══════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* ══════════════════════════════════════
   P&F PAGE (pnf.html) 
══════════════════════════════════════ */
.header h1 {
  font-family: var(--font-sans) !important;
}
.symbol-item {
  font-family: var(--font-sans) !important;
}
.symbol-item.active {
  border-left-color: #10b981 !important;
  background: rgba(16,185,129,0.08) !important;
  color: #fff !important;
}
