/* Header (Sidebar Desktop) */
header { 
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem 1.5rem; 
    position: fixed; 
    top: 0; 
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 100; 
    display: flex; 
    flex-direction: column;
    justify-content: flex-start; 
    align-items: flex-start; 
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 5px 0 30px rgba(0,0,0,0.5); 
    transition: all 0.3s ease;
    gap: 2rem;
}

.logo { 
    font-size: 1.8rem; 
    font-weight: bold; 
    color: #fff; 
    position: relative; 
    width: 100%;
    padding-bottom: 1.5rem;
    padding-left: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main { 
    color: var(--accent-color); 
    display: inline-block;
    /* Glitch Animation: Starts after 3s, loops every 5s */
    animation: glitch-text 5s infinite;
    animation-delay: 3s;
}

.logo-sub { 
    font-size: 0.75rem; 
    color: #888; 
    font-weight: 400; 
    margin-top: 5px; 
    letter-spacing: 0.5px;
}

/* Glitch Keyframes */
@keyframes glitch-text {
    0% { text-shadow: 0 0 0 transparent; transform: translate(0); }
    1% { text-shadow: 2px 2px 0 #ff0055, -2px -2px 0 #00d2ff; transform: translate(-2px, 1px); }
    2% { text-shadow: -2px -2px 0 #ff0055, 2px 2px 0 #00d2ff; transform: translate(2px, -1px); }
    3% { text-shadow: 0 0 0 transparent; transform: translate(0); }
    100% { text-shadow: 0 0 0 transparent; transform: translate(0); }
}

nav { 
    display: flex; 
    flex-direction: column; 
    width: 100%;
    gap: 1rem;
    flex: 1; /* Push footer to bottom */
    overflow-y: auto; /* Enable scrolling for small screens */
    scrollbar-width: none; /* Firefox */
}

nav::-webkit-scrollbar { 
    display: none; /* Chrome/Safari */
}

nav a { 
    margin-left: 0; 
    color: #ccc; 
    font-weight: 500; 
    transition: all 0.3s; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 12px 15px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

nav a:hover, nav a.active { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

nav a.active {
    background: rgba(0, 210, 255, 0.1); /* Accent color tint */
    color: var(--accent-color);
    border-right: 3px solid var(--accent-color);
}

nav a i {
    width: 25px;
    text-align: center;
    color: var(--accent-color);
}

/* Void Button in Sidebar */
#modeBtn {
    margin-top: auto; /* Push to bottom, above footer */
    width: 100%;
    padding: 15px;
    text-align: center;
    margin-left: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem; /* Ensure bottom spacing */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0; /* Let button handle the push */
    flex-shrink: 0; /* Prevent shrinking */
}

.sidebar-footer .social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
}

.sidebar-footer .cta-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--accent-color);
    color: #000;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.sidebar-footer .cta-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

/* Cyber Mode Overrides for Sidebar Footer */
body.cyber-mode .sidebar-footer .cta-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: 'Space Mono', monospace;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

body.cyber-mode .sidebar-footer .cta-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px var(--accent-color);
}

/* Main Content Wrapper */
main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    position: relative;
}

/* Footer */
footer { background: #111; padding: 3rem 2rem; text-align: center; color: #666; margin-top: 4rem; position: relative; z-index: 10; }

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 101;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    
    /* Adjust Header for Mobile */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        padding: 0 1.5rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid #333;
        background: rgba(20, 20, 20, 0.95);
        gap: 0;
    }

    .logo {
        width: auto;
        padding-bottom: 0;
        border-bottom: none;
        font-size: 1.5rem;
    }

    /* Reset Main Content Margin */
    main {
        margin-left: 0;
        width: 100%;
        padding-top: 70px; /* Space for fixed header */
    }

    nav {
        position: fixed;
        top: 70px; /* Below header */
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start; /* Start from top */
        align-items: center;
        transition: right 0.4s ease;
        z-index: 99;
        padding: 2rem; /* Standard padding */
        padding-bottom: 4rem; /* Ensure bottom content is accessible */
        gap: 1rem;
        overflow-y: auto; /* Allow scrolling if content is too tall */
    }

    nav.active {
        right: 0;
    }

    nav a {
        margin: 0;
        font-size: 1.5rem;
        width: 100%;
        justify-content: flex-start; /* Align left/start */
        padding: 15px;
    }

    /* Mobile Sidebar Footer Adjustments */
    .sidebar-footer {
        margin-top: 0;
        padding-bottom: 0; /* Remove extra padding since nav handles it */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #modeBtn {
        margin-top: auto;
        width: 100%;
        padding: 15px;
        margin-bottom: 1rem; /* Add space before footer line */
    }

    /* Fix Mobile Menu Links & Icons */
    nav a i {
        font-size: 1.4rem;
        width: 30px;
        text-align: center;
    }
}
