/* ═══════════════════════════════════════════════════════
   THEME BASE — 6 Selectable Themes
   Default (Crimson Forge) + Sandstone + Neon Matrix + Obsidian Gold + Deep Ocean + Glass
   ═══════════════════════════════════════════════════════ */

/* ── Default: Crimson Forge (applied to :root) ── */
:root, [data-theme="crimson-forge"] {
    --bg-page: #0f0a0a;
    --bg-header: linear-gradient(135deg, #1a1010, #150d0d);
    --bg-card: #1a1010;
    --bg-card2: #221515;
    --border: #2e1a1a;
    --text: #d8b8a8;
    --text-dim: #8a5544;
    --accent: #ff6633;
    --accent-bg: rgba(255,102,51,0.1);
    --gradient-title: linear-gradient(135deg, #ff4422, #ff8800);
    --effort-lucky: #44cc66;
    --effort-unlucky: #ff3355;
    --effort-bar-good: #44cc66;
    --effort-bar-mid: #ffaa44;
    --effort-bar-bad: #ff3355;
    --status-ok-bg: rgba(68,204,102,0.15);
    --status-ok-text: #44cc66;
    --status-err-bg: rgba(255,51,85,0.15);
    --status-err-text: #ff3355;
    --status-load-bg: #221515;
    --status-load-text: #8a5544;
    --btc-accent: #f7931a;
    --block-row-bg: #221515;
    --switcher-bg: #1a1010;
    --switcher-border: #2e1a1a;
    --switcher-text: #d8b8a8;
    --switcher-hover: #2e1a1a;
    --switcher-active: #ff6633;
    --switcher-active-text: #0f0a0a;
}

/* ── Sandstone (Light) ── */
[data-theme="sandstone"] {
    --bg-page: #faf6f0;
    --bg-header: linear-gradient(135deg, #f0e8d8, #e8dcc8);
    --bg-card: #f5eedf;
    --bg-card2: #f0e8d8;
    --border: #e0d4be;
    --text: #4a3c2a;
    --text-dim: #8a7a60;
    --accent: #8a6520;
    --accent-bg: rgba(138,101,32,0.1);
    --gradient-title: linear-gradient(135deg, #8a6520, #b07028);
    --effort-lucky: #155724;
    --effort-unlucky: #721c24;
    --effort-bar-good: #28a745;
    --effort-bar-mid: #ffc107;
    --effort-bar-bad: #dc3545;
    --status-ok-bg: #d4edda;
    --status-ok-text: #155724;
    --status-err-bg: #f8d7da;
    --status-err-text: #721c24;
    --status-load-bg: #f0e8d8;
    --status-load-text: #8a7a60;
    --btc-accent: #f7931a;
    --block-row-bg: white;
    --switcher-bg: #f5eedf;
    --switcher-border: #e0d4be;
    --switcher-text: #4a3c2a;
    --switcher-hover: #e8dcc8;
    --switcher-active: #8a6520;
    --switcher-active-text: #faf6f0;
}

/* ── Neon Matrix ── */
[data-theme="neon-matrix"] {
    --bg-page: #0a0a0f;
    --bg-header: linear-gradient(135deg, #0f0f18, #111119);
    --bg-card: #111119;
    --bg-card2: #16161f;
    --border: #1e1e2e;
    --text: #c8c8d8;
    --text-dim: #6a6a80;
    --accent: #00ffd5;
    --accent-bg: rgba(0,255,213,0.08);
    --gradient-title: linear-gradient(135deg, #00ffd5, #00ccaa);
    --effort-lucky: #00ff88;
    --effort-unlucky: #ff4466;
    --effort-bar-good: #00ff88;
    --effort-bar-mid: #ffd700;
    --effort-bar-bad: #ff4466;
    --status-ok-bg: rgba(0,255,136,0.15);
    --status-ok-text: #00ff88;
    --status-err-bg: rgba(255,68,102,0.15);
    --status-err-text: #ff4466;
    --status-load-bg: #16161f;
    --status-load-text: #6a6a80;
    --btc-accent: #f7931a;
    --block-row-bg: #16161f;
    --switcher-bg: #111119;
    --switcher-border: #1e1e2e;
    --switcher-text: #c8c8d8;
    --switcher-hover: #1e1e2e;
    --switcher-active: #00ffd5;
    --switcher-active-text: #0a0a0f;
}

/* ── Obsidian Gold ── */
[data-theme="obsidian-gold"] {
    --bg-page: #111116;
    --bg-header: linear-gradient(135deg, #1a1815, #161412);
    --bg-card: #1a1815;
    --bg-card2: #201c18;
    --border: #2a2520;
    --text: #d4c8b0;
    --text-dim: #7a6d55;
    --accent: #c9a84c;
    --accent-bg: rgba(201,168,76,0.1);
    --gradient-title: linear-gradient(135deg, #c9a84c, #e8d5a3);
    --effort-lucky: #4caf50;
    --effort-unlucky: #f44336;
    --effort-bar-good: #4caf50;
    --effort-bar-mid: #ffc107;
    --effort-bar-bad: #f44336;
    --status-ok-bg: rgba(76,175,80,0.15);
    --status-ok-text: #4caf50;
    --status-err-bg: rgba(244,67,54,0.15);
    --status-err-text: #f44336;
    --status-load-bg: #201c18;
    --status-load-text: #7a6d55;
    --btc-accent: #f7931a;
    --block-row-bg: #201c18;
    --switcher-bg: #1a1815;
    --switcher-border: #2a2520;
    --switcher-text: #d4c8b0;
    --switcher-hover: #2a2520;
    --switcher-active: #c9a84c;
    --switcher-active-text: #111116;
}

/* ── Deep Ocean ── */
[data-theme="deep-ocean"] {
    --bg-page: #0b1120;
    --bg-header: linear-gradient(135deg, #0f1a30, #0d1528);
    --bg-card: #0f1a30;
    --bg-card2: #132240;
    --border: #1a2940;
    --text: #b0c8d8;
    --text-dim: #4a6a80;
    --accent: #00d4aa;
    --accent-bg: rgba(0,212,170,0.08);
    --gradient-title: linear-gradient(135deg, #00d4aa, #55ccff);
    --effort-lucky: #44dd88;
    --effort-unlucky: #ff6b6b;
    --effort-bar-good: #44dd88;
    --effort-bar-mid: #ffcc44;
    --effort-bar-bad: #ff6b6b;
    --status-ok-bg: rgba(68,221,136,0.15);
    --status-ok-text: #44dd88;
    --status-err-bg: rgba(255,107,107,0.15);
    --status-err-text: #ff6b6b;
    --status-load-bg: #132240;
    --status-load-text: #4a6a80;
    --btc-accent: #f7931a;
    --block-row-bg: #132240;
    --switcher-bg: #0f1a30;
    --switcher-border: #1a2940;
    --switcher-text: #b0c8d8;
    --switcher-hover: #1a2940;
    --switcher-active: #00d4aa;
    --switcher-active-text: #0b1120;
}

/* ─────────────────────────────────────────────────────── */
/*  GLASS  — clear glass panels with bright borders + sheen */
/* ─────────────────────────────────────────────────────── */
[data-theme="glass"] {
    --bg-page: transparent;
    --bg-header: transparent;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card2: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.5);
    --text: rgba(255,255,255,0.95);
    --text-dim: rgba(255,255,255,0.6);
    --accent: #ffffff;
    --accent-bg: rgba(255,255,255,0.08);
    --gradient-title: linear-gradient(135deg, #ffffff, #cfe3ff);
    --effort-lucky: #44cc66;
    --effort-unlucky: #ff3355;
    --effort-bar-good: #44cc66;
    --effort-bar-mid: #ffaa44;
    --effort-bar-bad: #ff3355;
    --status-ok-bg: rgba(68,204,102,0.2);
    --status-ok-text: #86efac;
    --status-err-bg: rgba(255,51,85,0.2);
    --status-err-text: #ff6680;
    --status-load-bg: rgba(255,255,255,0.05);
    --status-load-text: rgba(255,255,255,0.6);
    --btc-accent: #fbbf24;
    --block-row-bg: rgba(255,255,255,0.04);
    --switcher-bg: rgba(255,255,255,0.06);
    --switcher-border: rgba(255,255,255,0.5);
    --switcher-text: rgba(255,255,255,0.95);
    --switcher-hover: rgba(255,255,255,0.12);
    --switcher-active: #ffffff;
    --switcher-active-text: #0b0b0f;
}

/* Forest backdrop — glass panels sit ON this */
/* NOTE: place a forest photo named 'forest.jpg' in the same folder as this CSS */
/* Falls back to dark green if image not found */
[data-theme="glass"] body {
    background:
        linear-gradient(180deg, rgba(5,20,10,0.55) 0%, rgba(10,40,20,0.35) 50%, rgba(5,20,10,0.6) 100%),
        url('forest.jpg') center/cover fixed no-repeat,
        #0a1a0a;
    background-attachment: fixed;
    color: rgba(255,255,255,0.95);
}

/* CLEAR glass panels — minimal blur, bright rim, diagonal sheen */
[data-theme="glass"] .header,
[data-theme="glass"] .pool-card,
[data-theme="glass"] .feed-table {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
}

/* Diagonal sheen streak — the big highlight on top-left */
[data-theme="glass"] .header::before,
[data-theme="glass"] .pool-card::before,
[data-theme="glass"] .feed-table::before {
    content: '';
    position: absolute;
    top: -10%; left: -10%;
    width: 55%; height: 140%;
    background: linear-gradient(115deg,
        transparent 0%,
        transparent 35%,
        rgba(255,255,255,0.08) 45%,
        rgba(255,255,255,0.22) 50%,
        rgba(255,255,255,0.08) 55%,
        transparent 65%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
    transform: skewX(-8deg);
}

/* Corner sparkle — top-left bright dot */
[data-theme="glass"] .header::after,
[data-theme="glass"] .pool-card::after {
    content: '';
    position: absolute;
    top: 8px; left: 10px;
    width: 14px; height: 14px;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.3) 40%, transparent 70%);
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
    filter: blur(1px);
}

/* Pool card hover */
[data-theme="glass"] .pool-card { transition: transform 0.3s, box-shadow 0.3s; }
[data-theme="glass"] .pool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.75);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.15),
        0 14px 44px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Buttons: small clear glass chips */
[data-theme="glass"] .controls button {
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.45);
}
[data-theme="glass"] .controls button:hover {
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.7);
}
[data-theme="glass"] .controls button.active {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.85);
}
[data-theme="glass"] .controls label,
[data-theme="glass"] .last-update {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Block rows inside cards */
[data-theme="glass"] .block-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

/* Lift content above sheen + sparkle pseudo-elements */
[data-theme="glass"] .pool-head,
[data-theme="glass"] .pool-effort,
[data-theme="glass"] .pool-blocks,
[data-theme="glass"] .effort-bar,
[data-theme="glass"] .header > *,
[data-theme="glass"] .feed-table > * {
    position: relative;
    z-index: 3;
}

/* Title: bright gradient */
[data-theme="glass"] .header h1 {
    background: linear-gradient(135deg, #ffffff, #cfe3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

/* Effort value — bright LCD glow */
[data-theme="glass"] .pool-effort .current-val {
    color: rgba(255,255,255,0.98);
    text-shadow: 0 0 16px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

/* ── Anti-copy protection ── */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ── Glass: additional elements added later ── */
[data-theme="glass"] #networkTicker,
[data-theme="glass"] .effort-calc,
[data-theme="glass"] .nh-panel {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
[data-theme="glass"] #networkTicker b,
[data-theme="glass"] #networkTicker span {
    color: rgba(255,255,255,0.9) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
