/* ================================================================== */
/* Jambo Header — YouTube-style                                       */
/* ================================================================== */

.jambo-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Override old template padding that was for the fixed header. */
.custom-header-relative .main-content {
    padding-top: 0 !important;
}

/* ---- Row 1: Main bar ---- */
.jambo-header__bar {
    padding: 0.5rem 0;
}

.jambo-header__logo img {
    height: 36px;
    width: auto;
}

.jambo-header__menu-btn {
    background: none;
    border: 0;
    color: rgba(255,255,255,0.85);
    font-size: 1.5rem;
    padding: 0.375rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jambo-header__menu-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Subscribe badge after logo */
.jambo-subscribe-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.25);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.jambo-subscribe-badge:hover {
    background: rgba(245,158,11,0.2);
    border-color: rgba(245,158,11,0.4);
    color: #f59e0b;
}
.jambo-subscribe-badge i {
    font-size: 0.8rem;
}

/* ---- Search bar ---- */
.jambo-header__search {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.jambo-search-form {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2rem;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    transition: border-color 0.2s;
}
.jambo-search-form:focus-within {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

.jambo-search-input {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    outline: none;
}
.jambo-search-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.jambo-search-btn {
    background: rgba(255,255,255,0.08);
    border: 0;
    border-left: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
}
.jambo-search-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* Mobile: search bar hidden, toggle icon visible */
.jambo-header__search-toggle {
    background: none;
    border: 0;
    color: rgba(255,255,255,0.85);
    font-size: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
    flex-shrink: 0;
}
.jambo-header__search-toggle:hover {
    background: rgba(255,255,255,0.1);
}

@media (min-width: 992px) {
    .jambo-header__search-toggle { display: none !important; }
    .jambo-header__search { display: block !important; }
}
@media (max-width: 991.98px) {
    .jambo-header__bar .container-fluid {
        gap: 0.5rem !important;
    }
    .jambo-header__logo img {
        height: 28px;
    }
    .jambo-header__search {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        z-index: 10;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 0.5rem 1rem;
        align-items: center;
    }
    .jambo-header__search.jambo-search--expanded {
        display: flex !important;
    }
    .jambo-search--expanded .jambo-search-form {
        width: 100%;
    }
    .jambo-header__right {
        gap: 0 !important;
    }
    .jambo-header__icon,
    .jambo-header__search-toggle {
        width: 2rem;
        height: 2rem;
        font-size: 1.125rem;
    }
    .jambo-header__avatar img {
        width: 28px;
        height: 28px;
    }
}

/* ---- Search results dropdown ---- */
.jambo-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    z-index: 1001;
}

.jambo-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.1s;
}
.jambo-search-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.jambo-search-thumb {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 0.25rem;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.jambo-search-info {
    min-width: 0;
}
.jambo-search-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jambo-search-empty {
    padding: 1.5rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.875rem;
}

/* ---- Right side icons ---- */
.jambo-header__right {
    gap: 0.25rem !important;
}
.jambo-header__icon {
    color: rgba(255,255,255,0.85);
    font-size: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.jambo-header__icon:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Unread-notification count badge on the bell icon. Absolute-positioned
   relative to .jambo-header__icon so it sits on the top-right corner
   without affecting the icon's hit target. */
.jambo-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--bs-primary, #1A98FF);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8);
}

.jambo-header__avatar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.jambo-header__avatar img {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}
.jambo-header__avatar img:hover {
    border-color: rgba(255,255,255,0.3);
}

/* User dropdown */
.jambo-user-dropdown {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 0.75rem !important;
    min-width: 240px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.jambo-user-dropdown .dropdown-item {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
}
.jambo-user-dropdown .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.jambo-user-dropdown .dropdown-item i {
    font-size: 1.1rem;
    opacity: 0.7;
}

/* ---- Row 2: Genre chips bar ---- */
.jambo-genres-bar {
    padding: 0.5rem 0;
}

.jambo-genres-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    /* Fade edges */
    mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
}
.jambo-genres-scroll::-webkit-scrollbar {
    display: none;
}

.jambo-genre-chip {
    flex-shrink: 0;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.jambo-genre-chip:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.jambo-genre-chip.active {
    background: #fff;
    color: #000;
}

/* ================================================================== */
/* Desktop sidebar (YouTube-style, expands on hamburger click)        */
/* ================================================================== */

.jambo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #111;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    padding-top: 3.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    display: none;
}
@media (min-width: 992px) {
    .jambo-sidebar { display: block; }
}
.jambo-sidebar--open {
    transform: translateX(0);
}

.jambo-sidebar__inner {
    padding: 0.5rem 0;
}

.jambo-sidebar__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: background 0.12s;
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
}
.jambo-sidebar__link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.jambo-sidebar__link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 500;
}
.jambo-sidebar__link i {
    font-size: 1.25rem;
    flex-shrink: 0;
    opacity: 0.8;
}
.jambo-sidebar__link.active i {
    opacity: 1;
}

