/* ===================================================================
   notrack.ai — light/dark theme (prototype)
   Mechanism: [data-theme="dark"] on <html>. Every color used on the
   landing (Tailwind utilities) and in the content/Trends custom CSS is
   mapped deliberately so nothing loses contrast in either theme.
   =================================================================== */

:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* base page */
[data-theme="dark"] body { background:#0e0e10; color:#e4e4e7; }
[data-theme="dark"] ::selection { background:rgba(16,185,129,.30); }

/* ---------- Tailwind color utilities (landing + content chrome) ---------- */
[data-theme="dark"] .bg-white      { background-color:#151517 !important; }
[data-theme="dark"] .bg-zinc-50    { background-color:#1a1a1d !important; }
[data-theme="dark"] .bg-zinc-100   { background-color:#232327 !important; }

[data-theme="dark"] .text-zinc-900 { color:#f4f4f5 !important; }
[data-theme="dark"] .text-zinc-800 { color:#e9e9ec !important; }
[data-theme="dark"] .text-zinc-700 { color:#d4d4d8 !important; }
[data-theme="dark"] .text-zinc-600 { color:#c1c1c8 !important; }
[data-theme="dark"] .text-zinc-500 { color:#a1a1aa !important; }
[data-theme="dark"] .text-zinc-400 { color:#8c8c95 !important; }
[data-theme="dark"] .text-zinc-300 { color:#71717a !important; }

[data-theme="dark"] .border-zinc-200 { border-color:#2a2a2e !important; }
[data-theme="dark"] .border-zinc-300 { border-color:#34343a !important; }
[data-theme="dark"] .border-zinc-400 { border-color:#3c3c44 !important; }

/* emerald accent — brighten so it reads on dark */
[data-theme="dark"] .text-emerald-600 { color:#34d399 !important; }
[data-theme="dark"] .text-emerald-700 { color:#6ee7b7 !important; }
[data-theme="dark"] .bg-emerald-50    { background-color:rgba(16,185,129,.12) !important; }
[data-theme="dark"] .border-emerald-200 { border-color:rgba(16,185,129,.30) !important; }
/* .bg-emerald-500 (dot/buttons) and .text-white stay — correct on dark */

/* red (error box / destructive button) */
[data-theme="dark"] .bg-red-50     { background-color:rgba(239,68,68,.12) !important; }
[data-theme="dark"] .text-red-700  { color:#fca5a5 !important; }
[data-theme="dark"] .border-red-200{ border-color:rgba(239,68,68,.30) !important; }
/* .bg-red-600/.bg-red-700 stay — visible on dark */

/* translucent sticky header (backdrop-blur) */
[data-theme="dark"] .bg-white\/85 { background-color:rgba(14,14,16,.82) !important; }
[data-theme="dark"] .bg-white\/90 { background-color:rgba(14,14,16,.88) !important; }

/* dark pill BUTTONS (<a>/<button>.bg-zinc-900) -> emerald so the CTA pops;
   dark BOX (<div>.bg-zinc-900, the article CTA banner) -> elevated dark */
[data-theme="dark"] a.bg-zinc-900,
[data-theme="dark"] button.bg-zinc-900 { background-color:#059669 !important; }
[data-theme="dark"] a.bg-zinc-900:hover,
[data-theme="dark"] button.bg-zinc-900:hover,
[data-theme="dark"] .hover\:bg-black:hover { background-color:#047857 !important; }
[data-theme="dark"] div.bg-zinc-900 { background-color:#17171a !important; border:1px solid #2a2a2e; }

/* ---------- content.php custom CSS: prose, TOC, hub cards, blocks ---------- */

/* headings / strong text -> bright */
[data-theme="dark"] .article-title,
[data-theme="dark"] .prose-nt h2,
[data-theme="dark"] .tr-featured-title,
[data-theme="dark"] .tr-card-title,
[data-theme="dark"] .nt-points b,
[data-theme="dark"] .nt-metric .v,
[data-theme="dark"] .nt-card h4 { color:#f4f4f5 !important; }
[data-theme="dark"] .prose-nt h3,
[data-theme="dark"] .prose-nt strong { color:#e7e7ea !important; }

/* body copy */
[data-theme="dark"] .prose-nt p,
[data-theme="dark"] .prose-nt ul,
[data-theme="dark"] .prose-nt ol,
[data-theme="dark"] .prose-nt .article-lede,
[data-theme="dark"] .article-toc a,
[data-theme="dark"] .nt-points li { color:#c6c6cd !important; }
[data-theme="dark"] .nt-points span,
[data-theme="dark"] .nt-card-list li { color:#a1a1aa !important; }

/* muted / meta */
[data-theme="dark"] .article-byline,
[data-theme="dark"] .tr-meta,
[data-theme="dark"] .tr-excerpt,
[data-theme="dark"] .nt-card p,
[data-theme="dark"] .article-toc-h,
[data-theme="dark"] .nt-metric .k,
[data-theme="dark"] .prose-nt figcaption,
[data-theme="dark"] .prose-nt blockquote cite { color:#8f8f98 !important; }
[data-theme="dark"] .article-byline .dot { color:#52525b !important; }

/* emerald accents (links, kickers, cta text, toc numbers) */
[data-theme="dark"] .prose-nt a,
[data-theme="dark"] .tr-readmore,
[data-theme="dark"] .article-toc li::before,
[data-theme="dark"] .article-toc a:hover,
[data-theme="dark"] .nt-card .kx,
[data-theme="dark"] .nt-metric .v.accent,
[data-theme="dark"] .nt-metric .v.good { color:#34d399 !important; }
[data-theme="dark"] .nt-metric .v.signal { color:#22d3ee !important; }

/* surfaces & borders */
[data-theme="dark"] .article-toc,
[data-theme="dark"] .nt-metric,
[data-theme="dark"] .tr-loadmore,
[data-theme="dark"] .tr-fbtn { background:#1a1a1d !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .nt-card,
[data-theme="dark"] .nt-chapter,
[data-theme="dark"] .tr-featured,
[data-theme="dark"] .tr-card { background:#151517 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .tr-featured-media,
[data-theme="dark"] .tr-card-media,
[data-theme="dark"] .nt-chapter-body { background:#1c1c20 !important; }
[data-theme="dark"] .nt-chapter-head { background:linear-gradient(180deg,#1a1a1d,#151517) !important; border-color:#2a2a2e !important; }

/* code */
[data-theme="dark"] .prose-nt code,
[data-theme="dark"] .prose-nt pre.code { background:#1c1c20 !important; border-color:#2a2a2e !important; color:#d4d4d8 !important; }

/* blockquote + notes */
[data-theme="dark"] .prose-nt blockquote { background:rgba(16,185,129,.08) !important; }
[data-theme="dark"] .prose-nt blockquote p { color:#cdd5d0 !important; }
[data-theme="dark"] .prose-nt .note { background:rgba(59,130,246,.12) !important; border-color:rgba(59,130,246,.30) !important; color:#bfdbfe !important; }
[data-theme="dark"] .prose-nt .note-warn { background:rgba(251,146,60,.12) !important; border-color:rgba(251,146,60,.30) !important; color:#fed7aa !important; }

/* hub: filter chips, chip tags, cta banner */
[data-theme="dark"] .tr-fbtn { color:#c6c6cd !important; }
[data-theme="dark"] .tr-fbtn.is-active { background:#059669 !important; border-color:#059669 !important; color:#fff !important; }
[data-theme="dark"] .tr-chip { background:rgba(16,185,129,.15) !important; color:#6ee7b7 !important; }
[data-theme="dark"] .tr-cta { background:#14231d !important; border-color:rgba(16,185,129,.28) !important; }
[data-theme="dark"] .tr-cta-title { color:#6ee7b7 !important; }
[data-theme="dark"] .tr-cta-sub   { color:#34d399 !important; }
[data-theme="dark"] .nt-tag-free  { background:rgba(16,185,129,.15) !important; color:#6ee7b7 !important; }

/* ---------- landing custom classes (suggestion chips, lang menu, cards, bubbles) ---------- */
[data-theme="dark"] .chip { background:#151517 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .chip:hover { background:#1c1c20 !important; border-color:#3c3c44 !important; }
[data-theme="dark"] .feature-card:hover { background:#1a1a1d !important; border-color:#3c3c44 !important; }
[data-theme="dark"] .msg-user { background:#26262a !important; color:#e9e9ec !important; }
[data-theme="dark"] .app-banner.show { background:#151517 !important; border-top-color:#2a2a2e !important; }
[data-theme="dark"] .send-btn:disabled { background:#3f3f46 !important; }

/* language switcher (trigger + popup) — index + content */
[data-theme="dark"] .lang-trigger { color:#a1a1aa !important; }
[data-theme="dark"] .lang-trigger:hover { color:#f4f4f5 !important; }
[data-theme="dark"] .lang-pop { background:#151517 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .lang-pop a { color:#c6c6cd !important; }
[data-theme="dark"] .lang-pop a:hover { background:#1c1c20 !important; color:#ffffff !important; }
[data-theme="dark"] .lang-pop a.active { color:#34d399 !important; }

/* content: comparison table, old hub cards, article kicker/cover, badges, notes */
[data-theme="dark"] .ctable th, [data-theme="dark"] .ctable td { border-color:#2a2a2e !important; }
[data-theme="dark"] .ctable thead th { background:#1a1a1d !important; color:#f4f4f5 !important; }
[data-theme="dark"] .ctable td:first-child { color:#c6c6cd !important; }
[data-theme="dark"] .hub-card { background:#151517 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .hub-card:hover { background:#1c1c20 !important; border-color:#3c3c44 !important; }
[data-theme="dark"] .hub-cross a:hover { background:#1c1c20 !important; color:#ffffff !important; }
[data-theme="dark"] .article-kicker { color:#6ee7b7 !important; background:rgba(16,185,129,.15) !important; border-color:rgba(16,185,129,.30) !important; }
[data-theme="dark"] .article-cover { background:#1c1c20 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .tr-chip { border-color:rgba(16,185,129,.30) !important; }
[data-theme="dark"] .note-good { background:rgba(16,185,129,.12) !important; border-color:rgba(16,185,129,.30) !important; color:#6ee7b7 !important; }
[data-theme="dark"] .note b { color:#f4f4f5 !important; }
[data-theme="dark"] .nt-tag-paid { color:#34d399 !important; background:rgba(16,185,129,.10) !important; border-color:rgba(16,185,129,.25) !important; }
/* article headings: keep the accent colour in dark (brighter for contrast) */
[data-theme="dark"] .prose-nt h2 { color:#34d399 !important; }
[data-theme="dark"] .prose-nt h3 { color:#5eead4 !important; }
/* collapsible accordion (details) in dark */
[data-theme="dark"] .prose-nt .nt-acc { background:#151517 !important; border-color:#2a2a2e !important; }
[data-theme="dark"] .prose-nt .nt-acc > summary { color:#6ee7b7 !important; }
[data-theme="dark"] .prose-nt .nt-acc > summary:hover { background:#1c1c20 !important; }
[data-theme="dark"] .prose-nt .nt-acc > summary::after { border-color:#34d399 !important; }
[data-theme="dark"] .prose-nt .nt-kicker { color:#34d399 !important; }

/* ---------- the light/dark toggle (pill switch) ---------- */
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; background:none; border:0; padding:4px; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.theme-toggle .tt-track { position:relative; width:46px; height:26px; border-radius:999px; background:#e4e4e7; transition:background .22s ease; display:inline-block; }
.theme-toggle .tt-thumb { position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#ffffff; box-shadow:0 1px 3px rgba(0,0,0,.28); transition:transform .22s ease, background .22s ease; display:flex; align-items:center; justify-content:center; font-size:12px; line-height:1; }
.theme-toggle .tt-thumb::after { content:"☀\FE0E"; }
[data-theme="dark"] .theme-toggle .tt-track { background:#3f3f46; }
[data-theme="dark"] .theme-toggle .tt-thumb { transform:translateX(20px); background:#0e0e10; }
[data-theme="dark"] .theme-toggle .tt-thumb::after { content:"🌙\FE0E"; }
.theme-toggle:focus-visible .tt-track { outline:2px solid #059669; outline-offset:2px; }

/* ---------- chat (app.php): variable palette override (html[] beats :root) ---------- */
html[data-theme="dark"] {
  --bg-page:#0e0e10; --bg-side:#151517; --bg-soft:#1a1a1d; --bg-hover:#26262b;
  --border:#2a2a2e; --border-strong:#3a3a42;
  --text:#f4f4f5; --text-2:#a7a7b0; --text-3:#8c8c95;
  --accent:#10b981; --user:#f4f4f5;
  --a-soft:rgba(22,163,74,.16); --b-soft:rgba(37,99,235,.16);
  --c-soft:rgba(192,38,211,.16); --gold-soft:rgba(202,138,4,.16);
}
/* chat: elements that use `background:var(--text);color:#fff` (dark pill in light theme)
   invert to light-on-light in dark → repaint as light chip + dark text (ChatGPT-dark look) */
html[data-theme="dark"] aside.sidebar button.new-chat,
html[data-theme="dark"] #newPill,
html[data-theme="dark"] button.go { background:#f4f4f5 !important; color:#0e0e10 !important; }
html[data-theme="dark"] aside.sidebar button.new-chat:hover,
html[data-theme="dark"] #newPill:hover,
html[data-theme="dark"] button.go:hover:not(:disabled) { background:#d4d4d8 !important; }
html[data-theme="dark"] button.go:disabled { background:#33333a !important; color:#8c8c95 !important; }
html[data-theme="dark"] .row.usr .avatar { background:#52525b !important; color:#f4f4f5 !important; }

/* support form fields (tw.css page) */
html[data-theme="dark"] .sup-field { background:#151517 !important; border-color:#2a2a2e !important; color:#f4f4f5 !important; }
html[data-theme="dark"] .sup-field::placeholder { color:#71717a !important; }

/* ---------- download page: dark by default → light override so it follows the theme ---------- */
html[data-theme="light"] {
  --bg:#ffffff; --card:#fafafa; --line:#e4e4e7; --fg:#18181b; --mut:#71717a;
}
