/* ==========================================================================
   AXCAST LIVE TV 3-PANE IPTV DASHBOARD & AD-OPTIMIZED HUB
   ========================================================================== */

.iptv-hub-wrapper {
    width: 100%;
    margin-top: 14px;
}

/* ── Top Ad Leaderboard (728x90 / fluid) ─────────────────────────────────── */
.iptv-ad-top {
    width: 100%;
    margin-bottom: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.iptv-ad-top:empty,
.iptv-ad-top:has(.ax-ad-zone--collapsed) {
    display: none;
    margin: 0;
}

/* ── After-Player Banner Ad (728x90 / responsive) ────────────────────────── */
.iptv-ad-after-player {
    width: 100%;
    margin: 14px 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.iptv-ad-after-player:empty,
.iptv-ad-after-player:has(.ax-ad-zone--collapsed),
.iptv-ad-after-player.is-collapsed {
    display: none;
    margin: 0;
}

/* ── IPTV 3-Column Master Layout ─────────────────────────────────────────── */
.iptv-layout {
    display: grid;
    grid-template-columns: 240px 380px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (max-width: 1280px) {
    .iptv-layout {
        grid-template-columns: 210px 330px minmax(0, 1fr);
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .iptv-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .iptv-pane-stage {
        order: 1;
        width: 100%;
    }
    .iptv-pane-cats {
        order: 2;
        width: 100%;
        position: static;
        max-height: none;
        padding: 12px;
    }
    .iptv-cat-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .iptv-cat-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .iptv-pane-channels {
        order: 3;
        width: 100%;
        min-height: auto;
    }
    .iptv-channel-stream {
        max-height: 480px;
    }
}

/* ── Pane 1: Categories Sidebar (Left) ───────────────────────────────────── */
.iptv-pane-cats {
    background: #0b111e;
    border: 1px solid #1c273c;
    border-radius: 14px;
    padding: 16px 14px;
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.iptv-cats-title {
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e5e9f0;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iptv-cats-title i {
    color: #ff2638;
}

.iptv-cat-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
}

.iptv-cat-nav::-webkit-scrollbar {
    width: 4px;
}
.iptv-cat-nav::-webkit-scrollbar-thumb {
    background: #25334c;
    border-radius: 4px;
}

.iptv-cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid transparent;
    color: #9aa8bd;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.16s ease;
    cursor: pointer;
}

.iptv-cat-btn:hover {
    color: #ffffff;
    background: #141d2f;
    border-color: rgba(255, 255, 255, 0.08);
}

.iptv-cat-btn.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 38, 56, 0.22) 0%, rgba(232, 0, 24, 0.08) 100%);
    border-color: #ff2638;
    box-shadow: 0 4px 16px rgba(255, 38, 56, 0.18);
}

.iptv-cat-btn .badge-cnt {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: #151e30;
    color: #79879c;
    border: 1px solid #202b3f;
}

.iptv-cat-btn.is-active .badge-cnt {
    background: #ff2638;
    color: #ffffff;
    border-color: #ff2638;
}

/* ── Pane 2: Channel Drawer (Center) ─────────────────────────────────────── */
.iptv-pane-channels {
    background: #0b111e;
    border: 1px solid #1c273c;
    border-radius: 14px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    min-height: 650px;
}

.iptv-channels-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.iptv-channels-head strong {
    font-size: 15px;
    font-weight: 900;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.iptv-search-box {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.iptv-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-size: 13px;
}

.iptv-search-box input {
    width: 100%;
    height: 38px;
    border-radius: 9px;
    background: #111a2a;
    border: 1px solid #223047;
    padding: 0 12px 0 36px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: all 0.16s ease;
}

.iptv-search-box input:focus {
    border-color: #ff2638;
    box-shadow: 0 0 0 3px rgba(255, 38, 56, 0.14);
}

.iptv-channel-stream {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 4px;
}

.iptv-channel-stream::-webkit-scrollbar {
    width: 5px;
}
.iptv-channel-stream::-webkit-scrollbar-thumb {
    background: #25334c;
    border-radius: 5px;
}

.iptv-pane-channels .iptv-ch-card,
.iptv-channel-stream .iptv-ch-card {
    min-width: 0;
    min-height: 56px;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #101826;
    border: 1px solid #1f2c41;
    color: #d6deeb;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.16s ease;
    position: relative;
    text-align: left;
}

.iptv-pane-channels .iptv-ch-card:hover,
.iptv-channel-stream .iptv-ch-card:hover {
    background: #162135;
    border-color: rgba(255, 38, 56, 0.45);
    transform: translateX(3px);
}

.iptv-pane-channels .iptv-ch-card.is-active,
.iptv-channel-stream .iptv-ch-card.is-active {
    background: linear-gradient(90deg, #1b1622 0%, #151d2f 100%);
    border-color: #ff2638;
    box-shadow: inset 3px 0 0 #ff2638, 0 4px 18px rgba(255, 38, 56, 0.15);
}

.iptv-pane-channels .iptv-ch-logo,
.iptv-channel-stream .iptv-ch-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: #090e17;
    border: 1px solid #202b3e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.iptv-pane-channels .iptv-ch-logo img,
.iptv-channel-stream .iptv-ch-logo img {
    width: 86%;
    height: 86%;
    object-fit: contain;
}

.iptv-pane-channels .iptv-ch-logo i,
.iptv-channel-stream .iptv-ch-logo i {
    color: #ff2638;
    font-size: 18px;
}

.iptv-pane-channels .iptv-ch-meta,
.iptv-channel-stream .iptv-ch-meta {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.iptv-pane-channels .iptv-ch-name,
.iptv-channel-stream .iptv-ch-name {
    font-size: 13px;
    font-weight: 850;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    text-align: left;
}

.iptv-pane-channels .iptv-ch-cat,
.iptv-channel-stream .iptv-ch-cat {
    font-size: 11px;
    font-weight: 600;
    color: #7b8ba1;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.iptv-pane-channels .iptv-ch-status,
.iptv-channel-stream .iptv-ch-status {
    flex-shrink: 0;
    margin-left: auto;
}

.iptv-ch-status .live-tag {
    font-size: 9px;
    font-weight: 950;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 38, 56, 0.15);
    color: #ff2638;
    border: 1px solid rgba(255, 38, 56, 0.35);
    letter-spacing: 0.04em;
}

.iptv-ch-card.is-active .live-tag {
    background: #ff2638;
    color: #ffffff;
    border-color: #ff2638;
    box-shadow: 0 0 10px rgba(255, 38, 56, 0.5);
}

/* ── Pane 3: Video Player & Side Deck (Right) ────────────────────────────── */
.iptv-pane-stage {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.iptv-player-container {
    width: 100%;
    background: #090e17;
    border: 1px solid #1c273c;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.iptv-now-bar {
    padding: 12px 16px;
    background: #0e1524;
    border-top: 1px solid #1b263b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.iptv-now-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.iptv-now-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #111a2b;
    border: 1px solid #243247;
    padding: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.iptv-now-text {
    min-width: 0;
}

.iptv-now-title {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.iptv-now-sub {
    font-size: 11.5px;
    font-weight: 600;
    color: #8c9cb3;
    margin-top: 2px;
}

.iptv-now-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Under-Player Panels (EPG & Live Chat & Sidebar Ad) ───────────────────── */
.iptv-stage-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
    width: 100%;
}

.iptv-stage-lower:has(.iptv-sticky-ad:empty),
.iptv-stage-lower:has(.iptv-sticky-ad.is-collapsed),
.iptv-stage-lower:has(.iptv-sticky-ad:has(.ax-ad-zone--collapsed)) {
    grid-template-columns: 1fr;
}

@media (max-width: 860px) {
    .iptv-stage-lower {
        grid-template-columns: 1fr;
    }
}

.iptv-tab-panel {
    background: #0b111e;
    border: 1px solid #1c273c;
    border-radius: 12px;
    overflow: hidden;
}

.iptv-tab-header {
    display: flex;
    border-bottom: 1px solid #1c273c;
    background: #090e17;
}

.iptv-tab-btn {
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 850;
    color: #8b99ad;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.iptv-tab-btn:hover {
    color: #ffffff;
}

.iptv-tab-btn.is-active {
    color: #ff2638;
    border-bottom-color: #ff2638;
    background: rgba(255, 38, 56, 0.05);
}

.iptv-tab-content {
    padding: 16px;
}

.iptv-sticky-ad {
    background: #0b111e;
    border: 1px solid #1c273c;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 250px;
}

.iptv-sticky-ad:empty,
.iptv-sticky-ad.is-collapsed,
.iptv-sticky-ad:has(.ax-ad-zone--collapsed) {
    display: none;
}

.iptv-ad-label {
    font-size: 10px;
    font-weight: 800;
    color: #5d6d84;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    align-self: flex-start;
}