.jambo-sidebar__divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.5rem 1rem;
}

/* ================================================================== */
/* Mobile bottom navigation                                            */
/* ================================================================== */

.jambo-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    /* Bind to the VISUAL viewport, not the containing block. With
       `left: 0; right: 0` the nav fills its containing block (the
       initial containing block / layout viewport). On mobile, ANY
       element on the page that escapes 100% width — a swiper wrapper
       with a transform, an oversized image, a vendor stylesheet that
       sets `width: 1920px` — extends the layout viewport past the
       screen. The nav then renders that wider, with the rightmost
       tabs sliding offscreen.

       `width: 100vw` + `left: 0` is bound to the visual viewport
       directly; `max-width: 100%` falls back to 100% when 100vw
       includes a phantom scrollbar (rare on mobile, defensive). The
       inner flex layout still distributes the four items evenly. */
    left: 0;
    right: auto;
    width: 100vw;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.375rem 0.5rem calc(0.375rem + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 991.98px) {
    .jambo-mobile-nav { display: flex; }
    /* Push content above the bar so the last section isn't hidden behind it. */
    body { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0)); }
}

.jambo-mobile-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.25rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: color 0.15s, background 0.15s;
    min-width: 0;
}
.jambo-mobile-nav__item:hover {
    color: rgba(255,255,255,0.9);
}
.jambo-mobile-nav__item.is-active {
    color: #fff;
}

.jambo-mobile-nav__icon {
    font-size: 1.5rem;
    line-height: 1;
    display: block;
}
.jambo-mobile-nav__icon--active {
    display: none;
}
.jambo-mobile-nav__item.is-active .jambo-mobile-nav__icon {
    display: none;
}
.jambo-mobile-nav__item.is-active .jambo-mobile-nav__icon--active {
    display: block;
}

.jambo-mobile-nav__label {
    display: block;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Overlay behind sidebar */
.jambo-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.jambo-sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ================================================================== */
/* /movie banner — responsive fix                                      */
/* ================================================================== */
/*
 * The movie-slider partial sets background-image inline but the
 * Streamit SCSS for .movie-banner-image is missing background-size /
 * background-position. On mobile that means the 1920x1080 backdrop
 * renders at its native pixel width, blowing the page horizontally
 * out of the viewport — which then misaligns the fixed bottom nav
 * and makes the whole page feel "not responsive". This block fixes
 * that without touching the Vite SCSS pipeline. Same rule on every
 * screen, so add it outside any media query.
 */
.movie-banner-image {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* Defensive: hard-cap horizontal width to the viewport so even
       if a future inline style or child element tries to push wider,
       the parent never blows out. */
    max-width: 100%;
}
.banner-container,
.movie-banner,
.movie-banner .swiper-banner-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* ================================================================== */
/* Mobile horizontal-overflow guard                                    */
/* ================================================================== */
/*
 * Cap body width to the viewport on phones / portrait tablets so any
 * accidental overflow (too-wide swiper wrapper, oversized image,
 * stray `width: 1920px` from a vendor SCSS) doesn't push the layout
 * viewport wider than the screen — when that happens
 * `.jambo-mobile-nav` (position:fixed; right:0) anchors to the
 * document's right edge and slides Series / Watchlist offscreen.
 *
 * Scoped to <body> (not <html>) and to <992px only because:
 *   1. `overflow-x: clip` on <html> interferes with the fullscreen
 *      API in some browsers — the fullscreen target gets clipped
 *      against the html overflow setting on mobile WebKit.
 *   2. Desktop has a horizontal scrollbar to fall back on if some
 *      weird overflow ever happens, and the bottom nav doesn't
 *      exist there. No need to clip.
 *
 * `clip` is preferred over `hidden`: it doesn't create a scroll
 * container, so position:sticky inside still works. Falls back to
 * `hidden` on older browsers via the cascade.
 */
@media (max-width: 991.98px) {
    body {
        overflow-x: hidden;
        overflow-x: clip;
    }

    /* ========================================================== */
    /* THE actual /movie + /series + /vj overflow source           */
    /* ========================================================== */
    /*
     * Streamit's SCSS sets `.card-style-slider .swiper { overflow:
     * visible }` so the card-hover :hover effect can extend ~12%
     * past the swiper boundary on desktop. Mobile has no hover
     * state, but the visible overflow still leaks every VJ row's
     * swiper-wrapper (7+ slides * card width = far wider than the
     * phone viewport) past the right edge of the screen.
     *
     * That horizontal overflow is what extends the document width
     * on /movie, which then anchored the bottom nav offscreen.
     * Kill the visible overflow on mobile only — hover effects
     * weren't usable on touch anyway, so nothing visual is lost.
     */
    .card-style-slider .swiper,
    .card-style-slider .swiper-card,
    .swiper.swiper-card {
        overflow: hidden !important;
    }
}


