/* ═══════════════════════════════════════════════════════════
   Northvault — Theme system
   Each theme re-points the design tokens the whole app already
   uses. No HTML/JS structure depends on any of this; switching
   is a live CSS variable swap. Default (no attribute) = Aurora.
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Sora:wght@400;600;700&display=swap');

/* ---------- 1 · AURORA GLASS (default) ---------- */
:root,
html[data-theme="aurora"] {
    --primary: #7c74ff;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd4;
    --primary-rgb: 124, 116, 255;
    --accent: #00d1c1;
    --accent-2: #d648b2;
    --accent-glow: rgba(0, 209, 193, 0.30);
    --bg-dark: #0a0b1a;
    --bg-rgb: 12, 14, 32;
    --bg-sidebar: rgba(16, 18, 40, 0.86);
    --bg-card: rgba(20, 22, 48, 0.58);
    --bg-card-hover: rgba(28, 30, 62, 0.72);
    --bg-input: rgba(255, 255, 255, 0.05);
    --text: #eef0ff;
    --text-muted: #8b8fb5;
    --border: rgba(255, 255, 255, 0.09);
}
html[data-theme="aurora"] body,
html:not([data-theme]) body { font-family: 'Sora', 'Inter', -apple-system, sans-serif; }
html[data-theme="aurora"] body::before,
html:not([data-theme]) body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(38% 40% at 18% 14%, rgba(124,116,255,.30), transparent 70%),
        radial-gradient(36% 38% at 84% 24%, rgba(0,209,193,.22), transparent 72%),
        radial-gradient(44% 46% at 60% 96%, rgba(214,72,178,.18), transparent 70%);
    animation: nvDrift 18s ease-in-out infinite alternate;
}
@keyframes nvDrift { to { transform: translate3d(3%, 2%, 0) scale(1.06); } }
html[data-theme="aurora"] .card,
html[data-theme="aurora"] .stat-card,
html:not([data-theme]) .card,
html:not([data-theme]) .stat-card { backdrop-filter: blur(18px); }

/* ---------- 2 · OBSIDIAN (institutional) ---------- */
html[data-theme="obsidian"] {
    --primary: #c6a15b;
    --primary-light: #d8bd85;
    --primary-dark: #9c7d3a;
    --primary-rgb: 198, 161, 91;
    --accent: #c6a15b;
    --accent-2: #b8863f;
    --accent-glow: rgba(198, 161, 91, 0.22);
    --bg-dark: #0b0b0d;
    --bg-rgb: 11, 11, 13;
    --bg-sidebar: #0e0e11;
    --bg-card: #141417;
    --bg-card-hover: #1b1b1f;
    --bg-input: rgba(236, 233, 226, 0.05);
    --text: #ece9e2;
    --text-muted: #8f8b80;
    --border: rgba(236, 233, 226, 0.11);
}
html[data-theme="obsidian"] body { font-family: 'Inter', -apple-system, sans-serif; }
html[data-theme="obsidian"] .wallet-balance,
html[data-theme="obsidian"] #pageTitle,
html[data-theme="obsidian"] .sidebar-brand h2,
html[data-theme="obsidian"] .stat-value,
html[data-theme="obsidian"] .auth-header h1 {
    font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.01em;
}
/* sharper, quieter surfaces */
html[data-theme="obsidian"] .card,
html[data-theme="obsidian"] .stat-card,
html[data-theme="obsidian"] .modal,
html[data-theme="obsidian"] .auth-card { border-radius: 8px; }
html[data-theme="obsidian"] .btn,
html[data-theme="obsidian"] .btn-primary { border-radius: 6px; }

