/* 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: 8px 16px 96px;
    box-sizing: border-box;
    overflow: hidden;
}

.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(280px, 42vw);
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.9rem;
}

.live-tv-btn {
    padding: 9px 14px;
    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-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: 8px;
}

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

/* Tesla güvenli katman: canvas (video etiketi yok) */
.live-tv-display-canvas {
    width: 100%;
    height: 100%;
    min-height: 240px;
    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: 8px 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 1.1em;
}

.live-tv-sidebar {
    width: min(360px, 38vw);
    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: 48px;
    height: 48px;
    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-version {
    margin-top: 6px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.32);
    flex-shrink: 0;
}

.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);
}

@media (max-width: 900px) {
    .live-tv-body {
        flex-direction: column;
    }

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

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