/* ═══════════════════════════════════════════════════════════════════════
   theme.css — Site-wide theme overrides for worldwidefriends.net / Kindred

   Strategy: Each page defines its own :root { … } inline (dark defaults).
   html[data-theme="light"] and html[data-theme="colorful"] have higher
   CSS specificity than :root and therefore override every variable sitewide.

   Loaded from nav.php (included in every page's <body>).
   Theme choice is stored in localStorage under key "kTheme".
   ═══════════════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════════════════════
   LIGHT / BRIGHT THEME
   ══════════════════════════════════════════════════════════════════════ */

html[data-theme="light"] {
    /* backgrounds */
    --bg:           #F5F4FF;
    --bg-2:         #ECEAFB;
    /* cards / surfaces */
    --card:         rgba(255,255,255,0.85);
    --card-hover:   rgba(255,255,255,0.98);
    /* borders */
    --border:       rgba(0,0,0,0.09);
    --border-light: rgba(0,0,0,0.16);
    /* text */
    --text:         #12102A;
    --text-muted:   #5C5A7A;
    --text-faint:   #9E9CBB;
    /* accents — slightly darkened for contrast on light bg */
    --violet:       #6D28D9;
    --pink:         #DB2777;
    --cyan:         #0284C7;
    --green:        #059669;
    --amber:        #D97706;
    --red:          #DC2626;
    --purple:       #7C3AED;
    /* gradients */
    --grad:         linear-gradient(135deg, #6D28D9 0%, #DB2777 100%);
    --grad-text:    linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    /* shadow */
    --shadow:       0 20px 60px rgba(0,0,0,0.10);
    /* alternate variable names used on some pages */
    --surface:      #ECEAFB;
    --muted:        #5C5A7A;
    --faint:        #9E9CBB;
    /* radius (unchanged) */
    --radius:       16px;
    --radius-lg:    24px;
}

/* ── Light: nav overrides (nav.php uses hardcoded rgba values, not vars) ── */
html[data-theme="light"] .site-nav {
    background: rgba(245,244,255,0.94);
    border-bottom-color: rgba(0,0,0,0.10);
}
html[data-theme="light"] .sn-logo-name { color: #12102A; }
html[data-theme="light"] .sn-btn { color: #5C5A7A; }
html[data-theme="light"] .sn-btn:hover,
html[data-theme="light"] .sn-group.open .sn-btn {
    background: rgba(0,0,0,0.06); color: #12102A;
}
html[data-theme="light"] .sn-drop {
    background: rgba(245,244,255,0.99);
    border-color: rgba(0,0,0,0.09);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
html[data-theme="light"] .sn-drop li a { color: #5C5A7A; }
html[data-theme="light"] .sn-drop li a:hover {
    background: rgba(109,40,217,0.10); color: #12102A;
}
html[data-theme="light"] .sn-drop .sn-sep { background: rgba(0,0,0,0.09); }
html[data-theme="light"] .sn-hamburger span { background: #5C5A7A; }
@media (max-width: 680px) {
    html[data-theme="light"] .sn-groups {
        background: rgba(245,244,255,0.99);
        border-bottom-color: rgba(0,0,0,0.10);
    }
}

/* ── Light: theme-dot active ring ── */
html[data-theme="light"] .sn-theme-btn.sn-theme-active { border-color: rgba(109,40,217,0.55); }

/* ── Light: page card overrides (hardcoded rgba(13,13,26) backgrounds) ──
   These classes use hardcoded dark values instead of CSS variables,
   so they must be explicitly overridden here.
   ── */

/* Shared light card surface */
html[data-theme="light"] .content-card,
html[data-theme="light"] .profile-header,
html[data-theme="light"] .profile-header .section,
html[data-theme="light"] .section,
html[data-theme="light"] .album-card,
html[data-theme="light"] .filter-card,
html[data-theme="light"] .member-card,
html[data-theme="light"] .add-form-wrap,
html[data-theme="light"] .book-card,
html[data-theme="light"] .quote-card,
html[data-theme="light"] .modal-inner,
html[data-theme="light"] .msg-card,
html[data-theme="light"] .likes-box,
html[data-theme="light"] .bm-box,
html[data-theme="light"] .sent-panel,
html[data-theme="light"] .tri-card,
html[data-theme="light"] .inbox-section,
html[data-theme="light"] .card {
    background: rgba(255,255,255,0.88) !important;
    border-color: rgba(0,0,0,0.09) !important;
    color: #12102A;
}

/* friends.php — inner elements that use hardcoded rgba(255,255,255,…) */
html[data-theme="light"] .box-count {
    background: rgba(0,0,0,0.07) !important;
    color: var(--text-muted);
}
html[data-theme="light"] .person-card:hover,
html[data-theme="light"] .sent-card:hover {
    background: rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] .pa-btn {
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: var(--text-muted) !important;
}
html[data-theme="light"] .pa-btn:hover {
    background: rgba(109,40,217,0.10) !important;
    color: var(--violet) !important;
    border-color: rgba(109,40,217,0.25) !important;
}
html[data-theme="light"] .pa-btn.msg-btn:hover {
    background: rgba(2,132,199,0.10) !important;
    color: #0284C7 !important;
}
html[data-theme="light"] .pa-btn.unfriend-btn:hover {
    background: rgba(220,38,38,0.10) !important;
    color: #DC2626 !important;
}
html[data-theme="light"] .req-btn.decline,
html[data-theme="light"] .req-btn.cancel {
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: var(--text-muted) !important;
}
html[data-theme="light"] .req-btn.decline:hover {
    background: rgba(220,38,38,0.10) !important;
    border-color: rgba(220,38,38,0.30) !important;
    color: #DC2626 !important;
}
html[data-theme="light"] .req-btn.cancel:hover {
    background: rgba(0,0,0,0.08) !important;
}
html[data-theme="light"] .sent-avatar {
    background: rgba(0,0,0,0.06) !important;
    border-color: rgba(0,0,0,0.12) !important;
}

/* Unread message card keeps a tinted accent instead of just white */
html[data-theme="light"] .msg-card.unread {
    background: rgba(109,40,217,0.07) !important;
    border-color: rgba(109,40,217,0.25) !important;
}

/* Select option dropdowns (search page) */
html[data-theme="light"] .filter-group select option {
    background: #F5F4FF;
    color: #12102A;
}

/* edit-profile.php sidebar — a bare `nav { background:rgba(8,8,14,.85) }` rule
   in that page's CSS matches every <nav>, including <nav class="side-nav">.
   Override it here to match the other bright cards. */
html[data-theme="light"] .side-nav {
    background: rgba(255,255,255,0.88) !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
}
html[data-theme="light"] .side-nav a:hover {
    background: rgba(0,0,0,0.05) !important;
}


/* ══════════════════════════════════════════════════════════════════════
   COLOURFUL THEME
   ══════════════════════════════════════════════════════════════════════ */

html[data-theme="colorful"] {
    /* backgrounds — deep purple, lifted for brightness */
    --bg:           #1A0F35;
    --bg-2:         #241848;
    /* cards — purple-tinted so white doesn't fog the palette */
    --card:         rgba(120,50,220,0.18);
    --card-hover:   rgba(150,70,250,0.28);
    /* borders — tinted purple */
    --border:       rgba(168,85,247,0.30);
    --border-light: rgba(168,85,247,0.50);
    /* text */
    --text:         #FAF9FF;
    --text-muted:   #C4A8F0;
    --text-faint:   #8A6ACC;
    /* accents — vivid, saturated */
    --violet:       #A855F7;
    --pink:         #FF4DC4;
    --cyan:         #00E5FF;
    --green:        #00E68A;
    --amber:        #FFB800;
    --red:          #FF4455;
    --purple:       #C084FC;
    /* gradients — tri-colour */
    --grad:         linear-gradient(135deg, #A855F7 0%, #FF4DC4 50%, #00E5FF 100%);
    --grad-text:    linear-gradient(135deg, #D8B4FE 0%, #F9A8D4 50%, #A5F3FC 100%);
    /* shadow — purple glow */
    --shadow:       0 20px 60px rgba(168,85,247,0.28);
    /* alternate variable names */
    --surface:      #241848;
    --muted:        #C4A8F0;
    --faint:        #8A6ACC;
    --radius:       16px;
    --radius-lg:    24px;
}

/* ── Colourful: nav overrides ── */
html[data-theme="colorful"] .site-nav {
    background: rgba(26,15,53,0.94);
    border-bottom-color: rgba(168,85,247,0.30);
}
html[data-theme="colorful"] .sn-logo-name { color: #FAF9FF; }
html[data-theme="colorful"] .sn-btn { color: #C4A8F0; }
html[data-theme="colorful"] .sn-btn:hover,
html[data-theme="colorful"] .sn-group.open .sn-btn {
    background: rgba(168,85,247,0.14); color: #FAF9FF;
}
html[data-theme="colorful"] .sn-drop {
    background: rgba(13,8,32,0.97);
    border-color: rgba(168,85,247,0.22);
    box-shadow: 0 16px 48px rgba(168,85,247,0.22);
}
html[data-theme="colorful"] .sn-drop li a { color: #C4A8F0; }
html[data-theme="colorful"] .sn-drop li a:hover {
    background: rgba(168,85,247,0.18); color: #FAF9FF;
}
html[data-theme="colorful"] .sn-drop .sn-sep { background: rgba(168,85,247,0.16); }
html[data-theme="colorful"] .sn-hamburger span { background: #C4A8F0; }
@media (max-width: 680px) {
    html[data-theme="colorful"] .sn-groups {
        background: rgba(26,15,53,0.98);
        border-bottom-color: rgba(168,85,247,0.30);
    }
}

/* ── Colourful: theme-dot active ring ── */
html[data-theme="colorful"] .sn-theme-btn.sn-theme-active {
    border-color: rgba(168,85,247,0.75);
}

/* ── Colourful: page card overrides (same hardcoded rgba(13,13,26) values) ── */
html[data-theme="colorful"] .content-card,
html[data-theme="colorful"] .profile-header,
html[data-theme="colorful"] .section,
html[data-theme="colorful"] .album-card,
html[data-theme="colorful"] .filter-card,
html[data-theme="colorful"] .member-card,
html[data-theme="colorful"] .add-form-wrap,
html[data-theme="colorful"] .book-card,
html[data-theme="colorful"] .quote-card,
html[data-theme="colorful"] .modal-inner,
html[data-theme="colorful"] .msg-card,
html[data-theme="colorful"] .likes-box,
html[data-theme="colorful"] .bm-box,
html[data-theme="colorful"] .tri-card,
html[data-theme="colorful"] .inbox-section,
html[data-theme="colorful"] .card,
html[data-theme="colorful"] .sent-panel,
html[data-theme="colorful"] .side-nav {
    background: var(--card) !important;
    border-color: var(--border) !important;
}


/* ══════════════════════════════════════════════════════════════════════
   LOGIN PAGE — theme overrides for hardcoded values
   ══════════════════════════════════════════════════════════════════════ */

/* Light: world map should not be inverted on a bright background */
html[data-theme="light"] .world-map {
    filter: brightness(0.5);
    opacity: 0.05;
}

/* Light: input fields need a visible background */
html[data-theme="light"] .input-wrap input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.14) !important;
    color: var(--text) !important;
}
html[data-theme="light"] .input-wrap input:focus {
    background: rgba(109,40,217,0.06) !important;
    border-color: var(--violet) !important;
}
html[data-theme="light"] .input-wrap input.field-error {
    background: rgba(220,38,38,0.05) !important;
    border-color: var(--red) !important;
}

/* Light: theme-switcher button active ring */
html[data-theme="light"] .theme-btn.theme-active {
    border-color: rgba(109,40,217,0.75);
    box-shadow: 0 0 0 2px rgba(109,40,217,0.20);
}

/* Colorful: input fields — purple-tinted glass */
html[data-theme="colorful"] .input-wrap input {
    background: rgba(168,85,247,0.08) !important;
    border-color: rgba(168,85,247,0.28) !important;
}
html[data-theme="colorful"] .input-wrap input:focus {
    background: rgba(168,85,247,0.14) !important;
    border-color: var(--violet) !important;
}

/* Colorful: theme-switcher button active ring */
html[data-theme="colorful"] .theme-btn.theme-active {
    border-color: rgba(168,85,247,0.85);
    box-shadow: 0 0 0 2px rgba(168,85,247,0.28);
}


/* ══════════════════════════════════════════════════════════════════════
   SIGNUP-EMAIL PAGE — theme overrides for hardcoded values
   (.input-group input, .privacy-note, .email-highlight)
   ══════════════════════════════════════════════════════════════════════ */

/* Light: email input field */
html[data-theme="light"] .input-group input {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.14) !important;
    color: var(--text) !important;
}
html[data-theme="light"] .input-group input:focus {
    background: rgba(109,40,217,0.06) !important;
    border-color: var(--violet) !important;
}
html[data-theme="light"] .input-group input.error {
    background: rgba(220,38,38,0.05) !important;
    border-color: var(--red) !important;
}

/* Light: privacy note box */
html[data-theme="light"] .privacy-note {
    background: rgba(0,0,0,0.04) !important;
}

/* Light: highlighted email in success panel */
html[data-theme="light"] .email-highlight {
    background: rgba(0,0,0,0.07) !important;
    color: var(--text) !important;
}

/* Colorful: email input field — purple-tinted glass */
html[data-theme="colorful"] .input-group input {
    background: rgba(168,85,247,0.08) !important;
    border-color: rgba(168,85,247,0.28) !important;
}
html[data-theme="colorful"] .input-group input:focus {
    background: rgba(168,85,247,0.14) !important;
    border-color: var(--violet) !important;
}
