/* ── Theme toggle button ── */
#theme-toggle {
    background: none;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 5px 7px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
#theme-toggle:hover { border-color: #64748b; color: #e2e8f0; }

/* ── Light mode overrides ── */
html.light body {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

/* Terminal / card backgrounds */
html.light .terminal-box,
html.light .metric-card,
html.light .news-card,
html.light .post-card,
html.light .filing-card,
html.light .section-card,
html.light .feature-card,
html.light .whale-card {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}
html.light .post-card.selected {
    border-color: #c084fc !important;
    background-color: #faf5ff !important;
}
html.light .whale-card:hover,
html.light .whale-card.selected {
    background-color: #fefce8 !important;
    border-color: #eab308 !important;
}

/* Header border */
html.light header { border-color: #e2e8f0 !important; }
html.light .border-slate-800,
html.light .border-t.border-slate-800,
html.light .border-b.border-slate-800 { border-color: #e2e8f0 !important; }

/* Neon text tones — keep hue, drop glow */
html.light .neon-text { color: #0284c7 !important; text-shadow: none !important; }
html.light .neon-red { color: #dc2626 !important; text-shadow: none !important; }
html.light .neon-purple { color: #9333ea !important; text-shadow: none !important; }
html.light .gold-text { color: #ca8a04 !important; text-shadow: none !important; }

/* General text color overrides */
html.light .text-slate-200 { color: #334155 !important; }
html.light .text-slate-300 { color: #475569 !important; }
html.light .text-slate-400 { color: #64748b !important; }
html.light .text-slate-500 { color: #64748b !important; }
html.light .text-slate-600 { color: #94a3b8 !important; }
html.light .text-slate-700 { color: #cbd5e1 !important; }

/* Table styling */
html.light th { color: #475569 !important; border-bottom-color: #e2e8f0 !important; }
html.light td { border-bottom-color: #f1f5f9 !important; color: #334155 !important; }
html.light tr:hover td { background-color: rgba(56, 189, 248, 0.05) !important; }

/* Score pills + rank pills keep their color, just ensure readability */
html.light .score-pill { color: #0891b2 !important; }
html.light .rank-pill { color: #475569 !important; }

/* Code blocks */
html.light .code-block { background-color: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #334155 !important; }

/* Inputs and textareas */
html.light input,
html.light select {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}
html.light input::placeholder { color: #94a3b8 !important; }
html.light textarea {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* Filter buttons */
html.light .filter-btn,
html.light .filter-tab {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html.light .filter-btn:hover,
html.light .filter-tab:hover { border-color: #94a3b8 !important; color: #1e293b !important; }
html.light .filter-btn.active { border-color: #ef4444 !important; color: #ef4444 !important; background-color: rgba(239, 68, 68, 0.08) !important; }
html.light .filter-tab.active { color: #9333ea !important; border-color: #9333ea !important; background-color: rgba(147, 51, 234, 0.08) !important; }

/* Tabs (index, analytics, whales) */
html.light .tab-active { border-bottom-color: #0284c7 !important; color: #0284c7 !important; }
html.light .tab-inactive { color: #94a3b8 !important; }
html.light .tab-inactive:hover { color: #475569 !important; }

/* Community / tag chips */
html.light .community-chip {
    background-color: rgba(56, 189, 248, 0.08) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #0284c7 !important;
}
html.light .ticker-tag {
    background-color: rgba(56, 189, 248, 0.08) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: #0284c7 !important;
}

/* Node type tags — keep their accent colors but lighten backgrounds */
html.light .tag-Company { background-color: rgba(59, 130, 246, 0.1) !important; }
html.light .tag-Person { background-color: rgba(234, 179, 8, 0.1) !important; }
html.light .tag-Entity { background-color: rgba(168, 85, 247, 0.1) !important; }
html.light .tag-Auditor { background-color: rgba(236, 72, 153, 0.1) !important; }
html.light .tag-Fund { background-color: rgba(34, 197, 94, 0.1) !important; }

/* Badges keep their accent colors */
html.light .badge-api, html.light .badge-db, html.light .badge-llm,
html.light .badge-free, html.light .badge-aws { opacity: 0.9; }

/* Status badges */
html.light .status-draft { color: #64748b !important; border-color: rgba(100,116,139,0.4) !important; background: rgba(100,116,139,0.08) !important; }
html.light .status-approved { color: #059669 !important; border-color: rgba(5,150,105,0.4) !important; background: rgba(5,150,105,0.08) !important; }
html.light .status-posted { color: #0284c7 !important; border-color: rgba(2,132,199,0.4) !important; background: rgba(2,132,199,0.08) !important; }

/* Type chips (news page) */
html.light .type-chip { opacity: 0.9; }

/* Importance bar */
html.light .importance-bar { opacity: 0.85; }

/* Nav pills (learn, technical) */
html.light .nav-pill,
html.light .nav-link {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html.light .nav-pill:hover,
html.light .nav-link:hover { border-color: #0284c7 !important; color: #0284c7 !important; }

/* Tip box (learn page) */
html.light .tip-box {
    background-color: rgba(251, 191, 36, 0.06) !important;
    border-color: rgba(251, 191, 36, 0.25) !important;
}

/* Query example (learn page) */
html.light .query-example {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
html.light .query-example:hover { border-color: #0284c7 !important; background-color: rgba(2, 132, 199, 0.04) !important; }

/* Explain text */
html.light .explain { color: #64748b !important; }
html.light .explain strong { color: #334155 !important; }

/* Footer */
html.light footer { border-color: #e2e8f0 !important; }

/* Custom scrollbar */
html.light .custom-scrollbar::-webkit-scrollbar-track { background: #f8fafc !important; }
html.light .custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1 !important; }
html.light .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94a3b8 !important; }

/* Vis.js network (index page) */
html.light #network-viz { background-color: #f8fafc !important; }

/* Buttons with borders — keep functional but adjust bg */
html.light button[class*="border-sky"],
html.light button[class*="border-purple"],
html.light button[class*="border-emerald"],
html.light button[class*="border-rose"],
html.light button[class*="border-red"],
html.light button[class*="border-amber"],
html.light button[class*="border-slate-600"] {
    background-color: transparent !important;
}

/* Theme toggle itself adapts */
html.light #theme-toggle {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html.light #theme-toggle:hover { border-color: #94a3b8 !important; color: #1e293b !important; }

/* Header links — slightly darken for contrast on white */
html.light a[href*="/docs/"] { opacity: 0.9; }

/* Index page specific: dark bg sections in daily/calendar/watchlist */
html.light .bg-black\/30,
html.light .bg-black\/40,
html.light .bg-slate-900,
html.light [class*="bg-slate-900"] {
    background-color: #f1f5f9 !important;
}
html.light [class*="border-slate-700"] {
    border-color: #e2e8f0 !important;
}
html.light [class*="bg-slate-800"] {
    background-color: #f1f5f9 !important;
}
html.light [class*="border-slate-800"] {
    border-color: #e2e8f0 !important;
}
html.light [class*="bg-green-500\/"] {
    background-color: rgba(34, 197, 94, 0.06) !important;
}
html.light [class*="border-green-500\/"] {
    border-color: rgba(34, 197, 94, 0.3) !important;
}
html.light [class*="bg-amber-500\/"] {
    background-color: rgba(245, 158, 11, 0.06) !important;
}
html.light [class*="border-amber-500\/"] {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Char counter (studio) */
html.light .char-counter { color: #64748b !important; }

/* Platform icons keep their brand colors */
html.light .platform-twitter { color: #1d9bf0 !important; background: rgba(29,155,240,0.08) !important; }
html.light .platform-linkedin { color: #0a66c2 !important; background: rgba(10,102,194,0.08) !important; }

/* Section tag (filings page) */
html.light .section-tag { background-color: #f1f5f9 !important; border-color: #e2e8f0 !important; color: #64748b !important; }

/* Edge pill (filings page) */
html.light .edge-pill { opacity: 0.9; }

/* Storage badges */
html.light .llm-badge, html.light .regex-badge { opacity: 0.9; }

/* Whale tiers keep their colors */
html.light .tier-chip { background-color: rgba(0,0,0,0.04) !important; }

/* Tab subtitle */
html.light .tab-subtitle { color: #64748b !important; }

/* Architecture page — diagram containers */
html.light .diagram-container {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
/* SVG box fills: dark card bg → white, dark section bg → light tints */
html.light .diagram-container svg rect[fill="#1e293b"] { fill: #ffffff !important; stroke: #cbd5e1 !important; }
html.light .diagram-container svg rect[fill="#334155"] { fill: #f8fafc !important; stroke: #cbd5e1 !important; }
html.light .diagram-container svg rect[fill="#0f172a"] { fill: #f1f5f9 !important; stroke: #cbd5e1 !important; }
/* Section background rectangles (dashed) */
html.light .diagram-container svg rect[fill="#0c1829"] { fill: rgba(56, 189, 248, 0.04) !important; stroke: rgba(56, 189, 248, 0.25) !important; }
html.light .diagram-container svg rect[fill="#1a1206"] { fill: rgba(251, 191, 36, 0.04) !important; stroke: rgba(251, 191, 36, 0.25) !important; }
html.light .diagram-container svg rect[fill="#0a1a10"] { fill: rgba(74, 222, 128, 0.04) !important; stroke: rgba(74, 222, 128, 0.25) !important; }
html.light .diagram-container svg rect[fill="#1a0a20"] { fill: rgba(192, 132, 252, 0.04) !important; stroke: rgba(192, 132, 252, 0.25) !important; }
/* SVG text: muted text → darker for readability on light bg */
html.light .diagram-container svg text[fill="#64748b"] { fill: #475569 !important; }
html.light .diagram-container svg text[fill="#94a3b8"] { fill: #64748b !important; }
html.light .diagram-container svg text[fill="#cbd5e1"] { fill: #334155 !important; }
html.light .diagram-container svg text[fill="#e2e8f0"] { fill: #1e293b !important; }
/* SVG lines/arrows: lighten strokes */
html.light .diagram-container svg line[stroke="#334155"] { stroke: #cbd5e1 !important; }
html.light .diagram-container svg line[stroke="#475569"] { stroke: #94a3b8 !important; }
