:root {
    /* The Palette - Deepened and Enriched */
    --navy: #0b1120;       /* Darker, almost void-like navy */
    --navy-light: #1e293b; /* Lighter navy for cards */
    --accent-purple: #8b5cf6;
    --gold: #fbbf24;
    --text-main: #f8fafc;  /* Off-white for dark mode feel */
    --text-muted: #94a3b8;
    
    /* The "Pulse" Gradient */
    --pride-grad: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #a855f7);
    
    /* Modern Shadows */
    --glow: 0 0 20px rgba(124, 58, 237, 0.15);
    --shadow-card: 0 10px 40px -10px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-purple); }

/* Selection Color (The tiny details matter) */
::selection { background: var(--accent-purple); color: white; }

body {
    background-color: var(--navy); /* Dark Theme Base */
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.7;
    overflow-x: hidden;
    /* FIX: This pushes the footer to the bottom */
    display: flex; flex-direction: column; min-height: 100vh;
}

/* FIX: Footer Positioning */
footer { margin-top: auto; }

/* Background Atmosphere */
.page-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Subtle mesh gradient */
    background: 
        radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
    z-index: -2;
    pointer-events: none;
}

/* --- Navigation: Floating Glass --- */
.glass-nav {
    position: sticky; top: 20px; z-index: 1000;
    width: 95%; max-width: 1200px; margin: 0 auto;
    background: rgba(15, 23, 42, 0.7); /* Dark semi-transparent */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.nav-content {
    padding: 0 30px;
    display: flex; justify-content: space-between; align-items: center;
}

.brand {
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.3rem;
    color: white; display: flex; align-items: center; gap: 12px;
    letter-spacing: 0.5px;
}
.brand i { 
    color: var(--gold); 
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); /* Glowing Icon */
}

/* FIX: Added missing layout for Nav Buttons */
.nav-links {
    display: flex; gap: 15px; align-items: center;
}

.nav-btn { 
    text-decoration: none; color: var(--text-muted); 
    font-weight: 500; font-size: 0.95rem; 
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}
.nav-btn:hover { 
    color: white; background: rgba(255,255,255,0.05); 
}

/* --- Hero Section --- */
.hero-section { text-align: center; padding: 100px 20px 80px; }

.badge {
    background: rgba(255,255,255,0.05); 
    color: var(--gold); 
    padding: 8px 16px;
    border-radius: 50px; 
    font-size: 0.8rem; letter-spacing: 2px; font-weight: 700;
    border: 1px solid rgba(251, 191, 36, 0.2);
    display: inline-block;
    margin-bottom: 20px;
}

.hero-section h1 {
    font-family: 'Cinzel', serif; font-size: clamp(2.5rem, 5vw, 4.5rem); 
    color: white; margin: 0 0 15px;
    line-height: 1.1;
}

.gradient-text {
    background: var(--pride-grad); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 5s linear infinite; /* Living text */
}
@keyframes shine { to { background-position: 200% center; } }

.hero-sub { 
    font-size: 1.25rem; color: var(--text-muted); 
    max-width: 600px; margin: 0 auto; font-weight: 300;
}

/* --- The God Level Grid --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 100px; }
.bento-grid {
    display: grid;
    /* Kept exactly as you requested: 340px */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 30px;
}

.immersive-card {
    position: relative;
    height: 350px; /* Taller */
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255,255,255,0.1); /* Subtle glass border */
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}

.immersive-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.6);
}

/* Background Image Logic */
.card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: transform 0.8s ease; /* Smooth slow zoom */
    z-index: 0;
    filter: grayscale(30%); /* Cinematic moody look */
}
.immersive-card:hover .card-bg { 
    transform: scale(1.15); 
    filter: grayscale(0%); /* Color returns on hover */
}

/* Intelligent Gradient Overlay */
.card-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom, 
        rgba(11, 17, 32, 0.3) 0%, 
        rgba(11, 17, 32, 0.6) 50%, 
        rgba(11, 17, 32, 0.95) 100%
    );
    z-index: 1;
}

