/* ============================================
   Live TV Player - Premium Dark Theme
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

#live-tv-wrapper {
    font-family: 'Inter', sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    height: 620px;
    max-height: 620px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.06);
}

/* ─── HEADER ─── */
.ltv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #13131f 0%, #1a1a2e 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 16px;
    flex-wrap: wrap;
}

.ltv-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-transform: uppercase;
}

.ltv-icon { font-size: 22px; }

.ltv-live-badge {
    background: linear-gradient(90deg, #e53935, #ff5252);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    animation: ltv-pulse 1.5s ease-in-out infinite;
}

@keyframes ltv-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ltv-search-wrap { flex: 1; max-width: 380px; }

#ltv-search {
    width: 100%;
    padding: 9px 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

#ltv-search::placeholder { color: rgba(255,255,255,0.35); }
#ltv-search:focus {
    border-color: #5c6bc0;
    background: rgba(255,255,255,0.10);
}

/* ─── BODY ─── */
.ltv-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ─── SIDEBAR ─── */
.ltv-sidebar {
    width: 240px;
    min-width: 200px;
    background: #111120;
    border-right: 1px solid rgba(255,255,255,0.07);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.ltv-sidebar::-webkit-scrollbar { width: 4px; }
.ltv-sidebar::-webkit-scrollbar-track { background: transparent; }
.ltv-sidebar::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.ltv-group-header {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #5c6bc0;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 4px;
}

.ltv-group:first-child .ltv-group-header { border-top: none; margin-top: 0; }

.ltv-channel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    min-height: 48px;          /* minimum tap target size (Material Design) */
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 0;
    /* Reset anchor tag defaults */
    text-decoration: none;
    color: inherit;
    user-select: none;         /* cegah selection teks saat double-tap mobile */
    -webkit-tap-highlight-color: rgba(92,107,192,0.25); /* feedback tap di iOS/Android */
    box-sizing: border-box;
}

.ltv-channel:hover { background: rgba(92,107,192,0.15); }
.ltv-channel.active {
    background: linear-gradient(90deg, rgba(92,107,192,0.35), rgba(92,107,192,0.10));
    border-left: 3px solid #5c6bc0;
}

.ltv-ch-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    pointer-events: none;      /* klik selalu diterima parent .ltv-channel */
}

.ltv-ch-no-logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    pointer-events: none;
}

.ltv-ch-name {
    font-size: 13px;
    font-weight: 500;
    color: #d0d0e0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;      /* klik selalu diterima parent .ltv-channel */
}

.ltv-channel.active .ltv-ch-name { color: #fff; }

/* Hidden group when search filters */
.ltv-group.hidden { display: none; }
.ltv-channel.hidden { display: none; }

/* ─── PLAYER AREA ─── */
.ltv-player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d1a;
    padding: 20px;
    gap: 16px;
    overflow: auto;
}

.ltv-player-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#ltv-video {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #000;
    outline: none;
    object-fit: contain;          /* maintain aspect ratio, no stretch */
    will-change: transform;       /* force GPU compositing — reduces interlace combing */
    image-rendering: auto;        /* let browser use best renderer */
    transform: translateZ(0);     /* create GPU layer — smoother rendering on interlaced streams */
}

.ltv-player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.25);
}

.ltv-placeholder-icon { font-size: 60px; opacity: 0.4; }
.ltv-player-placeholder p { font-size: 14px; margin: 0; }

/* ─── LOADER ─── */
.ltv-loader {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.ltv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #5c6bc0;
    border-radius: 50%;
    animation: ltv-spin 0.8s linear infinite;
}

@keyframes ltv-spin { to { transform: rotate(360deg); } }

