/* =================================================================
   Xandeum Community - Design System
   5 Themes: spectrum-holo (default), cyber-neon, neon-spectrum,
             terminal-gold, holographic
   ================================================================= */

/* ── Theme: Spectrum Holo (Default) ──────────────────────────── */
:root,
[data-theme="spectrum-holo"] {
    --bg-primary: rgba(10,10,15,0.85);
    --bg-secondary: rgba(15,15,26,0.88);
    --bg-tertiary: rgba(22,22,42,0.9);
    --bg-card: rgba(12,12,24,0.88);
    --bg-input: rgba(15,15,26,0.95);
    --bg-hover: rgba(26,26,48,0.9);

    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a82;
    --text-light: #4a4a62;
    --text-inverse: #0a0a0f;

    --brand-primary: #00ff88;
    --brand-dark: #00cc6a;
    --brand-light: rgba(0,255,136,0.12);
    --accent: #00ccff;
    --accent-dark: #00aadd;
    --accent-light: rgba(0,204,255,0.12);

    --neon-1: #00ff88;
    --neon-2: #00ccff;
    --neon-3: #ff6600;
    --neon-4: #ff0066;
    --neon-5: #aa00ff;

    --success: #00ff88;
    --success-light: rgba(0,255,136,0.12);
    --warning: #ff6600;
    --warning-light: rgba(255,102,0,0.12);
    --danger: #ff0066;
    --danger-light: rgba(255,0,102,0.12);
    --info: #00ccff;
    --info-light: rgba(0,204,255,0.12);

    --border: #1e1e35;
    --border-light: #14142a;
    --border-focus: #00ff88;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow: 0 2px 6px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.6);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;

    --header-height: 64px;
    --max-width: 1200px;
    --content-width: 800px;

    --holo-gradient: linear-gradient(90deg, #00ff88, #00ccff, #ff6600, #ff0066, #aa00ff, #00ff88);
}

/* ── Theme: Cyber Neon ───────────────────────────────────────── */
[data-theme="cyber-neon"] {
    --bg-primary: rgba(10,10,26,0.85);
    --bg-secondary: rgba(14,14,36,0.88);
    --bg-tertiary: rgba(21,21,58,0.9);
    --bg-card: rgba(12,12,32,0.88);
    --bg-input: rgba(14,14,36,0.95);
    --bg-hover: rgba(26,26,64,0.9);

    --brand-primary: #00ffff;
    --brand-dark: #00cccc;
    --brand-light: rgba(0,255,255,0.12);
    --accent: #ff00ff;
    --accent-dark: #cc00cc;
    --accent-light: rgba(255,0,255,0.12);

    --neon-1: #00ffff;
    --neon-2: #ff00ff;
    --neon-3: #8b5cf6;
    --neon-4: #ff00ff;
    --neon-5: #8b5cf6;

    --success: #00ffaa;
    --success-light: rgba(0,255,170,0.12);
    --warning: #ffaa00;
    --warning-light: rgba(255,170,0,0.12);
    --danger: #ff3366;
    --danger-light: rgba(255,51,102,0.12);
    --info: #00ffff;
    --info-light: rgba(0,255,255,0.12);

    --border: #1a1a40;
    --border-light: #12122a;
    --border-focus: #00ffff;

    --holo-gradient: linear-gradient(90deg, #00ffff, #ff00ff, #8b5cf6, #00ffff);
}

/* ── Theme: Neon Spectrum ────────────────────────────────────── */
[data-theme="neon-spectrum"] {
    --bg-primary: rgba(10,10,10,0.85);
    --bg-secondary: rgba(17,17,17,0.88);
    --bg-tertiary: rgba(26,26,26,0.9);
    --bg-card: rgba(14,14,14,0.88);
    --bg-input: rgba(17,17,17,0.95);
    --bg-hover: rgba(30,30,30,0.9);

    --brand-primary: #00ff88;
    --brand-dark: #00cc6a;
    --brand-light: rgba(0,255,136,0.12);
    --accent: #00ccff;
    --accent-dark: #00aadd;
    --accent-light: rgba(0,204,255,0.12);

    --neon-1: #00ff88;
    --neon-2: #00ccff;
    --neon-3: #ff6600;
    --neon-4: #ff0066;
    --neon-5: #aa00ff;

    --success: #00ff88;
    --success-light: rgba(0,255,136,0.12);
    --warning: #ff6600;
    --warning-light: rgba(255,102,0,0.12);
    --danger: #ff0066;
    --danger-light: rgba(255,0,102,0.12);
    --info: #00ccff;
    --info-light: rgba(0,204,255,0.12);

    --border: #222222;
    --border-light: #181818;
    --border-focus: #00ff88;

    --holo-gradient: linear-gradient(90deg, #00ff88, #00ccff, #ff6600, #ff0066, #aa00ff, #00ff88);
}

/* ── Theme: Terminal Gold ────────────────────────────────────── */
[data-theme="terminal-gold"] {
    --bg-primary: rgba(13,17,23,0.85);
    --bg-secondary: rgba(17,24,32,0.88);
    --bg-tertiary: rgba(22,29,39,0.9);
    --bg-card: rgba(15,22,30,0.88);
    --bg-input: rgba(17,24,32,0.95);
    --bg-hover: rgba(26,34,45,0.9);

    --brand-primary: #f0b429;
    --brand-dark: #d09820;
    --brand-light: rgba(240,180,41,0.12);
    --accent: #2dd4bf;
    --accent-dark: #25b0a0;
    --accent-light: rgba(45,212,191,0.12);

    --neon-1: #f0b429;
    --neon-2: #2dd4bf;
    --neon-3: #f0b429;
    --neon-4: #2dd4bf;
    --neon-5: #f0b429;

    --success: #2dd4bf;
    --success-light: rgba(45,212,191,0.12);
    --warning: #f0b429;
    --warning-light: rgba(240,180,41,0.12);
    --danger: #ff6b6b;
    --danger-light: rgba(255,107,107,0.12);
    --info: #2dd4bf;
    --info-light: rgba(45,212,191,0.12);

    --border: #1e2731;
    --border-light: #151c25;
    --border-focus: #f0b429;

    --holo-gradient: linear-gradient(90deg, #f0b429, #2dd4bf, #f0b429);
}

/* ── Theme: Holographic ──────────────────────────────────────── */
[data-theme="holographic"] {
    --bg-primary: rgba(10,10,20,0.85);
    --bg-secondary: rgba(14,14,30,0.88);
    --bg-tertiary: rgba(20,20,40,0.9);
    --bg-card: rgba(12,12,26,0.88);
    --bg-input: rgba(14,14,30,0.95);
    --bg-hover: rgba(24,24,46,0.9);

    --brand-primary: #c8b8ff;
    --brand-dark: #a090e0;
    --brand-light: rgba(200,184,255,0.12);
    --accent: #88ddff;
    --accent-dark: #66bbdd;
    --accent-light: rgba(136,221,255,0.12);

    --neon-1: #c8b8ff;
    --neon-2: #88ddff;
    --neon-3: #ffb088;
    --neon-4: #ff88bb;
    --neon-5: #88ffbb;

    --success: #88ffbb;
    --success-light: rgba(136,255,187,0.12);
    --warning: #ffcc88;
    --warning-light: rgba(255,204,136,0.12);
    --danger: #ff88aa;
    --danger-light: rgba(255,136,170,0.12);
    --info: #88ddff;
    --info-light: rgba(136,221,255,0.12);

    --border: #1e1e38;
    --border-light: #141430;
    --border-focus: #c8b8ff;

    --holo-gradient: linear-gradient(90deg, #c8b8ff, #88ddff, #ffb088, #ff88bb, #88ffbb, #c8b8ff);
}

/* ── Keyframes ────────────────────────────────────────────────── */
@keyframes holoShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes neonPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── Matrix Rain Canvas ───────────────────────────────────────── */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }

/* ── Layout ───────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.content-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
}

main {
    flex: 1;
    padding: 32px 0;
    position: relative;
    z-index: 1;
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.site-logo img {
    height: 32px;
    width: auto;
}

.site-logo-text {
    background: linear-gradient(135deg, var(--brand-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated logo for holo themes */
[data-theme="spectrum-holo"] .site-logo-text,
[data-theme="holographic"] .site-logo-text {
    background: var(--holo-gradient);
    background-size: 300% 300%;
    animation: holoShift 4s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Navigation ───────────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.main-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.main-nav a.active {
    background: var(--brand-light);
    color: var(--brand-primary);
    font-weight: 600;
}

/* Admin dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    z-index: 200;
    margin-top: 4px;
}

.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.nav-dropdown-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Mobile nav */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ── Theme Selector ───────────────────────────────────────────── */
.theme-selector {
    position: relative;
}

.theme-selector-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.theme-selector-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
}

.theme-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--holo-gradient);
    background-size: 300% 300%;
    animation: holoShift 3s linear infinite;
}

[data-theme="cyber-neon"] .theme-indicator {
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    animation: none;
}
[data-theme="neon-spectrum"] .theme-indicator {
    background: linear-gradient(135deg, #00ff88, #00ccff, #ff0066);
    animation: none;
}
[data-theme="terminal-gold"] .theme-indicator {
    background: linear-gradient(135deg, #f0b429, #2dd4bf);
    animation: none;
}

.theme-selector-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px;
    margin-top: 8px;
    z-index: 200;
}

.theme-selector-menu.open { display: block; }

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: background 0.2s;
}

.theme-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-option.active {
    color: var(--brand-primary);
    background: var(--brand-light);
}

.theme-swatch {
    display: flex;
    gap: 2px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.theme-swatch span {
    width: 6px;
    height: 20px;
}

.theme-option-label {
    flex: 1;
    text-align: left;
}

.theme-option-check {
    opacity: 0;
    font-size: 0.75rem;
}

.theme-option.active .theme-option-check {
    opacity: 1;
}

/* ── User Badge ───────────────────────────────────────────────── */
.user-badge { position: relative; }

.user-badge-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-badge-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
}

.user-badge-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-badge-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px;
    margin-top: 8px;
    z-index: 200;
}

.user-badge-menu.open { display: block; }

.user-badge-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-badge-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-badge-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 50%);
    color: var(--text-primary);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 30% 50%, var(--brand-light) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, var(--accent-light) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.75;
    max-width: 600px;
    margin: 0 auto 32px;
    position: relative;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
}
.btn-primary:hover { background: var(--brand-dark); color: var(--text-inverse); }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border); }

