/* VOX Player Theme */
.video-js.vjs-theme-vox {
    --vjs-theme-primary: #ffbb00;
    --vjs-theme-foreground: #ffffff;
    --vjs-theme-background: #000000;
}

/* Control bar */
.vjs-theme-vox .vjs-control-bar {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(10px);
}

/* Primary buttons */
.vjs-theme-vox .vjs-big-play-button {
    background-color: var(--vjs-theme-primary);
    border-color: var(--vjs-theme-primary);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin-left: -40px;
    margin-top: -40px;
}

.vjs-theme-vox .vjs-big-play-button:hover {
    background-color: rgba(255, 187, 0, 0.9);
}

/* Progress bar */
.vjs-theme-vox .vjs-play-progress {
    background-color: var(--vjs-theme-primary);
}

.vjs-theme-vox .vjs-load-progress {
    background: rgba(255, 187, 0, 0.3);
}

/* Quality selector button */
.vjs-theme-vox .vjs-quality-button .vjs-menu-button-value-display {
    font-size: 1em;
    font-weight: 500;
    padding: 0 0.5em;
}

/* Quality menu items */
.vjs-theme-vox .vjs-quality-button .vjs-menu-item.vjs-selected {
    background-color: var(--vjs-theme-primary);
    color: var(--vjs-theme-background);
}

.vjs-theme-vox .vjs-quality-button .vjs-menu-item:hover {
    background-color: rgba(255, 187, 0, 0.2);
}

/* Volume indicator overlay (mobile gestures) - LEGACY, kept for backwards compat */
.vox-volume-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    display: none;
    transition: opacity 0.3s ease;
}

/* Seek indicator overlay - shown during horizontal swipe gesture (mobile) */
.vox-seek-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
    padding: 18px 36px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
    display: none;
    transition: opacity 0.25s ease;
    line-height: 1.25;
    border: 1px solid rgba(255, 187, 0, 0.4);
}
.vox-seek-indicator small {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .vjs-theme-vox .vjs-control-bar {
        font-size: 16px;
        padding: 12px;
    }

    .vjs-theme-vox .vjs-button {
        min-width: 44px;
        min-height: 44px;
    }

    .vjs-theme-vox .vjs-progress-holder {
        height: 10px;
    }

    /* Smaller font for quality label on mobile */
    .vjs-theme-vox .vjs-quality-button .vjs-menu-button-value-display {
        font-size: 0.85em;
        padding: 0 0.3em;
    }

    /* Larger touch targets for mobile */
    .vjs-theme-vox .vjs-play-control,
    .vjs-theme-vox .vjs-fullscreen-control {
        min-width: 50px;
        min-height: 50px;
    }

    /* Volume indicator on mobile */
    .vox-volume-indicator {
        font-size: 28px;
        padding: 25px 50px;
    }
}

/* Audio mode indicator - ACTIVE state (green) */
#audio-video-toggle.audio-mode {
    background-color: #28a745 !important;  /* Green */
    color: #ffffff !important;
    font-weight: 600;
    border-color: #28a745 !important;
}

/* Audio mode indicator - HOVER state (yellow) */
#audio-video-toggle:hover {
    background-color: var(--vjs-theme-primary) !important;  /* Yellow #ffbb00 */
    color: var(--vjs-theme-background) !important;
    border-color: var(--vjs-theme-primary) !important;
}

/* Audio mode ACTIVE + HOVER (keep green) */
#audio-video-toggle.audio-mode:hover {
    background-color: #218838 !important;  /* Darker green */
}

