/* Mobile Menu Styles - Only applies to screens below 600px */
@media screen and (max-width: 600px) {
    /* Hamburger Menu Button */
    .hamburger-menu {
        position: fixed;
        top: 14px;
        left: 14px;
        width: 30px;
        height: 24px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
        z-index: 150;
        transform: translateZ(0);
        will-change: transform;
    }

    .hamburger-line {
        width: 100%;
        height: 3px;
        background-color: #3C0177;
        transition: transform 0.3s ease, opacity 0.3s ease;
        border-radius: 3px;
        will-change: transform, opacity;
    }

    /* Animated Hamburger to X */
    .menu-open .hamburger-line:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }

    .menu-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .menu-open .hamburger-line:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

    /* Light mode hamburger */
    body.light-mode .hamburger-line {
        background-color: #bd0000;
    }

    /* Sidebar Menu - Optimized for performance */
    body .sidebar-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        z-index: 140;
        display: flex;
        flex-direction: column;
        padding: 70px 30px 30px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        pointer-events: auto;
        overflow-y: auto;
        /* Remove box shadow causing the gradient issue */
        box-shadow: none;
        /* Add hardware acceleration */
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        will-change: transform;
    }

    body.menu-open .sidebar-menu {
        transform: translateX(0);
    }

    /* Light mode sidebar */
    body.light-mode .sidebar-menu {
        background: rgba(255, 255, 255, 0.95);
    }

    /* Menu Items */
    body .sidebar-menu-item {
        font-family: 'Share Tech Mono', monospace;
        color: #3C0177;
        margin: 15px 0;
        font-size: 18px;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    body.light-mode .sidebar-menu-item {
        color: #bd0000;
    }

    /* Theme Toggle in Sidebar */
    body .sidebar-theme-toggle {
        display: flex;
        align-items: center;
        margin: 25px 0;
        cursor: pointer;
    }

    body .sidebar-toggle-label {
        font-family: 'Share Tech Mono', monospace;
        color: #3C0177;
        margin-right: 15px;
        font-size: 18px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    body .sidebar-toggle-switch {
        position: relative;
        width: 60px;
        height: 30px;
        background-color: transparent;
        border: 2px solid #3C0177;
        border-radius: 30px;
        transition: border-color 0.3s ease;
    }

    body .sidebar-toggle-slider {
        position: absolute;
        top: 2px;
        left: 2px;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background-color: #3C0177;
        transition: transform 0.3s ease, background-color 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        will-change: transform, background-color;
    }

    body .sidebar-toggle-slider::before {
        content: "D";
        color: #888;
        font-size: 12px;
        font-weight: bold;
        font-family: 'Share Tech Mono', monospace;
    }

    /* Light mode toggle in sidebar */
    body.light-mode .sidebar-toggle-label {
        color: #bd0000;
    }

    body.light-mode .sidebar-toggle-switch {
        border-color: #bd0000;
    }

    body.light-mode .sidebar-toggle-slider {
        transform: translateX(30px);
        background-color: #bd0000;
    }

    body.light-mode .sidebar-toggle-slider::before {
        content: "L";
        padding-left: 2px;
    }

    /* Backdrop - Optimized for performance */
    body .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 130;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        /* Add hardware acceleration */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    body.menu-open .menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Mobile-only title container adjustments */
    body .title-container {
        position: fixed !important;
        top: 60px !important; /* Lowered from 45px to 60px */
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0 !important;
        z-index: 32 !important; /* Above the fade-container (z-index: 30) */
        pointer-events: none !important;
        /* Add transform to use GPU acceleration and prevent twitching */
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        will-change: opacity !important;
    }

    body .title-image {
        width: 87% !important; /* Increased from 75% to 87% (approximately +15%) */
        max-width: 345px !important; /* Increased from 300px to 345px (approximately +15%) */
        margin: 0 auto !important;
    }

    /* Hide the original mode toggle on mobile */
    body .mode-toggle {
        display: none !important;
    }
    
    /* Style for scroll prevent overlay */
    .scroll-prevent-overlay {
        background-color: transparent;
        touch-action: none;
        -webkit-touch-callout: none;
        position: fixed;
        z-index: 129;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Ensure desktop styles aren't affected */
@media screen and (min-width: 601px) {
    .hamburger-menu,
    .sidebar-menu,
    .menu-backdrop {
        display: none !important;
    }
} 