/* --- VARIABLES & THEME (CYBER PURPLE) --- */
:root {
    /* PRIMARY COLOR CHANGE: #0099ff (Blue) -> #8A2BE2 (Blue Violet/Purple) */
    --primary: #8A2BE2; 
    --primary-glow: rgba(138, 43, 226, 0.5); /* Purple Glow */
    --bg-dark: #050505;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --glass-border: rgba(255, 255, 255, 0.08);
    --blur: blur(12px);
}

/* --- CORE RESET & LAYOUT --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    /* UPDATED: Subtle purple border/shadow for immersive feel */
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.1) inset;
}

#canvas-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    /* Enhanced radial gradient for a deeper, glowing background */
    background: radial-gradient(circle at center, #100517 0%, #000000 100%); /* Subtle shift to dark purple/blue background */
}

/* --- NAVBAR --- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 1.5rem 0; transition: all 0.4s ease;
}
.navbar.scrolled {
    background: rgba(5, 5, 5, 0.85); backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border); padding: 1rem 0;
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo-img {
    height: 96px; width: auto; filter: invert(1) brightness(200%); transition: all 0.3s ease;
}
.logo-img:hover { transform: scale(1.05); filter: invert(1) drop-shadow(0 0 8px var(--primary)); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
    color: var(--text-muted); text-decoration: none; font-weight: 500;
    transition: color 0.3s ease; font-size: 0.95rem;
}
.nav-links a:hover { color: white; text-shadow: 0 0 10px rgba(255,255,255,0.5); }
.nav-links a.active { color: white; border-bottom: 1px solid var(--primary); }
.nav-btn {
    background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-border);
    padding: 0.6rem 1.5rem; border-radius: 8px; color: white !important; transition: all 0.3s ease;
}
.nav-btn:hover { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 20px var(--primary-glow); }

/* --- PAGE TRANSITION WRAPPER --- */
#page-wrapper { position: relative; overflow: hidden; min-height: 100vh; }
#page-content { width: 100%; transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1); }

/* --- GENERAL SECTIONS --- */
.container { max-width: 1200px; margin: 0 auto; padding-top: 8rem; padding-bottom: 4rem; padding-left: 2rem; padding-right: 2rem; }
section { padding: 6rem 2rem; position: relative; z-index: 1; }
.section-header { margin-bottom: 4rem; text-align: center; }
.section-header h2 { font-family: 'Outfit', sans-serif; font-size: 3rem; font-weight: 800; margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

/* * UPDATED: Enhanced Glass Card for a more "Liquid" feel 
 */
.glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--glass-border); 
    padding: 2.5rem; 
    border-radius: 24px;
    backdrop-filter: blur(30px); /* Deeper Blur */
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1); /* Smoother, fluid transition */
}
.glass-card:hover { 
    border-color: var(--primary); 
    transform: translateY(-5px) scale(1.005); 
    /* UPDATED: Primary color glow on hover (Purple) */
    box-shadow: 0 10px 60px -10px rgba(138, 43, 226, 0.6); 
    border-radius: 28px; /* Subtle shape shift on hover for fluidity */
}

/* * NEW CLASS: For elements that need a continuous, liquid-like pulsing glow 
 * Apply this class (.liquid-glass-glow) to any card you want to emphasize.
 */
