/* ============================================================= */
/*  ROTV MOBILE CSS — Pixel-perfect match to design concepts     */
/*  Applied exclusively on screens ≤ 768px                       */
/* ============================================================= */

/* ─── 1. BOTTOM NAV BAR ─────────────────────────────────────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: #EA005E;
    z-index: 9000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 700;
    gap: 3px;
    width: 33.33%;
    height: 100%;
    transition: color 0.15s;
    letter-spacing: 0.02em;
}

.bottom-nav-item.active {
    color: #ffffff;
}

.bottom-nav-icon {
    width: 26px;
    height: 26px;
    stroke-width: 2.5px;
}

.bottom-nav-avatar-wrapper {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255, 255, 255, 0.55);
    transition: border-color 0.15s;
}

.bottom-nav-item.active .bottom-nav-avatar-wrapper {
    border-color: #ffffff;
}

.bottom-nav-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── 2. MOBILE SEARCH OVERLAY ─────────────────────────────── */
.mobile-search-overlay {
    display: none;
    position: fixed;
    bottom: 65px;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 8999;
    padding: 14px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-overlay.open {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(0);
}

.mobile-search-inner {
    display: flex;
    align-items: center;
    background: #f2f2f2;
    border-radius: 30px;
    padding: 10px 16px;
    gap: 10px;
}

.mobile-search-inner img {
    width: 18px;
    height: 18px;
    opacity: 0.5;
}

.mobile-search-inner input {
    border: none;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    width: 100%;
    outline: none;
}

.mobile-search-overlay .search-dropdown {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-height: 50vh !important;
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    padding-bottom: 20px;
}

@media (max-width: 768px) {

    /* ─── GLOBAL RESETS ────────────────────────────── */
    body {
        background-color: #fff !important;
        background-image: url('assets/GradientSfondo.png') !important;
        background-repeat: no-repeat !important;
        background-position: top center !important;
        background-size: 100% 270px !important;
        overflow-x: hidden;
    }

    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    body:has(.program-page-main) {
        padding-top: 0 !important;
        background-image: none !important;
        background-color: #ffffff !important;
    }

    body:has(.program-page-main) .navbar .logo {
        filter: brightness(0) invert(1) !important;
    }

    /* ─── NAVBAR: logo over ambient gradient background ──────── */
    .navbar {
        background: transparent !important;
        box-shadow: none !important;
        height: 56px !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        overflow: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 50 !important;
    }

    /* Hide individual navbar-bg box so body top background is clean */
    .navbar-bg {
        display: none !important;
    }

    .nav-content {
        padding: 0 16px !important;
        position: relative;
        z-index: 2;
        height: 100%;
        display: flex;
        align-items: center;
    }

    .nav-left {
        margin-right: 0 !important;
    }

    .nav-left .logo {
        height: 32px !important;
    }

    .nav-center,
    .nav-right {
        display: none !important;
    }

    /* ─── FOOTER: hide on mobile ──────────────────── */
    .footer {
        display: none !important;
    }

    /* ─── MAIN CONTENT ────────────────────────────── */
    .main-content {
        padding: 0 0 80px 0 !important;
    }

    /* section title hidden on mobile (already in category title) */
    #banner-section-title {
        display: none !important;
    }

    /* ─── HERO BANNER — HIDDEN on mobile (replaced by JS mobile cards) ── */
    .live-banner {
        display: none !important;
    }

    /* The original banner container - hidden, replaced by #mobile-banner-carousel */
    #main-banner-container {
        display: none !important;
    }

    /* ─── MOBILE BANNER CAROUSEL (injected by mobile.js) ─────────────── */
    #mobile-banner-carousel {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 12px !important;
        padding: 6px 11vw 22px 11vw !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        margin-top: 56px !important;
        position: relative;
        z-index: 5;
    }

    #mobile-banner-carousel::-webkit-scrollbar {
        display: none;
    }

    .mobile-banner-card {
        flex-shrink: 0 !important;
        width: 78vw !important;
        max-width: 320px !important;
        height: 188px !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        position: relative !important;
        scroll-snap-align: center !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18) !important;
        cursor: pointer;
        background: #151515;
        transform: scale(0.92);
        opacity: 0.82;
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease, box-shadow 0.35s ease;
    }

    .mobile-banner-card.active {
        transform: scale(1) !important;
        opacity: 1 !important;
        box-shadow: 0 10px 28px rgba(234, 0, 94, 0.3) !important;
    }

    .mobile-banner-card-bg {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        width: 100%;
        height: 100%;
    }

    .mobile-banner-card-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0) 55%);
        z-index: 1;
    }

    .mobile-banner-card-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #EA005E;
        color: #fff;
        font-size: 0.55rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        padding: 3px 7px;
        border-radius: 4px;
        z-index: 2;
        text-transform: uppercase;
    }

    .mobile-banner-card-info {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2;
        padding: 10px 44px 10px 12px;
        /* right padding for play button */
    }

    .mobile-banner-card-title {
        color: #fff;
        font-size: 0.95rem;
        font-weight: 900;
        line-height: 1.2;
        margin: 0 0 1px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-banner-card-sub {
        color: rgba(255, 255, 255, 0.75);
        font-size: 0.72rem;
        font-weight: 600;
        margin: 0;
    }

    .mobile-banner-card-play {
        position: absolute;
        right: 10px;
        bottom: 10px;
        z-index: 3;
        width: 36px;
        height: 36px;
        background: #EA005E;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 3px 10px rgba(234, 0, 94, 0.55);
        border: none;
        cursor: pointer;
    }

    .mobile-banner-card-play::after {
        content: '';
        display: block;
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 6px 0 6px 11px;
        border-color: transparent transparent transparent #fff;
        margin-left: 2px;
    }

    /* ─── CATEGORIES ─────────────────────────────── */
    .category {
        margin-bottom: 20px !important;
    }

    .category-title {
        font-size: 1.1rem !important;
        font-weight: 900 !important;
        color: #EA005E !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
        padding: 0 16px !important;
        margin-bottom: 10px !important;
        margin-top: 20px !important;
    }

    .carousel {
        gap: 10px !important;
        padding: 0 16px 10px 16px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-padding-left: 16px;
    }

    .carousel::-webkit-scrollbar {
        display: none;
    }

    .poster {
        width: 100px !important;
        height: 148px !important;
        border-radius: 12px !important;
        flex-shrink: 0 !important;
        scroll-snap-align: start;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    }

    /* ─── TRENDING SECTION ──────────────────────── */
    .trending-section .category-title {
        /* Already handled above */
    }

    .trending-carousel-container {
        position: relative;
    }

    /* Hide desktop scroll buttons */
    .trending-scroll-btn {
        display: none !important;
    }

    .trending-track-wrapper {
        overflow: hidden;
        width: 100%;
    }

    .trending-track {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        padding: 0 16px 10px 16px !important;
        gap: 6px !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        align-items: flex-end !important;
    }

    .trending-track::-webkit-scrollbar {
        display: none;
    }

    .trending-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-end !important;
        margin-right: 4px !important;
        flex-shrink: 0 !important;
        scroll-snap-align: start;
    }

    .trending-rank {
        font-size: 6.5rem !important;
        font-weight: 900 !important;
        -webkit-text-stroke: 2.5px #EA005E !important;
        text-stroke: 2.5px #EA005E !important;
        color: transparent !important;
        line-height: 0.85 !important;
        min-width: 52px !important;
        text-align: right !important;
        transform: translate(0, 10px) !important;
        margin-right: -14px !important;
        z-index: 1 !important;
        position: relative !important;
        filter: none !important;
        user-select: none;
        pointer-events: none;
        flex-shrink: 0;
    }

    .trending-poster-wrap {
        width: 100px !important;
        border-radius: 12px !important;
        z-index: 2 !important;
        flex-shrink: 0 !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18) !important;
    }

    .trending-poster {
        width: 100% !important;
        aspect-ratio: 2/3 !important;
        object-fit: cover !important;
        border-radius: 12px !important;
        display: block !important;
    }

    .trending-poster-overlay {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* ─── DETAILS PANEL: hidden on mobile ───────── */
    .details-panel {
        display: none !important;
    }

    /* ─── BOTTOM NAV SHOW ────────────────────────── */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* ─── PROGRAM PAGE ───────────────────────────── */
    .program-page-main {
        padding: 0 0 80px 0 !important;
        background: #ffffff !important;
    }

    /* Full-bleed banner at the top of screen */
    .new-program-banner-container {
        height: 78vw !important;
        min-height: 310px !important;
        max-height: 420px !important;
        border-radius: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        position: relative !important;
        background: #111;
    }

    .new-program-banner-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .new-program-banner-overlay {
        position: absolute !important;
        inset: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        align-items: flex-start !important;
        padding: 16px 16px 20px 16px !important;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.3) 75%, #ffffff 100%) !important;
        z-index: 10 !important;
    }

    /* Back Button: Solid white pill with pink text & arrow */
    .mobile-back-btn {
        display: inline-flex !important;
        position: absolute !important;
        top: 56px !important;
        left: 16px !important;
        z-index: 25 !important;
        background: #ffffff !important;
        color: #EA005E !important;
        border: none !important;
        border-radius: 30px !important;
        padding: 6px 16px !important;
        font-size: 0.85rem !important;
        font-weight: 800 !important;
        gap: 4px !important;
        align-items: center !important;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    }

    .mobile-back-btn img {
        width: 14px !important;
        height: 14px !important;
        filter: invert(16%) sepia(95%) saturate(7400%) hue-rotate(320deg) brightness(95%) contrast(100%) !important;
    }

    .new-program-title {
        font-size: 2.2rem !important;
        font-weight: 900 !important;
        color: #ffffff !important;
        line-height: 1.1 !important;
        margin-bottom: 12px !important;
        text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7) !important;
    }

    /* Action row: Play + Like + Save + Share in ONE horizontal row */
    .new-program-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .action-row-2 {
        order: 1 !important;
        display: flex !important;
        width: auto !important;
    }

    .action-row-1 {
        order: 2 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        align-items: center !important;
    }

    /* Play button: Big white circle with pink play icon */
    .new-prog-btn-play {
        width: 52px !important;
        height: 52px !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
        cursor: pointer;
        flex-shrink: 0;
        font-size: 0 !important;
        color: transparent !important;
        position: relative !important;
    }

    .new-prog-btn-play span {
        display: none !important;
    }

    .new-prog-btn-play img {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-46%, -50%) !important;
        width: 24px !important;
        height: 24px !important;
        filter: invert(27%) sepia(99%) saturate(4975%) hue-rotate(326deg) brightness(97%) contrast(110%) !important;
        margin: 0 !important;
    }

    /* Circle buttons (Like, Save, Share): White circles with pink icons */
    .new-prog-btn-circle {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
        flex-shrink: 0;
    }

    .new-prog-btn-circle img {
        width: 18px !important;
        height: 18px !important;
        filter: invert(27%) sepia(99%) saturate(4975%) hue-rotate(326deg) brightness(97%) contrast(110%) !important;
    }

    #p-like-count {
        display: none !important;
    }

    /* CONTENT AREA: Season selector + Subcategories + Grid */
    .new-program-content {
        padding: 16px 16px 0 16px !important;
        background: #ffffff !important;
    }

    .season-select-container {
        margin-bottom: 12px !important;
        text-align: left !important;
    }

    .season-select {
        background: #EA005E !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 30px !important;
        padding: 8px 20px !important;
        font-family: 'Montserrat', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 800 !important;
        cursor: pointer;
        box-shadow: 0 3px 10px rgba(234, 0, 94, 0.3) !important;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 14px center !important;
        padding-right: 34px !important;
        width: auto !important;
        display: inline-block !important;
    }

    /* SUBCATEGORY TABS */
    .subcategory-tabs {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 14px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .subcategory-tabs::-webkit-scrollbar {
        display: none;
    }

    .subcategory-tab-btn {
        flex-shrink: 0 !important;
        background: #EA005E !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 30px !important;
        padding: 8px 18px !important;
        font-family: 'Montserrat', sans-serif !important;
        font-size: 0.85rem !important;
        font-weight: 800 !important;
        cursor: pointer;
        opacity: 0.85;
        box-shadow: 0 3px 10px rgba(234, 0, 94, 0.2) !important;
        transition: opacity 0.15s, transform 0.15s;
    }

    .subcategory-tab-btn.active {
        opacity: 1 !important;
        transform: scale(1.02) !important;
        box-shadow: 0 4px 12px rgba(234, 0, 94, 0.4) !important;
    }

    /* EPISODES GRID — 2 columns, pink card style */
    .episodes-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .episode-card {
        border-radius: 14px !important;
        overflow: hidden !important;
        background: #EA005E !important;
        box-shadow: 0 4px 14px rgba(234, 0, 94, 0.22) !important;
        cursor: pointer;
    }

    .episode-thumbnail-container {
        width: 100% !important;
        aspect-ratio: 16/9 !important;
        position: relative;
    }

    .episode-thumbnail {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    .episode-play-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.25);
        display: flex !important;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
    }

    .episode-play-icon-bg {
        width: 32px !important;
        height: 32px !important;
        background: #ffffff !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    .episode-play-icon-bg img {
        width: 14px !important;
        height: 14px !important;
        filter: invert(16%) sepia(95%) saturate(7400%) hue-rotate(320deg) brightness(95%) contrast(100%) !important;
        margin-left: 2px;
    }

    .episode-info {
        padding: 8px 10px 12px 10px !important;
        background: #EA005E !important;
    }

    .episode-title {
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        color: #ffffff !important;
        margin: 0 0 3px 0 !important;
        line-height: 1.2 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .episode-description {
        font-size: 0.68rem !important;
        color: rgba(255, 255, 255, 0.85) !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}