/* Audio mode - hide video container smoothly */
.video-js.audio-mode-active {
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* Mobile audio toggle button */
@media (max-width: 768px) {
    #audio-video-toggle {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    #audio-video-toggle:active {
        transform: scale(0.95);
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .vjs-theme-vox .vjs-control-bar {
        font-size: 14px;
        padding: 10px;
    }

    .vjs-theme-vox .vjs-button {
        min-width: 40px;
        min-height: 40px;
    }
}

/* ============================ MOBILE PLAYER (≤767px) ============================
   Hlavní řada controlů: play, progress, time, MENU "...", fullscreen.
   Sekundární controly (volume, playback rate, PIP, quality, captions, cast)
   jsou skryté z hlavní řady a přesunuté do "Více" menu které otevře
   bottom sheet panel.
*/
@media (max-width: 767.98px) {
    /* Skrýt sekundární controly z hlavní řady (jsou v "Více" menu) */
    .vjs-theme-vox .vjs-volume-panel,
    .vjs-theme-vox .vjs-playback-rate,
    .vjs-theme-vox .vjs-picture-in-picture-control,
    .vjs-theme-vox .vjs-subs-caps-button,
    .vjs-theme-vox .vjs-captions-button,
    .vjs-theme-vox .vjs-subtitles-button,
    .vjs-theme-vox .vjs-quality-button,
    .vjs-theme-vox .vjs-chromecast-button,
    .vjs-theme-vox .vjs-airplay-button {
        display: none !important;
    }

    .vjs-theme-vox .vjs-control-bar {
        height: 44px !important;
        padding: 0 4px !important;
        font-size: 16px;
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%) !important;
    }
    .vjs-theme-vox .vjs-control-bar .vjs-button {
        min-width: 44px !important;
        min-height: 44px !important;
        width: 44px;
        height: 44px;
        padding: 0;
    }
    .vjs-theme-vox .vjs-play-control,
    .vjs-theme-vox .vjs-fullscreen-control {
        min-width: 48px !important;
        width: 48px;
    }
    .vjs-theme-vox .vjs-progress-control {
        flex: 1 1 auto;
        margin: 0 6px;
        height: 44px;
        display: flex;
        align-items: center;
    }
    .vjs-theme-vox .vjs-progress-holder {
        height: 6px !important;
        margin: 0;
    }
    .vjs-theme-vox .vjs-remaining-time,
    .vjs-theme-vox .vjs-current-time,
    .vjs-theme-vox .vjs-duration {
        font-size: 12px;
        padding: 0 6px;
        line-height: 44px;
        min-width: auto;
    }
    .vjs-theme-vox .vjs-time-divider { display: none; }

    .vjs-theme-vox .vjs-big-play-button {
        width: 80px !important;
        height: 80px !important;
        line-height: 80px !important;
        font-size: 36px !important;
        border-radius: 50% !important;
        margin-left: -40px !important;
        margin-top: -40px !important;
    }
}

/* ============================ TABLET (768-1024px) ============================ */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablet — playback rate, PIP a captions přesunout do "Více" menu */
    .vjs-theme-vox .vjs-playback-rate,
    .vjs-theme-vox .vjs-picture-in-picture-control {
        display: none !important;
    }

    .vjs-theme-vox .vjs-control-bar {
        height: 44px !important;
        padding: 0 8px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 70%, transparent 100%) !important;
    }
    .vjs-theme-vox .vjs-progress-holder { height: 5px !important; }
    .vjs-theme-vox .vjs-current-time,
    .vjs-theme-vox .vjs-remaining-time,
    .vjs-theme-vox .vjs-duration {
        font-size: 13px;
    }
}

/* ============================ ULTRA SMALL (≤375px) ============================ */
@media (max-width: 374.98px) {
    .vjs-theme-vox .vjs-remaining-time,
    .vjs-theme-vox .vjs-current-time { display: none; }
    .vjs-theme-vox .vjs-progress-control { margin: 0 4px; }
}

/* ============================ "VÍCE" MENU BUTTON + BOTTOM SHEET ============================ */
.video-js .vox-more-button {
    cursor: pointer;
    display: none !important;
    color: #fff !important;
}
.video-js .vox-more-button .vjs-icon-placeholder::before {
    content: "\f114"; /* cog/settings unicode v VideoJS fontu */
    font-family: VideoJS;
    font-size: 20px;
    line-height: 44px;
}
/* Mobile/tablet: show */
@media (max-width: 1024px) {
    .video-js .vox-more-button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }
}