.liquid-glass-glow {
    box-shadow: 0 0 15px var(--primary-glow) inset, 0 0 15px var(--primary-glow);
    animation: liquid-pulse 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- HOME HERO SPECIFIC --- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center; padding: 8rem 2rem;
}
.hero-badge {
    /* UPDATED: Purple badge background and border */
    background: rgba(138, 43, 226, 0.15); border: 1px solid rgba(138, 43, 226, 0.3);
    color: var(--primary); padding: 0.5rem 1rem; border-radius: 50px;
    font-size: 0.85rem; font-weight: 700; margin-bottom: 1.5rem;
    text-transform: uppercase; letter-spacing: 1px; animation: pulse 2s infinite;
}
.hero h1 {
    font-family: 'Outfit', sans-serif; font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #fff 0%, #cccccc 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero h1 span {
    /* UPDATED: Purple gradient for accent text */
    background: linear-gradient(135deg, #8A2BE2 0%, #B886F0 100%); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin-bottom: 3rem; }
.cta-group { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.btn {
    padding: 1rem 2.5rem; border-radius: 12px; font-weight: 700; text-decoration: none;
    transition: all 0.3s ease; display: flex; align-items: center; gap: 10px; font-family: 'Outfit', sans-serif;
}
.btn-primary { 
    background: var(--primary); color: white; 
    /* UPDATED: Purple box shadow */
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3); 
}
.btn-primary:hover { 
    transform: translateY(-3px); 
    /* UPDATED: Purple box shadow on hover */
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.5); 
}
.btn-secondary { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: white; backdrop-filter: blur(10px); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: white; }

/* --- HOME WIDGETS --- */
.ip-widget {
    margin-top: 3rem; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem; border-radius: 16px; display: flex; align-items: center; gap: 1rem; backdrop-filter: blur(10px);
}
.ip-text { font-family: 'Inter', monospace; color: var(--primary); font-size: 1.1rem; font-weight: 600; }
.copy-btn {
    background: var(--glass-border); border: none; color: white; padding: 0.5rem 1rem;
    border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.copy-btn:hover { background: white; color: black; }
.copy-btn.copied { background: #10b981; color: white; }
.stat-number { font-size: 3.5rem; font-weight: 800; color: var(--primary); font-family: 'Outfit', sans-serif; line-height: 1; margin-bottom: 0.5rem; display: block; }
.feature-icon { 
    font-size: 3rem; margin-bottom: 1.5rem; 
    /* UPDATED: Purple gradient for icon */
    background: linear-gradient(135deg, var(--primary), #fff); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
    /* UPDATED: Purple drop shadow for icon */
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.4)); 
}
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.glass-card h3 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; margin-bottom: 1rem; color: white; }

/* --- STAFF SPECIFIC --- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.staff-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar {
    width: 120px; height: 120px; background: #111; border-radius: 50%;
    margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; border: 2px solid var(--primary);
    /* UPDATED: Purple box shadow */
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.2); position: relative; overflow: hidden;
}
.role-badge { display: inline-block; padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 1rem; letter-spacing: 0.5px; }
/* UPDATED: Owner role to use the new primary purple */
.role-owner { background: rgba(138, 43, 226, 0.2); color: #8A2BE2; border: 1px solid rgba(138,43,226,0.3); }
.role-admin { background: rgba(255, 0, 0, 0.2); color: #ff4444; border: 1px solid rgba(255,0,0,0.3); }
.role-mod { background: rgba(0, 255, 136, 0.2); color: #00ff88; border: 1px solid rgba(0,255,136,0.3); }

/* --- RULES SPECIFIC --- */
.rules-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; max-width: 900px; margin: 0 auto; }
.rule-item { display: flex; gap: 1.5rem; align-items: flex-start; }
.rule-number {
    font-family: 'Outfit', sans-serif; font-size: 3rem; font-weight: 800;
    color: var(--primary); line-height: 1; opacity: 0.4; min-width: 60px;
}
.rule-content h3 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; margin-bottom: 0.5rem; color: white; }

/* --- CHANGELOG SPECIFIC --- */
.changelog-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; max-width: 800px; margin: 0 auto; }
.changelog-entry .changelog-summary { cursor: pointer; padding: 0.5rem 0; }
.changelog-entry .changelog-summary h3 {
    font-family: 'Outfit', sans-serif; font-size: 1.5rem; margin-bottom: 0.5rem; 
    color: var(--primary); border-bottom: 1px solid transparent; transition: border-bottom 0.3s;
}
.changelog-entry .changelog-summary:hover h3 { border-bottom: 1px solid var(--primary); }
.changelog-entry .click-to-view { font-size: 0.9rem; color: var(--primary); opacity: 0.8; }
.changelog-entry .changelog-details { 
    max-height: 0; overflow: hidden; 
    transition: max-height 0.3s ease-in-out, padding-top 0.3s ease-in-out; 
    padding-top: 0;
}
.changelog-entry .changelog-details.visible { max-height: 500px; padding-top: 1rem; }
.changelog-entry ul { list-style: none; padding-left: 0; }
.changelog-entry ul li { padding-left: 1.5rem; position: relative; margin-bottom: 0.75rem; color: var(--text-main); }
.changelog-entry ul li::before {
    content: '•'; color: var(--primary); font-size: 1.5rem; line-height: 1;
    position: absolute; left: 0; top: 2px;
}

/* --- FOOTER & ANIMATIONS --- */
footer { padding: 4rem 2rem; background: transparent; margin-top: 4rem; }
.footer-content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2rem; }
.social-links { display: flex; align-items: center; gap: 1.5rem; }
.social-links a { color: var(--text-muted); font-size: 1.1rem; text-decoration: none; transition: color 0.3s; display: flex; align-items: center; }
.social-links a:hover { color: var(--primary); }

/* UPDATED: Pulse Animation (now purple) */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(138, 43, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0); }
}

