/* ===================================================
   Channel Drawer Modal
   channel-drawer.css — channel-specific styles only.
   Modal shell (overlay, width, header, content, responsive)
   is inherited from view-plan-drawer.css via .plan-drawer.
   =================================================== */

/* ===================================================
   Video-first drawer shell (channel + show)
   Drawer width/height follow the hero aspect ratio so the
   panel does not dwarf a small centered video.
   =================================================== */
.plan-drawer.channel-drawer,
.plan-drawer.show-drawer {
    --drawer-shell-h-pad: calc(2 * var(--spacing-xxl));
    --drawer-hero-max-height: calc(100dvh - 220px);
    --drawer-hero-inner-width: min(
        calc(100vw - 64px),
        calc(var(--drawer-hero-max-height) * 16 / 9)
    );
    width: min(
        calc(100vw - 40px),
        calc(var(--drawer-hero-inner-width) + var(--drawer-shell-h-pad))
    );
    min-width: min(100%, 320px);
    height: auto;
    max-height: calc(100dvh - 40px);
    border-top-left-radius: var(--radius-large);
    border-top-right-radius: var(--radius-large);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.plan-drawer.channel-drawer .drawer-content,
.plan-drawer.show-drawer .drawer-content {
    flex: 1 1 auto;
    min-height: 0;
}

.plan-drawer.channel-drawer:has(.channel-drawer-hero-bg.portrait),
.plan-drawer.show-drawer:has(.channel-drawer-hero-bg.portrait) {
    --drawer-hero-inner-width: min(
        calc(100vw - 32px),
        calc(min(45dvh, var(--drawer-hero-max-height)) * 9 / 16)
    );
}

@media (max-width: 768px) {
    .plan-drawer.channel-drawer,
    .plan-drawer.show-drawer {
        --drawer-shell-h-pad: calc(2 * var(--spacing-lg));
        --drawer-hero-max-height: calc(100dvh - 196px);
    }
}

@media (max-width: 576px) {
    .plan-drawer.channel-drawer,
    .plan-drawer.show-drawer {
        --drawer-hero-max-height: calc(100dvh - 180px);
        --drawer-hero-inner-width: min(
            calc(100vw - 32px),
            calc(min(45dvh, var(--drawer-hero-max-height)) * 9 / 16)
        );
        width: min(calc(100vw - 16px), calc(var(--drawer-hero-inner-width) + var(--drawer-shell-h-pad)));
    }
}

/* ===================================================
   Hero Banner
   =================================================== */
.channel-drawer-hero {
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.channel-drawer-hero-bg {
    position: relative;
    width: 100%;
    max-height: var(--drawer-hero-max-height);
    aspect-ratio: 16 / 9;
    min-height: 140px;
    background: #111;
    border-radius: 24px;
    overflow: hidden;
}

/* Hide title/details overlay (and bottom gradient) while video is playing */
.channel-drawer-hero-bg.is-playing .channel-drawer-hero-info {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.channel-drawer-hero-bg.is-playing::after {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Portrait aspect ratio for mobile — applied via JS on small screens; also enforced via media query */
.channel-drawer-hero-bg.portrait {
    aspect-ratio: 9 / 16;
    max-height: min(45dvh, var(--drawer-hero-max-height));
}

@media (max-width: 576px) {
    .channel-drawer-hero-bg {
        aspect-ratio: 9 / 16;
        max-height: min(45dvh, var(--drawer-hero-max-height));
    }

    .channel-drawer-hero-bg.portrait {
        max-height: min(45dvh, var(--drawer-hero-max-height));
    }
}

.channel-drawer-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    border-radius: 24px;
}

.channel-drawer-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
    border-radius: 24px;
}

/* Dark gradient so bottom text is readable over the image */
.channel-drawer-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Play button centred over the hero image */
.channel-drawer-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.channel-drawer-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.9;
}

/* Channel name + details pinned to bottom-left of hero */
.channel-drawer-hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    z-index: 4;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .channel-drawer-hero-info {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        padding: var(--spacing-md);
        gap: var(--spacing-xs);
    }

    /* Logo comes first (above name) on mobile */
    .channel-drawer-hero-logo {
        order: -1;
    }

    .channel-drawer-hero-meta {
        order: 0;
    }
}

