/*
 * ============================================================
 * HNTV LIVE TV — CLEAN PLAYER UI
 * SINGLE VIDEO / SINGLE HLS / SINGLE DVR
 * ============================================================
 */

.mobile-live {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 14px 100px;
    box-sizing: border-box;
}

.live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.live-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-title > i {
    flex: 0 0 auto;
    font-size: 24px;
}

.live-title h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.live-title span {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    opacity: .7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 11px;
    font-weight: 700;
}

/* ============================================================
   PLAYER
   ============================================================ */

.live-player-section {
    width: 100%;
    margin: 0 0 16px;
}

.live-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
    isolation: isolate;
}

.live-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* ============================================================
   CENTER PLAY
   ============================================================ */

.hntv-center-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;

    width: 60px;
    height: 60px;
    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    transform: translate(-50%, -50%);

    background: rgba(0,0,0,.65);
    color: #fff;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .18s ease,
        visibility .18s ease,
        transform .18s ease;
}

/*
 * ============================================================
 * HNTV PLAYER — CENTER VISIBILITY CONTROLLED BY JS
 * ============================================================
 *
 * CENTER PLAY / PAUSE tidak lagi dikendalikan oleh:
 *
 *   :hover
 *   :focus-within
 *   .is-paused
 *
 * Visibility center button harus mengikuti controller JS
 * yang sama dengan control bawah.
 *
 * JS:
 *   is-visible -> tampil
 *   is-hidden  -> hilang
 * ============================================================
 */

.hntv-center-play.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hntv-center-play.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.hntv-center-play.is-visible.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ============================================================
   CONTROL BAR
   ============================================================ */

.hntv-tv-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 20;

    padding: 30px 14px 11px;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,.94) 0%,
            rgba(0,0,0,.72) 38%,
            rgba(0,0,0,.28) 72%,
            transparent 100%
        );

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}

/*
 * JS boleh menyembunyikan control.
 * Tetapi kondisi awal TETAP terlihat.
 */
.hntv-tv-controls.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/*
 * is-visible hanya untuk menampilkan control.
 * is-hidden memiliki prioritas lebih tinggi.
 */
.hntv-tv-controls.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hntv-tv-controls.is-visible.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ============================================================
   DVR TIMELINE
   ============================================================ */

.hntv-tv-progress-wrap {
    width: 100%;
    padding: 6px 0 8px;
}

.hntv-tv-progress {
    display: block;

    width: 100%;
    height: 6px;

    margin: 0;
    padding: 0;

    appearance: none;
    -webkit-appearance: none;

    border: 0;
    border-radius: 999px;

    background: rgba(255,255,255,.25);

    cursor: pointer;
    touch-action: none;
}

.hntv-tv-progress::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
}

.hntv-tv-progress::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
}

.hntv-tv-progress::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 14px;
    height: 14px;

    margin-top: -4px;

    border: 0;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
}

.hntv-tv-progress::-moz-range-thumb {
    width: 14px;
    height: 14px;

    border: 0;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
}

/* ============================================================
   CONTROL BUTTON ROW
   ============================================================ */

.hntv-tv-control-row {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 40px;

    gap: 5px;
}