/* UPDATED: Liquid Pulse Animation (now purple) */
@keyframes liquid-pulse {
    0% { box-shadow: 0 0 15px rgba(138, 43, 226, 0.4) inset, 0 0 15px rgba(138, 43, 226, 0.4); }
    50% { box-shadow: 0 0 25px rgba(175, 87, 240, 0.6) inset, 0 0 25px rgba(175, 87, 240, 0.6); } /* Lighter purple for 50% */
    100% { box-shadow: 0 0 15px rgba(138, 43, 226, 0.4) inset, 0 0 15px rgba(138, 43, 226, 0.4); }
}

.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .cta-group { flex-direction: column; width: 100%; }
    .ip-widget { flex-direction: column; width: 100%; }
    .rules-grid { padding: 0 1rem; }
    .rule-item { flex-direction: column; gap: 0.5rem; }
}

/* --- PAGE TRANSITION (CYBER WARP EFFECT) --- */

/* Base transition properties on the page content wrapper */
#page-content { 
    width: 100%; 
    
    transition: 
        transform 0.4s cubic-bezier(0.86, 0, 0.07, 1), 
        opacity 0.4s ease-out; 
    
    transform-origin: center center;
    /* Enable 3D transforms */
    perspective: 1000px;
    backface-visibility: hidden;
    position: relative; 
}

/* 1. WARP OUT (Outgoing Page) */
.warp-out {
    transform: translateX(calc(var(--warp-direction) * -100px));
    opacity: 0;
}

/* 2. WARP IN (Incoming Page - Initial State) */
.warp-in {
    transform: translateX(calc(var(--warp-direction) * 100px));
    opacity: 0;
}

/* --- HAMBURGER MENU STYLES (FIXED) --- */
.nav-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px; 
    z-index: 2000; /* Ensure it's on top */
    position: relative; 
}

.hamburger-line {
    pointer-events: none; /* Ensure clicks hit the button, not the line */
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile View Settings */
@media (max-width: 768px) {
    /* Show the button */
    .nav-toggle {
        display: block; 
    }

    /* Override old CSS and set up the sliding menu */
    .nav-links {
        display: flex !important; /* Force visibility for slide-in */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.98); 
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        
        transform: translateX(100%); /* Hidden off-screen to the right */
        transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
        z-index: 1999;
    }

    /* Class added by JS to show menu */
    .nav-links.mobile-open {
        transform: translateX(0);
    }

    /* Hamburger Animation to 'X' */
    .nav-toggle.open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .nav-toggle.open .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* --- THEME TOGGLE STYLES --- */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.theme-icon {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
    stroke-width: 2;
    transition: all 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    stroke: var(--primary);
}

/* Light theme variables */
body.light-theme {
    --bg-dark: #f8f9fa;
    --text-main: #212529;
    --text-muted: #6c757d;
    --glass-border: rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(138, 43, 226, 0.3);
}

body.light-theme #canvas-container {
    background: radial-gradient(circle at center, #e9ecef 0%, #f8f9fa 100%);
}

body.light-theme .navbar.scrolled {
    background: rgba(248, 249, 250, 0.85);
}

body.light-theme .nav-links a {
    color: var(--text-muted);
}

body.light-theme .nav-links a:hover {
    color: var(--text-main);
}

body.light-theme .nav-links a.active {
    color: var(--text-main);
}

body.light-theme .nav-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--glass-border);
    color: var(--text-main) !important;
}

body.light-theme .nav-btn:hover {
    background: var(--primary);
    color: white !important;
}

body.light-theme .glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
}

body.light-theme .logo-img {
    filter: none;
}

/* --- 404 ERROR PAGE --- */
.error-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-content {
    text-align: center;
    max-width: 600px;
}

.error-code {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
}

.code-main {
    font-size: 8rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(45deg, var(--primary), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.1em;
    line-height: 1;
}

.code-middle {
    margin: 0 1rem;
    position: relative;
}

.code-particle {
    font-size: 6rem;
    font-weight: 900;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.error-title {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.error-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.error-actions .btn-primary {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.error-actions .btn-primary:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
}

.error-actions .btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 2px solid var(--glass-border);
}

.error-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.error-suggestions {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
}

.error-suggestions h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
}

.error-suggestions li {
    margin-bottom: 0.5rem;
}

.error-suggestions a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.error-suggestions a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Mobile responsiveness for 404 page */
@media (max-width: 768px) {
    .error-code {
        flex-direction: column;
        gap: 1rem;
    }

    .code-main {
        font-size: 5rem;
    }

    .code-particle {
        font-size: 4rem;
    }

    .error-title {
        font-size: 2rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .error-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}