@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg: #050505;
    --bg2: #0a0a0a;
    --bg3: #111;
    --glass: rgba(10, 10, 10, 0.6);
    --glass-border: rgba(0, 255, 65, 0.08);
    --glass-border-hover: rgba(0, 255, 65, 0.25);
    --green: #00ff41;
    --green-dim: #0d7a2e;
    --green-dark: #052e10;
    --green-glow: 0 0 15px rgba(0, 255, 65, 0.15);
    --green-glow-strong: 0 0 25px rgba(0, 255, 65, 0.3);
    --text: #e0e0e0;
    --text-dim: #7a7a7a;
    --text-muted: #4a4a4a;
    --radius: 8px;
    --radius-lg: 12px;
    --nav-width: 64px;
    --nav-expanded: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === ANIMATED MESH GRADIENT BG === */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background: var(--bg);
    overflow: hidden;
}
.mesh-bg::before {
    content: '';
    position: absolute;
    width: 150%; height: 150%;
    top: -25%; left: -25%;
    background:
        radial-gradient(ellipse 600px 600px at 20% 30%, rgba(0, 255, 65, 0.04), transparent),
        radial-gradient(ellipse 500px 500px at 70% 60%, rgba(0, 255, 65, 0.03), transparent),
        radial-gradient(ellipse 400px 400px at 40% 80%, rgba(13, 122, 46, 0.03), transparent);
    animation: meshShift 20s ease-in-out infinite alternate;
}
@keyframes meshShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -20px) rotate(1deg); }
    66% { transform: translate(-20px, 30px) rotate(-1deg); }
    100% { transform: translate(10px, 10px) rotate(0.5deg); }
}

/* === SCAN LINE === */
.scan-line {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.03), transparent);
    z-index: 9998;
    pointer-events: none;
    animation: scanMove 8s linear infinite;
}
@keyframes scanMove {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* === SIDEBAR NAV === */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--nav-width);
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.sidebar:hover {
    width: var(--nav-expanded);
}
.sidebar-logo {
    width: var(--nav-width);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo img {
    width: 36px; height: 36px;
    object-fit: contain;
}
.nav-items {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.nav-item {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s, background 0.2s;
    gap: 14px;
    font-size: 0.875rem;
    font-weight: 500;
}
.nav-item:hover {
    color: var(--text);
    background: rgba(0, 255, 65, 0.03);
    text-decoration: none;
}
.nav-item.active {
    color: var(--green);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: var(--green);
    border-radius: 0 2px 2px 0;
    box-shadow: var(--green-glow);
}
.nav-item svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
}
.nav-item span { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .nav-item span { opacity: 1; }

.nav-bottom {
    border-top: 1px solid var(--glass-border);
    padding: 12px 0;
    flex-shrink: 0;
}

#nav-auth {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-login-btn {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    background: none;
    border: none;
    color: var(--green);
    cursor: pointer;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    gap: 14px;
    width: 100%;
    text-align: left;
}
.nav-login-btn:hover { background: rgba(0, 255, 65, 0.05); }

.nav-user {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 14px;
    cursor: pointer;
    gap: 10px;
    transition: background 0.2s;
}
.nav-user:hover { background: rgba(255,255,255,0.03); }
.nav-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}
.nav-uname {
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.sidebar:hover .nav-uname { opacity: 1; }

.nav-dropdown {
    display: none;
    padding: 4px 10px;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 65, 65, 0.08);
    border: 1px solid rgba(255, 65, 65, 0.15);
    border-radius: var(--radius);
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
}
.nav-dropdown-btn:hover { background: rgba(255, 65, 65, 0.15); }

.admin-link {
    color: var(--green) !important;
}

/* === MAIN CONTENT === */
.main {
    margin-left: var(--nav-width);
    min-height: 100vh;
}

/* === HERO === */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
}
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5,5,5,0.3) 0%, rgba(5,5,5,0.7) 60%, var(--bg) 100%);
}
.hero-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-image: url('../pictures/server_banner.png');
    background-size: cover;
    background-position: center;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 255, 65, 0.15);
    filter: brightness(1.3);
    position: relative;
    z-index: 1;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-top: 12px;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    z-index: 1;
}
.hero-stats {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    z-index: 1;
    flex-wrap: wrap;
    justify-content: center;
}
.stat-pill {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.stat-pill:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--green-glow);
}
.stat-label { color: var(--text-dim); }
.stat-val { color: var(--green); font-weight: 600; font-family: 'Chakra Petch', sans-serif; }

.hero-scroll {
    position: absolute;
    bottom: 30px;
    animation: scrollBounce 2s ease-in-out infinite;
    z-index: 1;
}
.hero-scroll svg { width: 24px; height: 24px; stroke: var(--text-muted); }
@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* === GLASS CARDS === */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--green-glow);
    transform: translateY(-2px);
}

/* === SECTIONS === */
.section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.section-title {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text);
}
.section-sub {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

/* === FEATURE GRID === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.feature-icon {
    width: 40px; height: 40px;
    background: rgba(0, 255, 65, 0.08);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--green);
}
.feature-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}
.feature-desc { color: var(--text-dim); font-size: 0.9rem; }

/* === SERVER INFO GRID === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}
.info-card:hover { text-decoration: none; }
.info-card svg {
    width: 28px; height: 28px;
    color: var(--green);
}
.info-card-label { font-size: 0.9rem; font-weight: 500; }

/* === CTA === */
.cta-section {
    text-align: center;
    padding: 80px 40px;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--glass-border-hover);
    border-radius: 100px;
    color: var(--green);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s, box-shadow 0.3s;
}
.cta-btn:hover {
    background: rgba(0, 255, 65, 0.15);
    box-shadow: var(--green-glow-strong);
    text-decoration: none;
}

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}
.footer-links a {
    color: var(--text-dim);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--green); text-decoration: none; }

/* === ENERGY DIVIDER === */
.energy-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-hover), transparent);
    margin: 0 40px;
    position: relative;
}
.energy-divider::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    filter: blur(2px);
}

/* === FADE IN ANIMATION === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === PAGE HEADER (for sub pages) === */
.page-header {
    padding: 100px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* === UTILITY === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: 100px;
        padding: 6px 8px;
        z-index: 1000;
        gap: 2px;
    }
    .mobile-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px; height: 44px;
        border-radius: 50%;
        color: var(--text-dim);
        text-decoration: none;
        transition: color 0.2s, background 0.2s;
    }
    .mobile-nav a.active {
        color: var(--green);
        background: rgba(0, 255, 65, 0.08);
    }
    .mobile-nav a svg { width: 20px; height: 20px; }

    .hero-title { font-size: clamp(3rem, 15vw, 6rem); }
    .section { padding: 60px 20px; }
    .page-header { padding: 80px 20px 30px; }
    .container { padding: 0 20px; }
    .hero-stats { gap: 10px; }
    .stat-pill { padding: 8px 16px; font-size: 0.8rem; }
}

@media (min-width: 769px) {
    .mobile-nav { display: none !important; }
}
