/**
 * MultiMovies 2.0 - Responsive Breakpoints & Mobile Optimization
 * Breakpoints: Desktop (1440px+), Laptop (1024px), Tablet (768px), Mobile (320px - 480px)
 */

/* ================= TABLET LANDSCAPE & LAPTOPS (<= 1024px) ================= */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 16px;
    }

    .nav-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .search-trigger {
        min-width: 160px;
        padding: 8px 12px;
    }

    .hero-stage {
        height: 60vh;
        min-height: 460px;
    }

    .hero-content {
        max-width: 520px;
        bottom: 8%;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* ================= TABLET PORTRAIT (<= 768px) ================= */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Migrated to mobile off-canvas drawer */
    }

    .mobile-menu-btn {
        display: block;
    }

    .search-trigger span {
        display: none;
    }

    .search-trigger {
        min-width: auto;
        padding: 8px 10px;
    }

    .hero-stage {
        height: 52vh;
        min-height: 400px;
    }

    .hero-content {
        left: 16px;
        right: 16px;
        max-width: 100%;
        bottom: 16px;
    }

    .hero-title {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .hero-overview {
        display: none; /* Keep hero clean on mobile */
    }

    .slider-arrow {
        display: none; /* Rely on natural touch swipe */
    }

    .shelf-wrap {
        padding: 0 16px;
        margin: 24px auto;
    }

    .shelf-rail > .movie-card,
    .shelf-rail > .cinejoy-poster-card {
        flex: 0 0 145px;
        width: 145px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .card-info {
        padding: 8px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-meta {
        font-size: 11px;
    }

    .server-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .server-chip {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Fixed Mobile Floating Glass Dock (Rule 13: Direct child of body, z-index: 9999) */
    .bottom-nav {
        position: fixed;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        max-width: 440px;
        height: 62px;
        background: rgba(14, 20, 32, 0.88);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 20px;
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 9999 !important;
        pointer-events: auto !important;
        padding: 0 6px;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: #94a3b8;
        font-size: 11px;
        font-weight: 600;
        text-decoration: none;
        flex: 1;
        padding: 8px 0;
        border-radius: 12px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .bottom-nav-item svg {
        width: 19px;
        height: 19px;
        transition: transform 0.2s ease;
    }

    .bottom-nav-item.active, .bottom-nav-item:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
    }

    .bottom-nav-item.active svg {
        transform: scale(1.1);
        color: var(--mm-accent);
    }

    body {
        padding-bottom: 84px; /* Space for floating bottom dock */
    }
}

/* ================= MOBILE PHONES (<= 480px) ================= */
@media (max-width: 480px) {
    .site-logo img {
        height: 30px;
    }

    .hero-stage {
        height: 48vh;
        min-height: 360px;
    }

    .hero-badges {
        gap: 6px;
        font-size: 11.5px;
    }

    .btn-play, .btn-details {
        padding: 9px 18px;
        font-size: 13.5px;
    }

    .shelf-rail > .movie-card,
    .shelf-rail > .cinejoy-poster-card {
        flex: 0 0 130px;
        width: 130px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .watch-info-matrix {
        padding: 16px;
    }
}

/* ================= OFF-CANVAS MOBILE DRAWER ================= */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    background: var(--mm-surface-elevated);
    border-right: 1px solid var(--mm-border-light);
    z-index: 2200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--mm-border);
}

.drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.drawer-nav {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--mm-radius-sm);
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.drawer-link:hover, .drawer-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