/* Big Center Icon */
.big-icon {
    position: relative; z-index: 2;
    font-size: 4.5rem; 
    color: rgba(255, 255, 255, 0.2); 
    margin-bottom: 30px;
    transition: all 0.4s ease;
    transform: translateY(10px);
}
.immersive-card:hover .big-icon {
    color: white;
    transform: translateY(0) scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.4));
}

/* Card Content */
.card-content {
    position: absolute; bottom: 30px; width: 100%; 
    z-index: 2; text-align: center; padding: 0 20px;
}

.card-content h2 {
    font-family: 'Cinzel', serif; color: white;
    font-size: 1.6rem; margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.explore-btn {
    font-size: 0.85rem; color: var(--gold);
    font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    display: inline-flex; align-items: center; gap: 8px;
    opacity: 0.7; transition: opacity 0.3s;
}
.immersive-card:hover .explore-btn { opacity: 1; }

/* --- Forms (Contributor Page) --- */
.form-card {
    background: rgba(30, 41, 59, 0.8); /* Dark glass */
    padding: 60px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}
.form-header h1 { color: white; }
.god-form label { color: var(--text-muted); }

.god-form input, .god-form select, .god-form textarea {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}
.god-form input:focus, .god-form select:focus, .god-form textarea:focus {
    background: rgba(0,0,0,0.4);
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.submit-btn {
    background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
}
.submit-btn:hover {
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.6);
    transform: translateY(-3px);
}

/* --- Subpages --- */
.subpage { background: #f8fafc; color: var(--navy); } /* Keep subpages light for readability */
.subpage .glass-nav { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.05); }
.subpage .brand, .subpage .nav-btn { color: var(--navy); }

.topic-hero { 
    background: var(--navy); color: white; 
    padding: 80px 20px; text-align: center;
    position: relative; overflow: hidden;
}
/* Add a pattern to hero background */
.topic-hero::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 30px 30px; opacity: 0.05;
}

/* FIX: Added missing AI Insight Box Style for Topic Pages */
.ai-insight { 
    background: #fff; padding: 30px; border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-left: 4px solid var(--gold); margin-bottom: 30px;
}
.insight-label {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
    font-weight: 700; color: var(--accent-purple); margin-bottom: 10px;
}

.resource-row { 
    background: white; border: 1px solid #e2e8f0; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.resource-row:hover {
    border-color: var(--accent-purple);
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.res-icon { margin-right: 20px; color: var(--gold); font-size: 1.4rem; }
.resource-row h3 { margin: 0; color: var(--navy); }

/* --- Sidebar & Layout Logic --- */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 350px; /* Content Left, Sidebar Right */
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* Sidebar Widget Styling */
.sidebar-widget {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden; /* Contains images */
}
.sidebar-widget h3 {
    font-family: 'Cinzel', serif;
    color: var(--navy);
    margin-top: 0;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.sidebar-widget img { max-width: 100%; height: auto; border-radius: 8px; }

/* Admin Sidebar Manager Styles */
.code-block {
    background: #1e293b; color: #a5b4fc;
    font-family: monospace; padding: 10px;
    border-radius: 5px; font-size: 0.8rem;
    overflow-x: auto;
}

/* Responsive Fix */
@media (max-width: 900px) {
    .page-layout { grid-template-columns: 1fr; }
}
/* --- Contribute Page Split Layout --- */
.contribute-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-top: 40px;
}

/* Left Side: Info */
.contribute-info h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    line-height: 1.1;
    color: white;
    margin-top: 15px;
}
.contribute-info .intro {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 90%;
}

.guidelines-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
}
.guidelines-box h3 {
    color: var(--gold);
    margin-top: 0;
    font-family: 'Cinzel', serif;
    display: flex; align-items: center; gap: 10px;
}

.guidelines-list { list-style: none; padding: 0; margin: 0; }
.guidelines-list li {
    display: flex; gap: 15px; margin-bottom: 20px;
}
.guidelines-list li:last-child { margin-bottom: 0; }
.guidelines-list li i {
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent-purple);
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.guidelines-list strong { display: block; color: white; }
.guidelines-list span { color: var(--text-muted); font-size: 0.9rem; }