.channel-drawer-hero-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.channel-drawer-hero-name {
    color: var(--white);
    font-family: var(--font-family-body);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.2;
}

.channel-drawer-hero-details {
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-family-body);
    font-size: 0.875rem;
}

/* Channel logo badge — white card bottom-right of hero */
.channel-drawer-hero-logo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: var(--white);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.channel-drawer-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Remove the gradient border outline that .content-section::before applies
   from view-plan-drawer.css — we only want it on Show Schedule */
.channel-drawer .content-section::before {
    display: none;
}

/* ===================================================
   Featured Shows Swimlane
   =================================================== */
.featured-content {
 padding: 0;
}

.channel-drawer-shows {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.channel-drawer-shows::-webkit-scrollbar {
    display: none;
}

/* Card — image fills the container, label overlaid at bottom */
.channel-drawer-show-card {
    flex-shrink: 0;
    width: 200px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px;
    box-sizing: border-box;
}

/* Image fills entire card */
.channel-drawer-show-card .card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.channel-drawer-show-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Bottom gradient overlay */
.channel-drawer-show-card .card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.82) 100%);
    pointer-events: none;
}

/* Show title pinned to bottom */
.channel-drawer-show-card .card-label {
    position: relative;
    z-index: 1;
    color: var(--white);
    font-family: var(--font-family-body);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

@media (max-width: 576px) {
    .channel-drawer-show-card {
        width: 130px;
        height: 82px;
    }
}

/* ===================================================
   Show Schedule
   =================================================== */
.channel-schedule {
    border-radius: var(--radius-large);
    background: var(--white);
    padding: 24px 32px 32px 32px;
    overflow: hidden;
}

.channel-schedule-title {
    font-family: var(--font-family-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-lg) 0;
}

.channel-schedule-tabs {
    display: flex;
    justify-content: space-around;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 32px;
}

.channel-schedule-tabs::-webkit-scrollbar {
    display: none;
}

.channel-schedule-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-family-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #aaa;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.channel-schedule-tab:hover {
    color: var(--primary-red);
}

.channel-schedule-tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}

.channel-schedule-body {
    margin-top: 0;
}

.channel-schedule-date-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: #f5f5f5;
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative;
}