/* ---------- 3 · NOVA (crypto-native) ---------- */
html[data-theme="nova"] {
    --primary: #d648b2;
    --primary-light: #e879f9;
    --primary-dark: #7c3aed;
    --primary-rgb: 214, 72, 178;
    --accent: #5eead4;
    --accent-2: #7c3aed;
    --accent-glow: rgba(214, 72, 178, 0.35);
    --bg-dark: #0d0620;
    --bg-rgb: 22, 12, 45;
    --bg-sidebar: rgba(20, 10, 45, 0.90);
    --bg-card: rgba(40, 22, 74, 0.52);
    --bg-card-hover: rgba(52, 30, 92, 0.68);
    --bg-input: rgba(255, 255, 255, 0.06);
    --text: #f4eeff;
    --text-muted: #a99fce;
    --border: rgba(255, 255, 255, 0.11);
}
html[data-theme="nova"] body { font-family: 'Outfit', 'Inter', sans-serif; }
html[data-theme="nova"] body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(50% 42% at 50% 0%, rgba(124,58,237,.40), transparent 68%),
        radial-gradient(40% 34% at 88% 82%, rgba(214,72,178,.26), transparent 72%);
}
html[data-theme="nova"] .wallet-balance {
    background: linear-gradient(90deg, #ff9df4, #a78bfa, #5eead4);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="nova"] .card,
html[data-theme="nova"] .stat-card { backdrop-filter: blur(16px); border-radius: 18px; }

/* ---------- 4 · DAYBREAK (light) ---------- */
html[data-theme="daybreak"] {
    --primary: #12b981;
    --primary-light: #34d399;
    --primary-dark: #0e9268;
    --primary-rgb: 18, 185, 129;
    --accent: #0e7490;
    --accent-2: #0891b2;
    --accent-glow: rgba(18, 185, 129, 0.22);
    --bg-dark: #f5f7f9;
    --bg-rgb: 245, 247, 249;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f3f6;
    --bg-input: #eef2f5;
    --text: #141b23;
    --text-muted: #6b7688;
    --border: rgba(20, 30, 45, 0.10);
}
html[data-theme="daybreak"] body { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
/* light-theme fixups for the few surfaces that assumed a dark ground */
html[data-theme="daybreak"] .header { background: rgba(255, 255, 255, 0.82); }
html[data-theme="daybreak"] .card,
html[data-theme="daybreak"] .stat-card,
html[data-theme="daybreak"] .auth-card { box-shadow: 0 12px 34px -22px rgba(20, 60, 45, 0.35); }
html[data-theme="daybreak"] .auth-bg { opacity: 0.5; }

/* ═══════════ Theme switcher (injected by js/theme.js) ═══════════ */
.nv-theme-switch { position: fixed; right: 22px; bottom: 22px; z-index: 4000; font-family: 'Inter', sans-serif; }
.nv-ts-toggle {
    width: 46px; height: 46px; border-radius: 50%; cursor: pointer; border: 1px solid var(--border);
    background: var(--bg-sidebar); color: var(--primary-light); font-size: 17px;
    display: grid; place-items: center; backdrop-filter: blur(14px);
    box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.5); transition: transform 0.2s, color 0.2s;
}
.nv-ts-toggle:hover { transform: translateY(-2px) rotate(-8deg); color: var(--primary); }
.nv-ts-menu {
    position: absolute; right: 0; bottom: 58px; width: 226px; padding: 8px;
    background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 16px;
    backdrop-filter: blur(20px); box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.55);
    opacity: 0; transform: translateY(8px) scale(0.97); transform-origin: bottom right;
    pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.nv-theme-switch.open .nv-ts-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.nv-ts-head {
    font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--text-muted); padding: 6px 10px 8px;
}
.nv-ts-opt {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; cursor: pointer;
    background: none; border: none; border-radius: 10px; padding: 9px 10px; color: var(--text);
    font-family: inherit; font-size: 13.5px; font-weight: 500; transition: background 0.15s;
}
.nv-ts-opt:hover { background: rgba(var(--primary-rgb), 0.12); }
.nv-ts-opt.active { background: rgba(var(--primary-rgb), 0.16); }
.nv-ts-sw { width: 22px; height: 22px; border-radius: 7px; flex: none; border: 1px solid rgba(255, 255, 255, 0.18); }
.nv-ts-name { flex: 1; }
.nv-ts-chk { font-size: 12px; color: var(--primary-light); opacity: 0; }
.nv-ts-opt.active .nv-ts-chk { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    html body::before { animation: none !important; }
    .nv-ts-toggle, .nv-ts-menu { transition: none; }
}
