/* Theme layer — remaps the dark Tailwind palette to the active theme.
   html[data-theme] = dark | midnight | amoled | light | cream ; .theme-light on light themes.
   Elements over photos / accent colour keep white text via .on-media, .accent-bg, .cta-grad, .toast. */

:root, html[data-theme="dark"] { --bg:#07080d; --panel:#0f1117; --panel2:#0b0c12; --nav:#0c0d14; --fg:#e2e8f0; }
html[data-theme="midnight"] { --bg:#0a1022; --panel:#111a33; --panel2:#0d1530; --nav:#0e1630; --fg:#e2e8f0; }
html[data-theme="amoled"]   { --bg:#000000; --panel:#0b0b0b; --panel2:#050505; --nav:#070707; --fg:#e5e5e5; }
html[data-theme="light"]    { --bg:#f3f4f9; --panel:#ffffff; --panel2:#ffffff; --nav:#ffffff; --fg:#1e293b; }
html[data-theme="cream"]    { --bg:#f6f1e7; --panel:#fffdf8; --panel2:#fffaf1; --nav:#fffdf8; --fg:#2b2418; }

html[data-theme] body { background: var(--bg) !important; color: var(--fg); }
html[data-theme] .bg-\[\#0f1117\] { background-color: var(--panel) !important; }
html[data-theme] .bg-\[\#0b0c12\] { background-color: var(--panel2) !important; }
html[data-theme] .bg-\[\#07080d\]\/80 { background-color: color-mix(in srgb, var(--bg) 82%, transparent) !important; }
html[data-theme] .bg-\[\#07080d\]\/85 { background-color: color-mix(in srgb, var(--bg) 88%, transparent) !important; }
html[data-theme] .bg-\[\#0c0d14\]\/90 { background-color: color-mix(in srgb, var(--nav) 92%, transparent) !important; }
html[data-theme="amoled"] .bg-white\/\[0\.03\], html[data-theme="amoled"] .bg-white\/\[0\.02\] { background-color: rgba(255,255,255,.045); }

/* ---------- light themes ---------- */
.theme-light { color-scheme: light; }
.theme-light .text-white:not(.accent-bg):not(.cta-grad *):not(.on-media):not(.on-media *):not(.accent-bg *):not(.toast):not(.toast *):not(.btn-accent):not(.keep-white) { color: #0f172a; }
.theme-light .text-slate-200, .theme-light .text-slate-300 { color: #334155; }
.theme-light .text-slate-400 { color: #526077; }
.theme-light .text-slate-500 { color: #6b7789; }
.theme-light .on-media .text-slate-200, .theme-light .on-media .text-slate-300 { color: #e2e8f0; }
.theme-light .hover\:text-white:hover:not(.on-media) { color: #0f172a; }
.theme-light .placeholder-slate-500::placeholder { color: #94a3b8; }

.theme-light .bg-white\/5, .theme-light .file\:bg-white\/10::file-selector-button { background-color: rgba(15,23,42,.055); }
.theme-light .bg-white\/10 { background-color: rgba(15,23,42,.08); }
.theme-light .bg-white\/15 { background-color: rgba(15,23,42,.14); }
.theme-light .bg-white\/\[0\.02\] { background-color: rgba(15,23,42,.025); }
.theme-light .bg-white\/\[0\.03\] { background-color: #ffffff; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.theme-light[data-theme="cream"] .bg-white\/\[0\.03\] { background-color: var(--panel); }
.theme-light .bg-white\/\[0\.07\] { background-color: rgba(15,23,42,.07); }
.theme-light .hover\:bg-white\/5:hover, .theme-light .hover\:bg-white\/\[0\.04\]:hover, .theme-light .hover\:bg-white\/\[0\.02\]:hover { background-color: rgba(15,23,42,.05); }
.theme-light .hover\:bg-white\/\[0\.05\]:hover, .theme-light .open\:bg-white\/\[0\.05\][open] { background-color: #fff; }
.theme-light .bg-black\/30, .theme-light .bg-black\/40 { background-color: rgba(15,23,42,.06); }
.theme-light .border-white\/5 { border-color: rgba(15,23,42,.08); }
.theme-light .border-white\/10 { border-color: rgba(15,23,42,.12); }
.theme-light .border-white\/15, .theme-light .border-white\/20 { border-color: rgba(15,23,42,.18); }
.theme-light .hover\:border-white\/15:hover { border-color: rgba(15,23,42,.22); }
.theme-light .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(15,23,42,.08); }
.theme-light :where(.divide-white\/5 > :not(:last-child)) { border-color: rgba(15,23,42,.08); }

.theme-light .text-emerald-300, .theme-light .text-emerald-200 { color: #047857; }
.theme-light .text-amber-300, .theme-light .text-amber-200 { color: #b45309; }
.theme-light .text-amber-100\/90 { color: #92400e; }
.theme-light .text-rose-300, .theme-light .text-rose-200 { color: #be123c; }
.theme-light .text-sky-200, .theme-light .text-sky-300 { color: #0369a1; }
.theme-light .text-cyan-300 { color: #0e7490; }
.theme-light .glow { background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%); }

/* admin helpers */
.theme-light .tbl td { border-top-color: rgba(15,23,42,.07); }
.theme-light .btn-ghost { border-color: rgba(15,23,42,.14); color: #1e293b; }
.theme-light .btn-ghost:hover { background: rgba(15,23,42,.05); }
.theme-light .btn-danger { color: #be123c; }
.theme-light select, .theme-light option { color: #0f172a; }
.theme-light ::-webkit-scrollbar-thumb { background: rgba(15,23,42,.2); }