.channel-schedule-timezone {
    font-family: var(--font-family-body);
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.channel-schedule-date {
    font-family: var(--font-family-body);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.channel-schedule-live-bar {
    display: block;
    width: 4px;
    align-self: stretch;
    background: var(--primary-red);
    border-radius: 2px;
    flex-shrink: 0;
}

.channel-schedule-rows {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.channel-schedule-rows::-webkit-scrollbar {
    width: 4px;
}

.channel-schedule-rows::-webkit-scrollbar-track {
    background: transparent;
}

.channel-schedule-rows::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.channel-schedule-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid #f0f0f0;
}

.channel-schedule-row:last-child {
    border-bottom: none;
}

.channel-schedule-row-time {
    font-family: var(--font-family-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    min-width: 44px;
}

.channel-schedule-row-show {
    font-family: var(--font-family-body);
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* ===================================================
   Responsive
   =================================================== */
@media (max-width: 576px) {
    .channel-drawer-hero-logo {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .channel-drawer-hero-name {
        font-size: 0.9375rem;
    }

    .channel-drawer-hero-details {
        font-size: 0.75rem;
    }

    .channel-drawer-show-card {
        width: 130px;
        height: 82px;
    }

    .channel-schedule {
        padding: var(--spacing-md);
    }

    .channel-schedule-title {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-md);
    }

    .channel-schedule-tab {
        padding: var(--spacing-sm) var(--spacing-sm);
        font-size: 0.75rem;
        min-width: 40px;
        text-align: center;
    }

    .channel-available-group {
        padding: var(--spacing-md);
    }

    .channel-footer-hint {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .channel-footer-hint p {
        text-align: center;
    }

    .channel-footer-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .channel-footer-buttons .footer-button {
        width: 100%;
        font-size: 0.9375rem;
    }
}

/* ===================================================
   Available On Section
   =================================================== */
.channel-available-section {
    background: transparent !important;
}

.channel-available-section::before {
    display: none !important;
}

.channel-available {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: 0;
}

.channel-available-title {
    font-family: var(--font-family-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.channel-available-subtitle {
    font-family: var(--font-family-body);
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    margin-top: calc(-1 * var(--spacing-sm));
}

/* Each bordered group card */
.channel-available-group {
    border-radius: var(--radius-large);
    background: var(--white);
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.channel-available-group-label {
    font-family: var(--font-family-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ===================================================
   You Might Also Be Interested In
   =================================================== */
.channel-also-interested {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.channel-also-interested-title {
    font-family: var(--font-family-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Horizontal drag-scroll carousel of genre-movies-box cards */
.channel-also-interested-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.channel-also-interested-grid::-webkit-scrollbar {
    display: none;
}

/* ===================================================
   Drawer Footer (channel variant)
   =================================================== */
.channel-drawer-footer {
    flex-direction: column;
    gap: var(--spacing-sm);
}

.channel-footer-hint {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.channel-footer-hint p {
    font-family: var(--font-family-body);
    font-size: 0.75rem;
    color: #888;
    margin: 0;
    flex: 1;
    text-align: center;
}

.channel-footer-buttons {
    display: flex;
    gap: var(--spacing-lg);
    width: 100%;
}

.channel-footer-buttons .footer-button {
    flex: 1;
    font-size: 1rem;
    gap: var(--spacing-sm);
}

/* ===================================================
   Mobile Plan Swimlane Cards (≤768px)
   Image fills card top, plan name label at bottom
   =================================================== */
.channel-plan-swimlane {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    cursor: grab;
}

.channel-plan-swimlane::-webkit-scrollbar {
    display: none;
}

.channel-plan-card {
    flex-shrink: 0;
    width: 115px;
    height: 100px;
    border-radius: var(--radius-medium);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.channel-plan-card-img {
    width: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.channel-plan-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.channel-plan-card-label {
    background: var(--clr-bg-quaternary, linear-gradient(90deg, #F83947 0%, #FD9100 100%));
    color: var(--white, #fff);
    font-family: var(--font-family-body);
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: left;
    padding: 8px var(--spacing-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================================
   Apps Swimlane (all viewports)
   =================================================== */
.channel-apps-swimlane {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    cursor: grab;
}

.channel-apps-swimlane::-webkit-scrollbar {
    display: none;
}

/* Keep app cards a consistent fixed width inside the swimlane */
.channel-apps-swimlane .sr-app-card-border {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .channel-drawer .channel-apps-swimlane .sr-app-card-border {
        width: 115px;
        height: 100px;
    }

    .channel-drawer .channel-apps-swimlane .sr-app-card {
        height: 100%;
    }

    .channel-drawer .channel-apps-swimlane .sr-app-card-logo-wrap {
        flex: 1;
        min-height: 0;
        padding: 10px 8px;
    }

    .channel-drawer .channel-apps-swimlane .sr-app-card-logo {
        height: 28px;
        max-width: 100%;
    }

    .channel-drawer .channel-apps-swimlane .sr-app-card-footer {
        padding: 8px var(--spacing-sm);
    }

    .channel-drawer .channel-apps-swimlane .sr-app-card-name {
        font-family: var(--font-family-body);
        font-size: 0.8125rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