.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}
.btn-accent:hover { background: var(--accent-dark); color: var(--text-inverse); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: var(--danger); filter: brightness(0.85); color: white; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
}
.btn-outline:hover { background: var(--brand-primary); color: var(--text-inverse); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-white { background: white; color: #0f172a; }
.btn-white:hover { background: #e2e8f0; color: #0f172a; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ── Stat Cards ───────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-general { background: rgba(245,158,11,0.2); color: #f59e0b; }
.badge-development { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-governance { background: rgba(139,92,246,0.2); color: #a78bfa; }
.badge-tutorials { background: rgba(34,197,94,0.2); color: #4ade80; }
.badge-ideas { background: rgba(236,72,153,0.2); color: #f472b6; }
.badge-off-topic { background: rgba(100,116,139,0.2); color: #94a3b8; }

.badge-blog { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-update { background: rgba(245,158,11,0.2); color: #f59e0b; }
.badge-discussion { background: rgba(139,92,246,0.2); color: #a78bfa; }

.badge-published { background: var(--success-light); color: var(--success); }
.badge-draft { background: var(--warning-light); color: var(--warning); }
.badge-archived { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-hidden { background: var(--danger-light); color: var(--danger); }

.badge-active { background: var(--success-light); color: var(--success); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-suspended { background: var(--danger-light); color: var(--danger); }
.badge-admin { background: rgba(139,92,246,0.2); color: #a78bfa; }
.badge-viewer { background: rgba(100,116,139,0.2); color: #94a3b8; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236a6a82' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(0,255,136,0.25); }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(255,0,102,0.25); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(255,102,0,0.25); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(0,204,255,0.25); }

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    color: inherit;
}
.alert-dismiss:hover { opacity: 1; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }

.table-actions {
    display: flex;
    gap: 6px;
}

/* ── Post Cards ───────────────────────────────────────────────── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
    position: relative;
}

.post-card:hover { box-shadow: var(--shadow-md); }

.post-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.post-card-meta { flex: 1; }

.post-card-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-card-badges {
    display: flex;
    gap: 6px;
}

.post-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--brand-primary); }

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.post-card-footer {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-card-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card + .post-card { margin-top: 16px; }

/* ── News Cards ───────────────────────────────────────────────── */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
    position: relative;
}

.news-card:hover { box-shadow: var(--shadow-md); }

.news-card-image {
    height: 180px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-body { padding: 20px; }

.news-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-card-title a { color: var(--text-primary); }
.news-card-title a:hover { color: var(--brand-primary); }

.news-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.news-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

/* ── Profile Card ─────────────────────────────────────────────── */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
    position: relative;
}

.profile-card:hover { box-shadow: var(--shadow-md); }

.profile-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0 auto 12px;
}

.profile-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-card-name a { color: var(--text-primary); }
.profile-card-name a:hover { color: var(--brand-primary); }

.profile-card-bio {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.profile-card-location {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ── Profile View ─────────────────────────────────────────────── */
.profile-banner {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-tertiary), var(--brand-primary));
    border-radius: var(--radius) var(--radius) 0 0;
}

.profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
}

.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0 24px 24px;
    margin-bottom: 24px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--bg-card);
    background: var(--brand-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.5rem;
    margin-top: -60px;
    position: relative;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info { margin-top: 16px; }

.profile-display-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-slug {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.profile-bio {
    margin-top: 8px;
    color: var(--text-secondary);
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-social {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.profile-social a {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.profile-social a:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ── Comments ─────────────────────────────────────────────────── */
.comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment:last-child { border-bottom: none; }

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.comment-content { flex: 1; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-actions {
    margin-top: 6px;
    display: flex;
    gap: 12px;
}

.comment-actions button,
.comment-actions a {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.comment-actions button:hover,
.comment-actions a:hover { color: var(--brand-primary); }

.comment-replies { margin-left: 48px; }

/* ── Like Button ──────────────────────────────────────────────── */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.like-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.like-btn.liked {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.pagination .active {
    background: var(--brand-primary);
    color: var(--text-inverse);
    border-color: var(--brand-primary);
    font-weight: 600;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ── Section Headings ─────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ── Filter Bar ───────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--brand-primary);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 4px 0;
}
.footer-col a:hover { color: var(--brand-primary); }

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
}

/* ── Auth Pages ───────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: transparent;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Article / Post Body ──────────────────────────────────────── */
.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h2 { font-size: 1.5rem; font-weight: 700; margin: 32px 0 12px; }
.article-body h3 { font-size: 1.2rem; font-weight: 600; margin: 24px 0 8px; }
.article-body p { margin: 12px 0; }
.article-body ul, .article-body ol { margin: 12px 0 12px 24px; }
.article-body blockquote {
    border-left: 4px solid var(--brand-primary);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body pre {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 16px 0;
    border: 1px solid var(--border);
}
.article-body code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.article-body pre code { background: none; padding: 0; }
.article-body a { color: var(--brand-primary); }
.article-body a:hover { text-decoration: underline; }

/* ── Info Sections ────────────────────────────────────────────── */
.info-section {
    padding: 60px 0;
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
}

.info-section:nth-child(even) {
    background: var(--bg-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.info-card {
    text-align: center;
    padding: 32px 24px;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Pinned indicator ─────────────────────────────────────────── */
.pinned-indicator {
    color: var(--brand-primary);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

/* ── Tags / Interests ─────────────────────────────────────────── */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p { margin-bottom: 20px; }

/* =================================================================
   Theme-Specific Enhancements
   ================================================================= */

/* ── Holographic Borders (spectrum-holo + holographic) ────────── */
[data-theme="spectrum-holo"] .card,
[data-theme="spectrum-holo"] .post-card,
[data-theme="spectrum-holo"] .news-card,
[data-theme="spectrum-holo"] .stat-card,
[data-theme="spectrum-holo"] .auth-card,
[data-theme="spectrum-holo"] .profile-card,
[data-theme="holographic"] .card,
[data-theme="holographic"] .post-card,
[data-theme="holographic"] .news-card,
[data-theme="holographic"] .stat-card,
[data-theme="holographic"] .auth-card,
[data-theme="holographic"] .profile-card {
    border-color: transparent;
    overflow: visible;
}

[data-theme="spectrum-holo"] .card::before,
[data-theme="spectrum-holo"] .post-card::before,
[data-theme="spectrum-holo"] .news-card::before,
[data-theme="spectrum-holo"] .stat-card::before,
[data-theme="spectrum-holo"] .auth-card::before,
[data-theme="spectrum-holo"] .profile-card::before,
[data-theme="holographic"] .card::before,
[data-theme="holographic"] .post-card::before,
[data-theme="holographic"] .news-card::before,
[data-theme="holographic"] .stat-card::before,
[data-theme="holographic"] .auth-card::before,
[data-theme="holographic"] .profile-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--holo-gradient);
    background-size: 300% 300%;
    animation: holoShift 4s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

/* Stronger glow on hover for holo themes */
[data-theme="spectrum-holo"] .card:hover,
[data-theme="spectrum-holo"] .post-card:hover,
[data-theme="spectrum-holo"] .news-card:hover,
[data-theme="spectrum-holo"] .profile-card:hover,
[data-theme="holographic"] .card:hover,
[data-theme="holographic"] .post-card:hover,
[data-theme="holographic"] .news-card:hover,
[data-theme="holographic"] .profile-card:hover {
    box-shadow: 0 0 20px rgba(0,255,136,0.08), 0 0 40px rgba(0,204,255,0.05);
}

/* Holographic header border */
[data-theme="spectrum-holo"] .site-header,
[data-theme="holographic"] .site-header {
    border-bottom-color: transparent;
    background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                       var(--holo-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 300% 300%;
    animation: holoShift 4s linear infinite;
    border-bottom: 1px solid transparent;
}

/* ── Cyber Neon Glow Effects ──────────────────────────────────── */
[data-theme="cyber-neon"] .card,
[data-theme="cyber-neon"] .post-card,
[data-theme="cyber-neon"] .news-card,
[data-theme="cyber-neon"] .stat-card,
[data-theme="cyber-neon"] .auth-card,
[data-theme="cyber-neon"] .profile-card {
    box-shadow: 0 0 12px rgba(0,255,255,0.06), 0 0 24px rgba(255,0,255,0.03), var(--shadow);
}

[data-theme="cyber-neon"] .card:hover,
[data-theme="cyber-neon"] .post-card:hover,
[data-theme="cyber-neon"] .news-card:hover,
[data-theme="cyber-neon"] .stat-card:hover,
[data-theme="cyber-neon"] .profile-card:hover {
    box-shadow: 0 0 20px rgba(0,255,255,0.12), 0 0 40px rgba(255,0,255,0.06);
    border-color: rgba(0,255,255,0.3);
}

[data-theme="cyber-neon"] .site-header {
    box-shadow: 0 2px 20px rgba(0,255,255,0.08);
}

[data-theme="cyber-neon"] .btn-primary:hover {
    box-shadow: 0 0 15px rgba(0,255,255,0.4);
}

/* ── Terminal Gold Minimal Effects ─────────────────────────────── */
[data-theme="terminal-gold"] .site-header {
    border-bottom-color: rgba(240,180,41,0.2);
}

[data-theme="terminal-gold"] .card,
[data-theme="terminal-gold"] .post-card {
    border-color: rgba(240,180,41,0.12);
}

[data-theme="terminal-gold"] .card:hover,
[data-theme="terminal-gold"] .post-card:hover {
    border-color: rgba(240,180,41,0.25);
}

/* ── Neon Spectrum Multi-color Accents ─────────────────────────── */
[data-theme="neon-spectrum"] .stat-card:nth-child(1) .stat-value { color: #00ff88; }
[data-theme="neon-spectrum"] .stat-card:nth-child(2) .stat-value { color: #00ccff; }
[data-theme="neon-spectrum"] .stat-card:nth-child(3) .stat-value { color: #ff6600; }
[data-theme="neon-spectrum"] .stat-card:nth-child(4) .stat-value { color: #ff0066; }
[data-theme="neon-spectrum"] .stat-card:nth-child(5) .stat-value { color: #aa00ff; }

/* Also for spectrum-holo */
[data-theme="spectrum-holo"] .stat-card:nth-child(1) .stat-value { color: #00ff88; }
[data-theme="spectrum-holo"] .stat-card:nth-child(2) .stat-value { color: #00ccff; }
[data-theme="spectrum-holo"] .stat-card:nth-child(3) .stat-value { color: #ff6600; }
[data-theme="spectrum-holo"] .stat-card:nth-child(4) .stat-value { color: #ff0066; }
[data-theme="spectrum-holo"] .stat-card:nth-child(5) .stat-value { color: #aa00ff; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        box-shadow: var(--shadow-lg);
    }
    .mobile-toggle { display: block; }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .info-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    .section-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; }

    .profile-banner { height: 140px; }
    .profile-avatar-large { width: 80px; height: 80px; font-size: 1.8rem; margin-top: -40px; }

    .theme-selector-menu { right: -40px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero { padding: 48px 0; }
    .hero-actions { flex-direction: column; align-items: center; }

    .footer-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }

    .auth-card { padding: 24px; }

    .post-card-header { flex-direction: column; align-items: flex-start; }
}