/* Bottom sheet panel — fixed celoplošný modal (defaultně skrytý) */
.vox-player-sheet {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #141414;
    border-top: 1px solid rgba(255, 191, 0, 0.35);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px 24px;
    z-index: 9999;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .28s ease-out, visibility .28s;
    color: #fff;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.7);
    max-height: 70vh;
    overflow-y: auto;
}
/* Aktivovat jen na mobile/tablet (display:block kvůli animaci, visibility drží off-screen stav) */
@media (max-width: 1024px) {
    .vox-player-sheet { display: block; }
}
.vox-player-sheet.is-open {
    transform: translateY(0);
    visibility: visible;
}
/* Na PC ÚPLNĚ skrýt sheet i backdrop */
@media (min-width: 1025px) {
    .vox-player-sheet,
    .vox-player-sheet-backdrop {
        display: none !important;
    }
}
.vox-player-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.vox-player-sheet__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #FFBF00;
}
.vox-player-sheet__close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color .2s ease;
}
.vox-player-sheet__close:hover {
    background: rgba(255, 191, 0, 0.25);
    color: #FFBF00;
}
.vox-player-sheet__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
.vox-player-sheet__row:last-child { border-bottom: none; }
.vox-player-sheet__row:hover { color: #FFBF00; }
.vox-player-sheet__row-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #e5e5e5;
    font-weight: 500;
}
.vox-player-sheet__row-label svg { color: #FFBF00; flex-shrink: 0; }
.vox-player-sheet__row-value {
    color: #FFBF00;
    font-weight: 700;
    font-size: 13px;
}
.vox-player-sheet__row-toggle {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    position: relative;
    transition: background-color .2s ease;
}
.vox-player-sheet__row-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
}
.vox-player-sheet__row.is-active .vox-player-sheet__row-toggle {
    background: #FFBF00;
}
.vox-player-sheet__row.is-active .vox-player-sheet__row-toggle::after {
    transform: translateX(16px);
    background: #111;
}

/* Volume slider — horizontal pro touch */
.vox-player-sheet__volume {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    height: 6px;
    outline: none;
    margin-top: 6px;
}
.vox-player-sheet__volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFBF00;
    cursor: pointer;
    border: none;
}
.vox-player-sheet__volume::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFBF00;
    cursor: pointer;
    border: none;
}

/* Backdrop overlay — fixed pro celoplošný modal */
.vox-player-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
@media (max-width: 1024px) {
    .vox-player-sheet-backdrop { display: block; }
}
.vox-player-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Kapitolové značky na časové ose (PlayerChapters) ──
   Napříč zařízeními: na dotykových (telefon/tablet) širší hit-area. */
.vjs-progress-holder .vox-chapter-marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    cursor: pointer;
    z-index: 2;
    transition: background-color .12s ease, transform .12s ease;
}
/* Neviditelná rozšířená klikací/dotyková plocha bez vizuálního zvětšení. */
.vjs-progress-holder .vox-chapter-marker::after {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -5px;
    right: -5px;
}
.vjs-progress-holder .vox-chapter-marker:hover,
.vjs-progress-holder .vox-chapter-marker:focus-visible {
    background: #f0b429;
    transform: scaleX(2.5);
    outline: none;
}
@media (pointer: coarse) {
    .vjs-progress-holder .vox-chapter-marker { width: 3px; }
}

/* ── „Přeskočit úvod" (PlayerSkipIntro) ──
   Pill vpravo dole nad control barem; viditelné jen během úvodního okna. */
.video-js .vox-skip-intro {
    position: absolute;
    right: 16px;
    bottom: 4.5em;
    z-index: 5;
    padding: 10px 18px;
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, background-color .18s ease;
}
.video-js .vox-skip-intro.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.video-js .vox-skip-intro:hover,
.video-js .vox-skip-intro:focus-visible {
    background: #FFBF00;
    border-color: #FFBF00;
    color: #111;
    outline: none;
}
@media (max-width: 640px) {
    .video-js .vox-skip-intro {
        right: 10px;
        bottom: 4em;
        padding: 8px 14px;
        font-size: 13px;
    }
}

