/* ========================================
   MOBILE NAVBAR ENHANCEMENTS - APE TV
   ======================================== */

/* Mobile Navbar Base (768px and below) */
@media (max-width: 768px) {
    /* Navbar Container */
    .navbar-premium {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.98) !important;
        backdrop-filter: blur(10px);
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    
    .nav-container-premium {
        padding: 0 15px !important;
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        max-width: 100% !important;
        gap: 10px;
    }
    
    /* Logo Section - Left Side */
    .logo-container {
        padding: 4px 8px !important;
        gap: 8px !important;
        z-index: 1001;
        flex-shrink: 0;
        margin-right: auto;
    }
    
    .logo-image {
        height: 40px !important;
        width: auto;
    }
    
    .logo-main, .logo-sub {
        font-size: 20px !important;
    }
    
    /* Hide desktop menu - prepare for mobile slide-in */
    .nav-menu-premium {
        position: fixed !important;
        top: 60px !important;
        left: -280px !important;
        width: 280px !important;
        height: calc(100vh - 60px) !important;
        background: rgba(0, 0, 0, 0.98) !important;
        backdrop-filter: blur(20px);
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 20px 0 !important;
        gap: 0 !important;
        overflow-y: auto;
        border-right: 1px solid rgba(229, 9, 20, 0.2);
        box-shadow: 2px 0 20px rgba(0,0,0,0.5);
        z-index: 999 !important;
        transition: left 0.3s ease !important;
        display: flex !important;
    }
    
    /* Right Actions - Search + Sign In */
    .nav-actions-premium {
        display: flex !important;
        align-items: center;
        gap: 12px;
        z-index: 1001;
        flex-shrink: 0;
        margin-right: 0;
    }
    
    /* Mobile Menu Toggle (Hamburger) - Far Right */
    .hamburger-premium {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        background: transparent;
        border: none;
        flex-shrink: 0;
        margin-left: 12px;
    }
    
    .hamburger-premium span {
        width: 25px;
        height: 3px;
        background: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }
    
    /* Hamburger Animation */
    .hamburger-premium.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
        background: #e50914;
    }
    
    .hamburger-premium.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-premium.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
        background: #e50914;
    }
    
    /* Mobile Menu Overlay - Active State */
    .nav-menu-premium.active {
        left: 0 !important;
    }
    
    /* Mobile Menu Items */
    .nav-menu-premium li {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .nav-link {
        width: 100% !important;
        padding: 16px 25px !important;
        display: flex !important;
        align-items: center;
        gap: 12px !important;
        font-size: 16px !important;
        border-radius: 0 !important;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
    }
    
    .nav-link span {
        display: inline !important;
    }
    
    .nav-link i {
        font-size: 18px !important;
        min-width: 24px;
    }
    
    .nav-link:hover {
        background: rgba(229, 9, 20, 0.1) !important;
        border-left-color: #e50914;
        padding-left: 30px !important;
    }
    
    .nav-link.active {
        background: linear-gradient(90deg, rgba(229, 9, 20, 0.2), transparent) !important;
        border-left-color: #e50914;
        color: #e50914 !important;
    }
    
    .nav-link.premium-link {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.1)) !important;
        border-left-color: #FFD700 !important;
        margin: 10px 0;
        color: #FFD700 !important;
        font-weight: 700 !important;
    }
    
    .nav-link.premium-link:hover {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), transparent) !important;
    }
    
    /* Search Container - Mobile */
    .search-container {
        position: relative;
        flex-shrink: 0;
        margin-right: 16px;
    }
    
    .search-toggle {
        width: 40px !important;
        height: 40px !important;
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 50%;
        color: #fff;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
        flex-shrink: 0;
    }
    
    .search-toggle:hover, .search-toggle:active {
        background: #e50914;
        border-color: #e50914;
        transform: scale(1.05);
    }
    
    .search-box-premium {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(20px);
        border: none;
        border-bottom: 1px solid #333;
        border-radius: 0;
        padding: 15px;
        display: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        z-index: 998;
    }
    
    .search-box-premium.active {
        display: flex !important;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .search-input-premium {
        flex: 1;
        background: #1a1a1a;
        border: 1px solid #333;
        color: #fff;
        padding: 12px 15px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    .search-input-premium:focus {
        outline: none;
        border-color: #e50914;
    }
    
    .search-btn {
        width: 45px;
        height: 45px;
        background: #e50914;
        border: none;
        border-radius: 8px;
        color: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 10px;
    }
    
    .search-btn:active {
        transform: scale(0.95);
    }
    
    /* User Button - Mobile */
    .btn-nav {
        padding: 8px 16px !important;
        width: auto !important;
        height: 40px !important;
        border-radius: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: auto !important;
        min-height: 40px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    .btn-nav span {
        display: inline !important;
        font-size: 14px !important;
    }
    
    .btn-nav i {
        font-size: 14px !important;
        margin: 0 !important;
        margin-right: 6px !important;
    }
    
    .user-btn {
        background: linear-gradient(135deg, #e50914, #b20710) !important;
        box-shadow: 0 2px 8px rgba(229, 9, 20, 0.4);
    }
    
    .user-btn:active {
        transform: scale(0.95);
    }
    
    /* Mobile Menu Backdrop */
    .nav-menu-premium.active::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        /* place the backdrop below the sliding menu (menu z-index: 999) but above page content */
        z-index: 998;
    }
    
    /* Prevent Body Scroll When Menu Open */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Content Padding for Fixed Navbar */
    .hero-4k, .page-hero {
        margin-top: 60px !important;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .nav-container-premium {
        padding: 0 12px !important;
        gap: 8px;
    }
    
    .logo-image {
        height: 35px !important;
    }
    
    .logo-main, .logo-sub {
        font-size: 18px !important;
    }
    
    .nav-menu-premium.active {
        width: 260px;
    }
    
    .nav-link {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
    
    .search-toggle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        flex-shrink: 0;
    }
    
    .btn-nav {
        padding: 8px 16px !important;
        width: auto !important;
        height: 38px !important;
        min-width: auto !important;
        min-height: 38px !important;
    }
    
    .hamburger-premium {
        padding: 8px;
    }
    
    .hamburger-premium span {
        width: 22px;
    }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-menu-premium {
        gap: 2px !important;
    }
    
    .nav-link {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .nav-link span {
        display: inline !important;
    }
    
    .search-box-premium {
        width: 300px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-menu-premium {
        height: calc(100vh - 50px);
        top: 50px;
    }
    
    .nav-container-premium {
        height: 50px !important;
    }
    
    .navbar-premium {
        height: 50px;
    }
    
    .hero-4k, .page-hero {
        margin-top: 50px !important;
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link, .search-toggle, .btn-nav, .hamburger-premium {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .nav-link:hover {
        background: transparent !important;
        padding-left: 25px !important;
    }
    
    .nav-link:active {
        background: rgba(229, 9, 20, 0.2) !important;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .nav-menu-premium,
    .hamburger-premium span,
    .nav-link {
        transition: none !important;
        animation: none !important;
    }
}
