/* ============================================
   UNIFIED MOBILE NAVIGATION
   ============================================ */

/* Mobile Toggle Button - positioned below ticker */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 40px;
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: rgba(15, 15, 24, 0.95);
    border: 1px solid #ff6600;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #ff6600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.sidebar-mobile-toggle:hover,
.sidebar-mobile-toggle.active {
    background: #ff6600;
    color: #0a0a0f;
}

.sidebar-mobile-toggle .lucide-icon,
.sidebar-mobile-toggle i,
.sidebar-mobile-toggle svg {
    width: 22px;
    height: 22px;
}

/* Mobile Overlay */
.mobile-nav-overlay,
.left-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-nav-overlay.active,
.mobile-nav-overlay.show,
.left-sidebar-overlay.active,
.left-sidebar-overlay.show {
    display: block;
}

/* Left Sidebar - Base styles */
.left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #0f0f14 0%, #0a0a0f 100%);
    border-right: 1px solid #1a1a1a;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Desktop: sidebar always visible */
@media (min-width: 1025px) {
    .sidebar-mobile-toggle {
        display: none !important;
    }
    
    .left-sidebar {
        transform: translateX(0) !important;
    }
    
    .mobile-nav-overlay,
    .left-sidebar-overlay {
        display: none !important;
    }
    
    /* Hide mobile-only sidebar on desktop for pages that don't have native sidebar */
    .mobile-sidebar {
        display: none !important;
    }
}

/* Mobile/Tablet: sidebar hidden by default */
@media (max-width: 1024px) {
    .sidebar-mobile-toggle {
        display: flex;
    }
    
    .left-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .left-sidebar.open,
    .left-sidebar.active,
    .left-sidebar.show {
        transform: translateX(0);
    }
    
    /* Hide desktop header on mobile when mobile nav is active */
    body.has-sidebar header:not(.mobile-header),
    body.has-sidebar .header,
    body.has-sidebar header.header {
        display: none !important;
    }
    
    /* Hide old hamburger menu and menu toggle */
    body.has-sidebar .hamburger-menu,
    body.has-sidebar .menu-toggle {
        display: none !important;
    }
    
    /* Hide legacy mobile menu overlay */
    body.has-sidebar .mobile-menu-overlay {
        display: none !important;
    }
    
    /* Adjust main content when sidebar is present */
    body.has-sidebar .main-content,
    body.has-sidebar main,
    body.has-sidebar .terminal-container {
        margin-left: 0;
        padding-top: 60px;
    }
    
    /* Ticker adjustment */
    body.has-sidebar .news-ticker,
    body.has-sidebar .ticker-wrapper,
    body.has-sidebar .ticker-container,
    body.has-sidebar .news-ticker-container {
        margin-top: 60px;
        position: relative;
        top: 0;
    }
    
    /* Container adjustment */
    body.has-sidebar .container {
        padding-top: 56px;
    }
    
    /* Hero section adjustment */
    body.has-sidebar .hero {
        padding-top: 80px;
    }
    
    /* Three column layout adjustment */
    body.has-sidebar .three-column-layout {
        margin-top: 0;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .left-sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .sidebar-mobile-toggle {
        top: 8px;
        left: 8px;
        width: 40px;
        height: 40px;
    }
}

/* Left Sidebar Internal Styles */
.left-sidebar-logo {
    display: flex;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    border-bottom: 1px solid #1a1a1a;
}

.left-sidebar-logo-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: #ff6600;
    font-weight: 700;
    letter-spacing: 1px;
}

.left-sidebar-logo-text .logo-404 {
    color: #fff;
    font-size: 1.2rem;
}

.left-sidebar-logo-text .logo-unlocked {
    display: block;
    font-size: 0.6rem;
    color: #00ff88;
    letter-spacing: 2px;
    margin-top: 2px;
}

.left-sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.left-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.left-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.left-nav-item.active {
    color: #ff6600;
    background: rgba(255, 102, 0, 0.1);
    border-left-color: #ff6600;
}

.left-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #1a1a1a;
    margin-top: auto;
}

.left-sidebar-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.left-sidebar-footer a:hover {
    color: #ff6600;
}