.hntv-tv-button,
.hntv-tv-live {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

/*
 * ============================================================
 * HNTV LIVE BUTTON — PLAY / PAUSE COLOR
 * ============================================================
 *
 * PLAY + LIVE  = titik merah
 * PAUSE + LIVE = titik abu/putih
 *
 * Tulisan LIVE selalu putih.
 * ============================================================
 */

.hntv-tv-live {
    color: #fff;
}

.hntv-tv-live .hntv-live-dot {
    background: rgba(255,255,255,.60);
    transition:
        background .18s ease,
        box-shadow .18s ease;
}

/*
 * Saat benar-benar PLAY dan berada di LIVE.
 */
.hntv-tv-live.is-live.is-playing .hntv-live-dot {
    background: #f00;
    box-shadow: 0 0 7px rgba(255,0,0,.75);
}

/*
 * Saat PAUSE meskipun posisi masih LIVE.
 */
.hntv-tv-live.is-live:not(.is-playing) .hntv-live-dot {
    background: rgba(255,255,255,.70);
    box-shadow: none;
}

.hntv-tv-button {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    padding: 0;

    display: grid;
    place-items: center;

    border-radius: 8px;

    font-size: 20px;
}

.hntv-tv-button:hover {
    background: rgba(255,255,255,.12);
}

.hntv-tv-button:active {
    background: rgba(255,255,255,.20);
    transform: scale(.94);
}

.hntv-tv-back {
    font-size: 17px;
}

/* ============================================================
   LIVE BUTTON
   ============================================================ */

.hntv-tv-live {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    min-height: 30px;

    margin-left: auto;
    padding: 0 9px;

    border-radius: 7px;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2px;

    opacity: .55;
}

.hntv-tv-live.is-live {
    opacity: 1;
    color: #fff;
    background: #e11;
    border-color: #e11;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, .18);
}

.hntv-tv-live.is-live .hntv-live-dot {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.hntv-live-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background: #e11;
    box-shadow: 0 0 0 3px rgba(255,0,0,.14);
}

.hntv-tv-fullscreen {
    margin-left: 2px;
}

/* ============================================================
   BUFFERING
   ============================================================ */

.hntv-tv-buffering {
    position: absolute;

    left: 50%;
    top: 50%;

    z-index: 30;

    display: flex;

    gap: 5px;

    transform: translate(-50%, -50%);
}

.hntv-tv-buffering[hidden] {
    display: none !important;
}

.hntv-tv-buffering span {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #fff;

    animation: hntvBuffer .9s infinite ease-in-out;
}

.hntv-tv-buffering span:nth-child(2) {
    animation-delay: .15s;
}

.hntv-tv-buffering span:nth-child(3) {
    animation-delay: .30s;
}

@keyframes hntvBuffer {
    0%, 80%, 100% {
        opacity: .25;
        transform: scale(.7);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================
   CHANNEL INFO
   ============================================================ */

.live-info {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 0 0 16px;
    padding: 12px;

    border-radius: 10px;

    background: rgba(255,255,255,.05);
}

.live-channel-icon {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 9px;

    background: rgba(255,255,255,.08);
}

.live-channel-icon img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.live-channel-info {
    min-width: 0;
}

.live-channel-info strong {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-channel-info span {
    display: block;

    margin-top: 3px;

    font-size: 12px;
    opacity: .65;
}

/* ============================================================
   ERROR
   ============================================================ */

.live-error {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 14px;
    padding: 10px 12px;

    border-radius: 9px;

    background: rgba(220,40,40,.12);

    font-size: 13px;
}

/* ============================================================
   CHANNEL PICKER
   ============================================================ */

.live-channel-picker {
    width: 100%;
}

.live-channel-picker-title {
    margin: 0 0 10px;
    font-size: 17px;
}

.live-channels {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(145px, 1fr));

    gap: 9px;
}

.live-channel-btn {
    min-width: 0;

    padding: 9px;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;

    background: rgba(255,255,255,.04);
    color: inherit;

    cursor: pointer;
    text-align: left;

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.live-channel-btn:hover {
    background: rgba(255,255,255,.07);
}

.live-channel-btn:active {
    transform: scale(.98);
}

.live-channel-btn.active {
    border-color: rgba(255,255,255,.42);
    background: rgba(255,255,255,.10);
}

.live-channel-btn img {
    display: block;

    width: 100%;
    height: 70px;

    object-fit: contain;

    margin-bottom: 7px;

    border-radius: 7px;

    background: #000;
}

.live-channel-btn > i {
    display: grid;
    place-items: center;

    width: 100%;
    height: 70px;

    margin-bottom: 7px;

    border-radius: 7px;

    background: rgba(255,255,255,.06);

    font-size: 25px;
}

.live-channel-btn span {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 13px;
}

.live-no-channel {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 6px;

    padding: 35px 15px;

    text-align: center;

    border-radius: 10px;

    background: rgba(255,255,255,.04);
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .mobile-live {
        padding: 8px 8px 90px;
    }

    .live-header {
        margin-bottom: 9px;
    }

    .live-title {
        gap: 8px;
    }

    .live-title > i {
        font-size: 21px;
    }

    .live-title h1 {
        font-size: 19px;
    }

    .live-title span {
        font-size: 12px;
    }

    .live-status {
        padding: 4px 7px;
        font-size: 10px;
    }

    .live-player {
        border-radius: 8px;
    }

    .hntv-tv-controls {
        padding: 28px 7px 7px;
    }

    .hntv-tv-control-row {
        min-height: 36px;
        gap: 3px;
    }

    .hntv-tv-button {
        flex-basis: 34px;

        width: 34px;
        height: 34px;

        font-size: 18px;
    }

    .hntv-tv-back {
        font-size: 15px;
    }

    .hntv-tv-live {
        min-height: 29px;
        padding: 0 7px;
        font-size: 10px;
    }

    .hntv-center-play {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }

    .hntv-tv-progress {
        height: 7px;
    }

    .hntv-tv-progress::-webkit-slider-runnable-track {
        height: 7px;
    }

    .hntv-tv-progress::-moz-range-track {
        height: 7px;
    }

    .live-channels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .live-channel-btn {
        padding: 7px;
    }

    .live-channel-btn img,
    .live-channel-btn > i {
        height: 58px;
    }
}

/* ============================================================
   HNTV — DENS TV STYLE CHANNEL GRID
   ============================================================ */

.live-channels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.live-channel-btn {
    min-width: 0;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 3px;
    background: #111;
    color: inherit;
    cursor: pointer;
    text-align: left;

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .12s ease;
}

.live-channel-btn:hover {
    background: #171717;
}

.live-channel-btn:active {
    transform: scale(.985);
}

.live-channel-btn.active {
    border-color: rgba(255,255,255,.45);
    background: #171717;
}

.live-channel-btn img,
.live-channel-btn > i {
    display: block;

    width: 100%;
    height: 62px;

    margin: 0 0 5px;

    border-radius: 2px;
    background: #fff;
}

.live-channel-btn img {
    object-fit: contain;
}

.live-channel-btn > i {
    display: grid;
    place-items: center;

    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);

    font-size: 24px;
}

.live-channel-btn span {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    padding: 0 2px;

    font-size: 11px;
    line-height: 16px;
}

/* HP kecil */
@media (max-width: 899px) {

    .live-channels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .live-channel-btn {
        padding: 5px;
        border-radius: 3px;
    }

    .live-channel-btn img,
    .live-channel-btn > i {
        height: 58px;
        margin-bottom: 4px;
    }

    .live-channel-btn span {
        font-size: 11px;
        line-height: 15px;
    }
}

/* ============================================================
   DESKTOP
   ============================================================ */

@media (min-width: 900px) {

    .live-player {
        border-radius: 14px;
    }

    .live-channel-btn img,
    .live-channel-btn > i {
        height: 90px;
    }
}

/* ============================================================
   FULLSCREEN
   ============================================================ */

.live-player:fullscreen {
    width: 100vw;
    height: 100vh;

    aspect-ratio: auto;

    border-radius: 0;
}

.live-player:fullscreen .live-video {
    width: 100%;
    height: 100%;
}

.live-player:fullscreen .hntv-tv-controls {
    padding-left: 18px;
    padding-right: 18px;
}


/* ============================================================
   HNTV LIVE BUTTON — FINAL TRANSPARENT STYLE
   ============================================================ */

/*
 * Tombol LIVE sendiri TIDAK mempunyai background.
 * Yang berwarna hanya titik indikator.
 */
.hntv-tv-live,
.hntv-tv-live.is-live {
    background: transparent !important;
    background-color: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
}

/*
 * PLAY + LIVE
 * Hanya titik yang merah.
 */
.hntv-tv-live.is-live.is-playing .hntv-live-dot {
    background: #f00 !important;
    box-shadow: 0 0 7px rgba(255,0,0,.75);
}

/*
 * PAUSE + LIVE
 * Titik berubah abu/putih.
 */
.hntv-tv-live.is-live:not(.is-playing) .hntv-live-dot {
    background: rgba(255,255,255,.70) !important;
    box-shadow: none !important;
}

/*
 * Pastikan tulisan LIVE selalu putih.
 */
.hntv-tv-live > span:last-child {
    color: #fff !important;
}


/* ============================================================
   HNTV LIVE — DOT + RED PROGRESS BAR FINAL
   ============================================================ */

/*
 * ============================================================
 * LIVE DOT
 * ============================================================
 *
 * Sedikit diperbesar agar lebih jelas di HP.
 */
.hntv-tv-live .hntv-live-dot {
    width: 10px !important;
    height: 10px !important;

    min-width: 10px;
    min-height: 10px;

    border-radius: 50%;

    display: inline-block;

    background: rgba(255,255,255,.70);
}

/*
 * PLAY + LIVE
 */
.hntv-tv-live.is-live.is-playing .hntv-live-dot {
    background: #f00 !important;
    box-shadow: 0 0 7px rgba(255,0,0,.75);
}

/*
 * PAUSE + LIVE
 */
.hntv-tv-live.is-live:not(.is-playing) .hntv-live-dot {
    background: rgba(255,255,255,.75) !important;
    box-shadow: none;
}

/*
 * ============================================================
 * DVR PROGRESS BAR
 * ============================================================
 *
 * Bagian yang sudah dilewati = MERAH
 * Bagian yang belum dilewati = ABU/PUTIH
 *
 * Persentase dikirim dari JavaScript melalui:
 *
 *     --hntv-progress-percent
 *
 */
.hntv-tv-progress {
    background:
        linear-gradient(
            to right,
            #f00 0%,
            #f00 var(--hntv-progress-percent, 100%),
            rgba(255,255,255,.28) var(--hntv-progress-percent, 100%),
            rgba(255,255,255,.28) 100%
        ) !important;
}

/*
 * WebKit / Chrome / Android
 *
 * Track dibuat transparan agar gradient di atas terlihat.
 */
.hntv-tv-progress::-webkit-slider-runnable-track {
    background: transparent !important;
}

/*
 * Firefox
 */
.hntv-tv-progress::-moz-range-track {
    background: transparent !important;
}

/*
 * Firefox — bagian progress.
 */
.hntv-tv-progress::-moz-range-progress {
    background: #f00 !important;
}

/*
 * Thumb tetap putih agar kontras dengan bar merah.
 */
.hntv-tv-progress::-webkit-slider-thumb {
    background: #fff !important;
}

.hntv-tv-progress::-moz-range-thumb {
    background: #fff !important;
}



/* ============================================================
   HNTV — HIDE LIVE ERROR BOX
   ============================================================
   Pesan "Live TV tidak dapat diputar" dihilangkan TOTAL.
   Tidak menyisakan background maupun ruang kosong.
   HLS / DVR / Play / Pause tidak disentuh.
   ============================================================ */

.live-error-box,
.live-error {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    visibility: hidden !important;
    opacity: 0 !important;
    overflow: hidden !important;
}