/* ─── NOW PLAYING BAR ─── */
.ltv-now-playing {
    background: linear-gradient(135deg, #1a1a2e, #13131f);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ltv-np-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#ltv-np-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.ltv-np-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.ltv-np-group {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

.ltv-np-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #ff5252;
    letter-spacing: 1px;
}

.ltv-live-dot {
    width: 8px;
    height: 8px;
    background: #ff5252;
    border-radius: 50%;
    animation: ltv-pulse 1.5s ease-in-out infinite;
}

/* ─── ERROR ─── */
.ltv-error {
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ef9a9a;
    font-size: 13px;
}

.ltv-error p { margin: 0 0 4px; font-weight: 500; }
.ltv-error small { opacity: 0.7; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .ltv-body { flex-direction: column; }

    .ltv-sidebar {
        width: 100%;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .ltv-player-area { padding: 12px; }

    .ltv-header { padding: 12px; }
    .ltv-search-wrap { max-width: 100%; }

    #ltv-video, .ltv-player-container { min-height: 220px; }
}

/* ─── SEO SECTIONS ─── */
.ltv-seo-intro {
    margin-bottom: 20px;
}

.ltv-seo-intro h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a1a2e;
}

.ltv-seo-intro p {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
    margin: 0 0 8px;
}

.ltv-categories-label {
    font-size: 14px !important;
    color: #555 !important;
}

.ltv-seo-info {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.ltv-seo-info h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.ltv-seo-info ol,
.ltv-seo-info ul {
    padding-left: 20px;
    margin: 0 0 20px;
}

.ltv-seo-info li {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.ltv-channel-list-seo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2px 16px;
    list-style: disc;
}

.ltv-channel-list-seo li a {
    color: #666;
    text-decoration: none;
}
.ltv-channel-list-seo li a:hover { color: #e53935; }

/* ═══════════════════════════════════════════════════
   CHANNEL INFO PANEL (virtual channel pages)
   ═══════════════════════════════════════════════════ */
.ltv-info-panel {
    background: rgba(26, 26, 46, 0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
    font-family: 'Inter', sans-serif;
}

/* Breadcrumb */
.ltv-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #666;
    margin-bottom: 16px;
}
.ltv-breadcrumb a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}
.ltv-breadcrumb a:hover { color: #e53935; }
.ltv-breadcrumb span { color: #555; }
.ltv-bc-current {
    color: #aaa;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Title */
.ltv-info-title {
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 900;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.3;
}

/* Badges */
.ltv-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.ltv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}
.ltv-badge svg { width: 12px; height: 12px; }
.ltv-badge-rating {
    background: rgba(234,179,8,0.12);
    color: #facc15;
    border: 1px solid rgba(234,179,8,0.25);
}
.ltv-badge-dark {
    background: rgba(255,255,255,0.08);
    color: #d0d0e0;
    border: 1px solid rgba(255,255,255,0.1);
}
.ltv-badge-divider {
    width: 1px; height: 16px;
    background: rgba(255,255,255,0.15);
}

/* Genre tags */
.ltv-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.ltv-genre-tag {
    background: rgba(255,255,255,0.07);
    color: #c0c0d0;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}
a.ltv-genre-tag:hover {
    background: rgba(229,57,53,0.2);
    color: #ef9a9a;
    border-color: rgba(229,57,53,0.3);
}

/* Action buttons */
.ltv-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.ltv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}
.ltv-btn svg { width: 14px; height: 14px; stroke-width: 2; }
.ltv-btn-default {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.08);
}
.ltv-btn-default:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.15);
}
.ltv-btn-danger {
    background: rgba(229,57,53,0.1);
    color: #ef9a9a;
    border-color: rgba(229,57,53,0.25);
}
.ltv-btn-danger:hover {
    background: rgba(229,57,53,0.22);
    border-color: rgba(229,57,53,0.45);
}

/* Synopsis */
.ltv-synopsis {
    font-size: 14px;
    color: #c0c0d0;
    line-height: 1.7;
    margin-bottom: 8px;
}
.ltv-synopsis-sub {
    font-size: 12px;
    color: #777;
    line-height: 1.7;
    margin: 0 0 16px;
}

/* Expandable detail */
.ltv-detail-collapsed {
    display: none;
    padding-top: 12px;
}
.ltv-detail-collapsed.ltv-detail-open { display: block; }

.ltv-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin-bottom: 12px;
}
.ltv-detail-grid p { font-size: 13px; color: #c0c0d0; margin: 0; }
.ltv-detail-label { color: #888; }
.ltv-detail-link { color: #facc15; text-decoration: none; }
.ltv-detail-link:hover { color: #fde68a; }
.ltv-detail-logo {
    width: 64px;
    border-radius: 8px;
    margin-top: 8px;
}

/* Show more toggle */
.ltv-toggle-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #facc15;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 6px;
    transition: color 0.2s;
    font-family: inherit;
}
.ltv-toggle-detail:hover { color: #fde68a; }

/* Additional links */
.ltv-additional-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.ltv-additional-links h4 {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 10px;
    font-style: italic;
}
.ltv-add-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.ltv-add-link-list a {
    font-size: 11px;
    font-weight: 700;
    color: #777;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}
.ltv-add-link-list a:hover { color: #e53935; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ltv-info-panel { padding: 16px; border-radius: 10px; }
    .ltv-detail-grid { grid-template-columns: 1fr; }
    .ltv-action-btns .ltv-btn { font-size: 12px; padding: 7px 12px; }
}
