/* ============================================================
   nativePlayerSkin.css — position:absolute overlay approach
   The video stays in normal flow to size the container.
   The overlay and controls bar are position:absolute on top.
   Override accent: set --np-accent on :root or .np-video-area.
   ============================================================ */

/* ── Bootstrap embed-responsive overrides ─────────────────────── */
.np-native-player {
    padding-bottom: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.np-native-player.embed-responsive::before,
.np-native-player.embed-responsive-16by9::before {
    display: none !important;
    padding-top: 0 !important;
}

.np-native-container {
    position: relative !important;
    height: auto !important;
}

/* Undo Bootstrap's position:absolute on <video> inside .embed-responsive */
.np-native-container video#native-video-player {
    position: static !important;
}

/* ── Video area: positioned container for overlays ────────────── */
.np-video-area {
    position: relative !important;
    background: #000;
    cursor: pointer;
    line-height: 0;
}

/* ── Video: stays in normal flow, sizes the container ─────────── */
video#native-video-player {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    position: relative;
    z-index: 1;
}

/* ── Custom caption overlay ────────────────────────────────────── */
.np-caption-box {
    position: absolute;
    bottom: 60px;       /* above the controls bar */
    left: 5%;
    right: 5%;
    z-index: 9;         /* below bar (12) and overlay (11), above video (1) */
    text-align: center;
    pointer-events: none;
    font-size: 1.1rem;
    line-height: 1.4;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.np-caption-box:empty {
    display: none;
}

.np-quality-hidden {
    display: none !important;
}

.np-caption-box span {
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 8px;
    border-radius: 3px;
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* ── Show / hide controls on hover or when paused ─────────────── */
.np-bar,
.np-overlay {
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.np-video-area:hover .np-bar,
.np-video-area.np-paused .np-bar {
    opacity: 1;
    pointer-events: auto;
}

.np-video-area:hover .np-overlay,
.np-video-area.np-paused .np-overlay {
    opacity: 1;
    /* pointer-events stays none; only .np-big-play captures clicks */
}

/* ── Centre big-play overlay — covers the whole video area ────── */
.np-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    pointer-events: none;
}

/* Only the big-play button itself should capture clicks */
.np-big-play {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
}

.np-big-play:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: scale(1.08);
}

/* ── Controls bar — absolutely positioned at the bottom ───────── */
.np-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.45) 60%,
        transparent 100%
    );
    padding: 28px 10px 8px;
    line-height: normal;
}

/* ── Progress / seek row ──────────────────────────────────────── */
.np-progress-row {
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    cursor: pointer;
}

.np-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    transition: height 0.1s;
    pointer-events: none;
}

.np-progress-row:hover .np-track {
    height: 5px;
}

.np-buf {
    position: absolute;
    left: 0;
    height: 100%;
    width: 0;
    background: rgba(255, 255, 255, 0.35);
}

.np-pos {
    position: absolute;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--np-accent, #3bafda);
}

/* Transparent range input — the actual interactive seek element */
.np-seek {
    position: absolute;
    left: 0;
    width: 100%;
    height: 16px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* ── Buttons row ──────────────────────────────────────────────── */
.np-btns-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.np-left,
.np-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ── Button ───────────────────────────────────────────────────── */
.np-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.88);
    padding: 5px 7px;
    font-size: 1rem;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.1s, background 0.1s;
}

.np-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

/* ── Time display ─────────────────────────────────────────────── */
.np-time {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-family: monospace;
    white-space: nowrap;
    padding: 0 6px;
    line-height: 1;
}

/* ── Volume slider ────────────────────────────────────────────── */
.np-vol-bar {
    width: 68px;
    accent-color: var(--np-accent, #3bafda);
    cursor: pointer;
}

@media (max-width: 480px) {
    .np-vol-bar { display: none; }
}

/* ── Caption dropdown ─────────────────────────────────────────── */
.np-cc-wrap {
    position: relative;
}

.np-cc-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(18, 18, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    min-width: 120px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.np-cc-menu.open {
    display: block;
}

.np-cc-opt {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    line-height: normal;
}

.np-cc-opt:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.np-cc-opt.np-cc-on {
    color: var(--np-accent, #3bafda);
    font-weight: 600;
}

/* ── Fullscreen ───────────────────────────────────────────────── */
#video_player:fullscreen,
#video_player:-webkit-full-screen {
    background: #000 !important;
    height: 100vh !important;
    width: 100vw !important;
}

#video_player:fullscreen .np-video-area,
#video_player:-webkit-full-screen .np-video-area {
    height: 100%;
}

#video_player:fullscreen video#native-video-player,
#video_player:-webkit-full-screen video#native-video-player {
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

/* Controls always visible in fullscreen */
#video_player:fullscreen .np-bar,
#video_player:-webkit-full-screen .np-bar {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#video_player:fullscreen .np-overlay,
#video_player:-webkit-full-screen .np-overlay {
    opacity: 1 !important;
}
