/* Mobile Header Fix - Logo and Layout */

/* Mobile view styles */
@media (max-width: 768px) {
    /* Header container */
    .header {
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Navigation container */
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        height: 60px;
        width: 100%;
    }
    
    /* Logo styles for mobile */
    .logo {
        display: block !important;
        font-size: 1.25rem !important;
        font-weight: 800 !important;
        flex: 1;
        margin-right: 1rem;
        /* Override gradient text that might not show on mobile */
        background: none !important;
        -webkit-text-fill-color: #1e293b !important;
        color: #1e293b !important;
    }
    
    .logo a {
        color: #1e293b !important;
        text-decoration: none !important;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 800 !important;
    }
    
    /* Add icon before logo text */
    .logo a::before {
        content: "📚";
        font-size: 1.5rem;
        display: inline-block;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        width: 30px;
        height: 30px;
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
        z-index: 1002;
    }
    
    .mobile-menu-toggle span {
        display: block;
        position: absolute;
        width: 100%;
        height: 3px;
        background: #64748b;
        border-radius: 2px;
        transition: all 0.3s ease;
        left: 0;
        transform-origin: center center;
    }
    
    /* Position spans */
    .mobile-menu-toggle span:nth-child(1) {
        top: 6px;
    }
    
    .mobile-menu-toggle span:nth-child(2) {
        top: 13px;
    }
    
    .mobile-menu-toggle span:nth-child(3) {
        top: 20px;
    }
    
    /* Hamburger to X animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) !important;
        top: 13px !important;
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0 !important;
        transform: scale(0) !important;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) !important;
        top: 13px !important;
    }
    
    /* Hide desktop navigation on mobile */
    .nav-wrapper,
    .nav-buttons {
        display: none !important;
    }
    
    /* Mobile menu styles */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85vw;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 1001;
        transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu.active {
        right: 0;
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Ensure body doesn't scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .logo {
        font-size: 1rem !important;
    }
    
    .logo a::before {
        font-size: 1.3rem;
    }
    
    .nav-container {
        padding: 0.75rem 0.75rem;
    }
}

/* Landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 50px;
    }
    
    .nav-container {
        height: 50px;
        padding: 0.5rem 1rem;
    }
    
    body {
        padding-top: 50px !important;
    }
    
    .logo {
        font-size: 1rem !important;
    }
    
    .mobile-menu-toggle {
        height: 25px;
    }
}