/**
 * StreamHub — Netflix-style player (scoped to .np-player)
 */

/* ─── Play page shell ───────────────────────────────────── */
body.sh-play-page {
    background: #000;
    padding-top: 0 !important;
}
body.sh-play-page .sh-header {
    position: absolute;
    background: transparent;
    border: none;
    box-shadow: none;
}
body.sh-play-page .sh-header.scrolled {
    background: linear-gradient(180deg, rgba(0,0,0,0.85), transparent);
}

.play-shell {
    min-height: 100vh;
    padding-top: var(--sh-header-h);
    max-width: 1280px;
    margin: 0 auto;
}

.play-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    position: relative;
    z-index: 10;
}
.play-top-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.play-top-back:hover { background: rgba(255,255,255,0.18); }
.play-top-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.play-top-actions { display: flex; gap: 0.35rem; }
.play-top-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
}
.play-top-btn:hover { background: rgba(255,255,255,0.2); }

/* ─── Player container ──────────────────────────────────── */
.np-player {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    margin: 0 1rem;
}

.np-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.np-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Center play */
.np-center-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    border: none;
    cursor: pointer;
    transition: opacity 0.25s;
}
.np-center-play.hidden {
    opacity: 0;
    pointer-events: none;
}
.np-center-play-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    padding-left: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    transition: transform 0.2s;
}
.np-center-play:hover .np-center-play-icon {
    transform: scale(1.08);
}

/* Controls overlay */
.np-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 2.5rem 1rem 0.85rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.92));
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.np-controls > * { pointer-events: auto; }

.np-stage:hover .np-controls,
.np-stage:focus-within .np-controls,
.cinema-player.is-paused .np-controls,
.cinema-player.show-controls .np-controls {
    opacity: 1;
}

.np-scrub {
    position: relative;
    height: 4px;
    margin-bottom: 0.65rem;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    cursor: pointer;
}
.np-scrub-input {
    position: absolute;
    inset: -6px 0;
    width: 100%;
    height: calc(100% + 12px);
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.np-scrub::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--scrub-pct, 0%);
    background: #e50914;
    border-radius: 2px;
    pointer-events: none;
}

.np-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.np-bar-left,
.np-bar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.np-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.np-btn:hover { background: rgba(255,255,255,0.12); }
.np-btn.active { color: #00d4ff; }

.np-volume {
    width: 72px;
    accent-color: #e50914;
    height: 4px;
}

.np-time {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.9);
    font-variant-numeric: tabular-nums;
    margin-left: 0.25rem;
    white-space: nowrap;
}

/* Settings popover */
.np-menu {
    position: absolute;
    right: 1rem;
    bottom: 4.5rem;
    z-index: 6;
    min-width: 220px;
    background: rgba(20, 20, 26, 0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 0.5rem 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    backdrop-filter: blur(16px);
}
.np-menu.hidden { display: none; }
.np-menu-head {
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
}
.np-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: #fff;
}
.np-menu-select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    max-width: 110px;
}
.np-menu-check input { width: 18px; height: 18px; accent-color: #e50914; }
.np-menu-btn {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.np-menu-btn:hover { background: rgba(255,255,255,0.06); }

/* Up next */
.np-upnext {
    position: absolute;
    right: 1rem;
    bottom: 5rem;
    z-index: 5;
    background: rgba(16,16,22,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    max-width: 280px;
    color: #fff;
}
.np-upnext.hidden { display: none; }
.np-upnext-label { font-size: 0.75rem; color: rgba(255,255,255,0.55); margin: 0 0 0.35rem; }
.np-upnext strong { display: block; margin-bottom: 0.65rem; }
.np-upnext-actions { display: flex; gap: 0.5rem; }

/* Below player */
.play-extras {
    margin: 1.5rem 1rem 3rem;
    padding: 1.25rem 1.5rem;
    background: rgba(18, 20, 28, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}
.play-extras-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.play-extras-label { color: rgba(255,255,255,0.55); font-size: 0.85rem; }
.play-extras-rating-val { color: rgba(255,255,255,0.75); font-size: 0.85rem; }
.play-extras-comments h3 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 0.75rem;
}
.play-comment-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.play-comment-form textarea {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    min-height: 44px;
    font-family: inherit;
}
.play-comment-guest { color: rgba(255,255,255,0.55); font-size: 0.88rem; margin-bottom: 1rem; }
.play-comment-guest a { color: #00d4ff; }

.play-extras .comment-list { list-style: none; }
.play-extras .comment-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.88rem;
}
.play-extras .comment-item strong { color: #fff; }
.play-extras .comment-item time { color: rgba(255,255,255,0.45); font-size: 0.78rem; }
.play-extras .comment-item p { margin: 0.4rem 0 0; color: rgba(255,255,255,0.75); line-height: 1.5; }

.play-unavailable {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #fff;
    padding: 2rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* Stats modal on play page */
body.sh-play-page .abr-modal-sheet {
    background: #14141c;
    border-color: rgba(255,255,255,0.1);
}
body.sh-play-page .abr-modal-head h3 { color: #fff; }
body.sh-play-page .abr-live-stats label { color: rgba(255,255,255,0.5); }
body.sh-play-page .abr-live-stats span { color: #fff; }

@media (max-width: 640px) {
    .np-volume { display: none; }
    .np-menu { right: 0.5rem; left: 0.5rem; min-width: auto; }
    .play-shell { padding-top: var(--sh-header-h); }
}