/* Right Side: God Mode Form */
.form-card.god-mode {
    background: rgba(15, 23, 42, 0.6); /* Slightly darker glass */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

/* Input With Icons Logic */
.input-with-icon {
    position: relative;
}
.input-with-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s;
    z-index: 2;
}
.input-with-icon.textarea-icon i { top: 25px; } /* Adjust for textarea */

/* Override Input Padding to make room for icon */
.god-form .input-with-icon input,
.god-form .input-with-icon select,
.god-form .input-with-icon textarea {
    padding-left: 50px; /* Space for icon */
}

/* Focus State Effect */
.god-form .input-with-icon input:focus ~ i,
.god-form .input-with-icon select:focus ~ i,
.god-form .input-with-icon textarea:focus ~ i {
    color: var(--accent-purple);
}

/* Success/Error Messages */
.status-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
    font-weight: 600;
}
.status-message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #4ade80;
}
.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #f87171;
}

/* Responsive */
@media (max-width: 900px) {
    .contribute-split { grid-template-columns: 1fr; }
}
/* --- Header Search Bar --- */
.nav-search {
    position: relative;
    width: 300px;
    margin: 0 20px;
}
.nav-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 8px 15px 8px 40px; /* Space for icon */
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s;
}
/* If inside subpage (light header), change colors */
.subpage .nav-search input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--navy);
}

.nav-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}
.subpage .nav-search input:focus { background: white; }

.nav-search button {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

/* --- Contribution Toast Popup --- */
.contribute-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 320px;
    background: rgba(11, 17, 32, 0.95); /* Deep Navy */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 191, 36, 0.3); /* Gold Border */
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 9999;
    transform: translateY(150%); /* Hidden by default */
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contribute-toast.show {
    transform: translateY(0); /* Slide in */
}

.toast-header {
    display: flex; justify-content: space-between; align-items: center;
}
.toast-title {
    color: var(--gold); font-family: 'Cinzel', serif; font-size: 1rem; font-weight: bold;
}
.toast-close {
    cursor: pointer; color: #64748b; font-size: 1.2rem; transition: 0.3s;
}
.toast-close:hover { color: white; }

.toast-body {
    font-size: 0.9rem; color: #cbd5e1; line-height: 1.4;
}
.toast-btn {
    background: var(--accent-purple); color: white; text-align: center;
    padding: 8px; border-radius: 8px; text-decoration: none; 
    font-weight: bold; font-size: 0.85rem; margin-top: 5px;
    transition: background 0.3s;
}
.toast-btn:hover { background: #6d28d9; }

/* Disclaimer Text in Footer */
.disclaimer-text {
    font-size: 0.8rem; color: #64748b; margin-top: 20px; opacity: 0.7;
}

@media (max-width: 600px) {
    .contribute-toast { bottom: 10px; right: 10px; width: calc(100% - 20px); }
}

/* Responsive Hide on very small screens */
@media (max-width: 768px) {
    .nav-search { display: none; } /* Or make it a toggle button in V2 */
    .nav-links { display: flex; gap: 10px; }
}

/* FIX: Added Footer Styles (was missing in your paste) */
footer {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05);
    background: var(--navy);
}
.subpage footer { background: #f1f5f9; border-top: 1px solid #e2e8f0; color: #64748b; }
.footer-motto {
    font-family: 'Cinzel', serif; letter-spacing: 2px;
    text-transform: uppercase; font-size: 0.9rem; margin-top: 10px;
}
/* =========================================
   11. DONATION SLIDER (HAT PINS)
   ========================================= */
.donation-slider {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 320px;
    background: rgba(4, 10, 27, 0.95); /* Deep Navy */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--neon-gold);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 9999;
    
    /* Animation: Slide Up */
    transform: translateY(150%); /* Start hidden below screen */
    animation: slideUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 3s; /* Wait 3 seconds before showing */
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.donation-content {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pin-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.donation-text h4 {
    color: var(--neon-gold);
    font-size: 0.9rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.donation-text p {
    color: #ccc;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.pin-btn {
    background: var(--neon-gold);
    color: #040a1b;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
}

/* Close Button (X) */
.close-slider {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}
.close-slider:hover { color: #fff; }

/* Hide on Mobile if it covers too much */
@media (max-width: 600px) {
    .donation-slider {
        left: 5%;
        width: 90%;
        bottom: 20px;
    }
}
