/* Canlı TV — yalnızca #view-live-tv; YouTube (.view-section) kurallarını ezmez */

#view-live-tv.view-section {
    display: none;
}

#view-live-tv.view-section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 6px 12px 72px;
    box-sizing: border-box;
    overflow: hidden;
}

.live-tv-header-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
    min-height: 0;
}

.live-tv-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.live-tv-channel-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

.live-tv-header-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: auto;
    align-items: center;
    flex-shrink: 0;
}

.live-tv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.live-tv-toolbar h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.live-tv-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.live-tv-search {
    width: min(200px, 28vw);
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.85rem;
}

.live-tv-btn {
    padding: 7px 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 176, 32, 0.22);
    color: #ffb020;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.live-tv-btn:hover {
    background: rgba(255, 176, 32, 0.35);
}

.live-tv-status {
    width: 100%;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 8px;
}

.live-tv-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.live-tv-groups-inline {
    flex: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0;
    min-width: 0;
    gap: 6px;
    scrollbar-width: none;
}

.live-tv-groups-inline::-webkit-scrollbar {
    display: none;
}

.live-tv-groups-inline .live-tv-chip {
    padding: 5px 10px;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.live-tv-chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 0.82rem;
}

.live-tv-chip.active {
    background: rgba(255, 176, 32, 0.22);
    border-color: #ffb020;
    color: #ffb020;
}

.live-tv-body {
    display: flex;
    gap: 14px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.live-tv-player-pane {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-tv-channel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 14px;
    margin: 0;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-sizing: border-box;
}

.live-tv-stage {
    position: relative;
    flex: 1;
    min-height: 320px;
    background: #000;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
}

.live-tv-fs-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 12;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.live-tv-fs-btn:hover {
    background: rgba(0, 0, 0, 0.65) !important;
}

.network-indicator--live-tv {
    height: 40px;
    padding: 6px 12px;
    flex-shrink: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.25);
}

.network-indicator--live-tv .net-text {
    font-size: 12px;
    margin-left: 6px;
}

.network-indicator--live-tv .net-bar-1 { height: 5px; }
.network-indicator--live-tv .net-bar-2 { height: 9px; }
.network-indicator--live-tv .net-bar-3 { height: 13px; }
.network-indicator--live-tv .net-bar-4 { height: 17px; }

/* Tam ekran — YouTube sinema modu ile ayni mantik */
#view-live-tv.view-section.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 11000;
    padding: 0 0 var(--menu-island-reserve, 70px);
    background: #0a0a0b;
}

#view-live-tv.is-fullscreen .live-tv-sidebar {
    display: none;
}

#view-live-tv.is-fullscreen .live-tv-header-bar {
    flex-shrink: 0;
    padding: 8px 12px 6px;
    margin-bottom: 4px;
    background: rgba(10, 10, 11, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#view-live-tv.is-fullscreen .live-tv-body {
    flex: 1;
    min-height: 0;
    gap: 0;
}

#view-live-tv.is-fullscreen .live-tv-stage {
    min-height: 0;
    border-radius: 0;
    border: none;
}

#view-live-tv.is-fullscreen .live-tv-channel-bar {
    border-radius: 0;
    min-height: 44px;
    padding: 8px 14px;
    background: rgba(10, 10, 11, 0.94);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#view-live-tv.is-fullscreen .live-tv-display-canvas {
    min-height: 0;
}

#view-live-tv.is-fullscreen .live-tv-version {
    display: none;
}

#view-live-tv.is-fullscreen .live-tv-fs-btn {
    right: 14px;
    bottom: 14px;
}

/* Tesla güvenli katman: canvas (video etiketi yok) */
.live-tv-display-canvas {
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.live-tv-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    padding: 16px;
}

.live-tv-overlay[hidden] {
    display: none !important;
}

.live-tv-overlay.initial-state .spinner {
    display: none;
}

.live-tv-overlay-text {
    font-size: 0.92rem;
    max-width: 90%;
}

.live-tv-now-playing {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    background: none;
    border: none;
    border-radius: 0;
    min-height: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-tv-version {
    margin: 0;
    padding: 0 2px;
    font-size: 0.65rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.32);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-tv-sidebar {
    width: min(252px, 26.6vw);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.live-tv-sidebar-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.live-tv-channel-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.live-tv-channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.live-tv-channel-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.live-tv-channel-row.active {
    border-color: #ffb020;
    background: rgba(255, 176, 32, 0.12);
}

.live-tv-channel-row-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-sizing: border-box;
}

.live-tv-channel-row-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.live-tv-channel-row-ph {
    font-size: 0.65rem;
    opacity: 0.5;
}

.live-tv-channel-row-text {
    flex: 1;
    min-width: 0;
}

.live-tv-channel-row-name {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-tv-channel-row-group {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-tv-loader,
.live-tv-error,
.live-tv-empty {
    padding: 16px 8px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
}

.live-tv-engine-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.35);
    background: rgba(0, 255, 136, 0.08);
}

.live-tv-engine-popover {
    position: fixed;
    z-index: 12000;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-sizing: border-box;
}

.live-tv-engine-popover-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    min-width: 140px;
    background: rgba(16, 16, 20, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 176, 32, 0.35);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.live-tv-engine-opt {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 15px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.live-tv-engine-opt:hover {
    background: rgba(255, 176, 32, 0.12);
    color: #fff;
    border-color: rgba(255, 176, 32, 0.4);
}

.live-tv-engine-opt.is-current {
    color: #ffb020;
    border-color: rgba(255, 176, 32, 0.55);
    background: rgba(255, 176, 32, 0.14);
}

.live-tv-diag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    max-width: min(92%, 420px);
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 176, 32, 0.35);
    color: #e8e8e8;
    font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.live-tv-diag-title {
    font-weight: 700;
    color: #ffb020;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 10px;
}

.live-tv-diag-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.live-tv-diag-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .live-tv-header-bar {
        flex-wrap: wrap;
    }

    .live-tv-header-actions {
        margin-left: 0;
        width: 100%;
    }

    .live-tv-groups-inline {
        order: 3;
        width: 100%;
    }

    .live-tv-body {
        flex-direction: column;
    }

    .live-tv-sidebar {
        width: 100%;
        max-height: 220px;
    }

    .live-tv-stage {
        min-height: 200px;
    }
}
