/* TVClub Player — étape 5 : finition terminal TV / PVR. */

/* ------------------------------------------------------------------
   Barre Video.js : thème TVClub, sans collisions entre contrôles
------------------------------------------------------------------ */
.video-js .vjs-picture-in-picture-control,
.video-js .vjs-picture-in-picture-button {
    display: none !important;
}

/* Flux linéaire : le cartouche d'état remplace le gros bouton de lecture. */
.video-js .vjs-big-play-button {
    display: none !important;
}

.video-js .vjs-control-bar {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: 3.55rem !important;
    padding: 0 0.32rem !important;
    overflow: visible !important;
    border-top: 1px solid rgba(226, 140, 255, 0.22) !important;
    background:
        linear-gradient(180deg, rgba(25, 23, 31, 0.92), rgba(13, 13, 18, 0.985)) !important;
    box-shadow: 0 -0.65rem 1.8rem rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

/* Ne jamais imposer la largeur d'un bouton aux composants composites. */
.video-js .vjs-control-bar > .vjs-button,
.video-js .vjs-control-bar > .tvclub-language-control {
    width: 3.35rem !important;
    min-width: 3.35rem !important;
    flex: 0 0 3.35rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.video-js .vjs-control-bar > .vjs-control:not(.vjs-button):not(.vjs-volume-panel):not(.vjs-progress-control):not(.vjs-spacer):not(.vjs-custom-control-spacer):not(.tvclub-language-control) {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
}

.video-js .vjs-button > .vjs-icon-placeholder::before {
    font-size: 1.55rem !important;
    line-height: 3.55rem !important;
}

.video-js .vjs-button:hover,
.video-js .vjs-button:focus-visible,
.video-js .vjs-button[aria-expanded="true"] {
    color: #fff !important;
    background: linear-gradient(180deg, rgba(211, 92, 255, 0.24), rgba(142, 58, 154, 0.18)) !important;
}

.video-js .vjs-button:focus-visible {
    outline: 2px solid rgba(226, 140, 255, 0.95) !important;
    outline-offset: -3px !important;
}

/* Le thème Fantasy dessinait un anneau autour de lecture/pause. */
.video-js .vjs-play-control {
    margin-right: 0.15rem !important;
    border: 0 !important;
    border-radius: 0.35rem !important;
    background: transparent !important;
    box-shadow: none !important;
}

.video-js .vjs-play-control::before,
.video-js .vjs-play-control::after,
.video-js .vjs-play-control .vjs-icon-placeholder::after {
    content: none !important;
    display: none !important;
}

.video-js .vjs-play-control .vjs-icon-placeholder,
.video-js .vjs-play-control .vjs-icon-placeholder::before {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.video-js .vjs-live-control,
.video-js .vjs-time-control {
    display: flex !important;
    align-items: center !important;
    min-width: auto !important;
    padding: 0 0.45rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
}

/* Pour un direct sans timeshift, les compteurs VOD parasitent la barre. */
.video-js.vjs-live .vjs-current-time,
.video-js.vjs-live .vjs-time-divider,
.video-js.vjs-live .vjs-duration,
.video-js.vjs-live .vjs-remaining-time,
.video-js.vjs-live .vjs-progress-control {
    display: none !important;
}

.video-js .vjs-progress-control {
    min-width: 4rem !important;
    flex: 1 1 auto !important;
}

.video-js .vjs-spacer,
.video-js .vjs-custom-control-spacer {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.video-js .vjs-progress-holder,
.video-js .vjs-volume-bar {
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.18) !important;
}

.video-js .vjs-play-progress,
.video-js .vjs-volume-level {
    border-radius: inherit !important;
    background: linear-gradient(90deg, #8e3a9a, #e12f9c, #e28cff) !important;
    box-shadow: 0 0 0.75rem rgba(211, 92, 255, 0.32) !important;
}

.video-js .vjs-load-progress,
.video-js .vjs-load-progress div {
    border-radius: inherit !important;
    background: rgba(255, 255, 255, 0.16) !important;
}

.video-js .vjs-slider:focus {
    text-shadow: none !important;
    box-shadow: 0 0 0 2px rgba(226, 140, 255, 0.72) !important;
}

/* Volume : le panneau a sa propre largeur et n'empiète jamais sur plein écran. */
.video-js .vjs-volume-panel {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 3.35rem !important;
    min-width: 3.35rem !important;
    max-width: 3.35rem !important;
    flex: 0 0 3.35rem !important;
    overflow: hidden !important;
    transition: width 140ms ease, min-width 140ms ease, max-width 140ms ease, flex-basis 140ms ease !important;
}

.video-js .vjs-volume-panel.vjs-hover,
.video-js .vjs-volume-panel:hover,
.video-js .vjs-volume-panel:focus-within,
.video-js .vjs-volume-panel.vjs-slider-active {
    width: 8.2rem !important;
    min-width: 8.2rem !important;
    max-width: 8.2rem !important;
    flex-basis: 8.2rem !important;
}

.video-js .vjs-volume-panel .vjs-mute-control {
    width: 3.35rem !important;
    min-width: 3.35rem !important;
    flex: 0 0 3.35rem !important;
}

.video-js .vjs-volume-panel .vjs-volume-control {
    position: relative !important;
    left: auto !important;
    display: flex !important;
    align-items: center !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: width 140ms ease, max-width 140ms ease, opacity 100ms ease !important;
}

.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,
.video-js .vjs-volume-panel:hover .vjs-volume-control,
.video-js .vjs-volume-panel:focus-within .vjs-volume-control,
.video-js .vjs-volume-panel.vjs-slider-active .vjs-volume-control {
    width: 4.55rem !important;
    min-width: 4.55rem !important;
    max-width: 4.55rem !important;
    padding-right: 0.55rem !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.video-js .vjs-volume-panel .vjs-volume-bar {
    width: 100% !important;
    margin: 0 !important;
}

.video-js .vjs-fullscreen-control {
    margin-left: 0 !important;
    flex-shrink: 0 !important;
}

.video-js .vjs-big-play-button {
    width: 4.8rem !important;
    height: 4.8rem !important;
    margin-top: -2.4rem !important;
    margin-left: -2.4rem !important;
    border: 1px solid rgba(226, 140, 255, 0.75) !important;
    border-radius: 50% !important;
    background: rgba(17, 14, 24, 0.82) !important;
    box-shadow: 0 0.8rem 2.2rem rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(10px);
}

.video-js .vjs-big-play-button:hover,
.video-js .vjs-big-play-button:focus-visible {
    background: rgba(142, 58, 154, 0.88) !important;
}

.video-js .vjs-loading-spinner {
    border-color: rgba(226, 140, 255, 0.28) !important;
    border-top-color: #e28cff !important;
}

/* Le contrôle langue appartient visuellement à la même barre. */
.video-js .tvclub-language-control {
    height: 100% !important;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.video-js .tvclub-language-button {
    border-radius: 0.35rem;
}

/* ------------------------------------------------------------------
   Navigateur PVR : panneau compact + vraie frise horizontale
------------------------------------------------------------------ */
.tvclub-player-zap-osd.is-browser {
    top: clamp(0.65rem, 4%, 2.2rem) !important;
    right: clamp(0.65rem, 3.2vw, 3rem) !important;
    bottom: auto !important;
    left: clamp(0.65rem, 3.2vw, 3rem) !important;
    display: flex !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100% - 5.4rem) !important;
    padding: clamp(0.8rem, 1.8vw, 1.25rem) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-color: rgba(226, 140, 255, 0.26) !important;
    border-radius: 0.72rem !important;
    background:
        radial-gradient(circle at 20% 0%, rgba(142, 58, 154, 0.18), transparent 34%),
        linear-gradient(120deg, rgba(17, 14, 25, 0.965), rgba(15, 15, 21, 0.955) 58%, rgba(8, 8, 12, 0.95)) !important;
    box-shadow: 0 1.1rem 3rem rgba(0, 0, 0, 0.62) !important;
    backdrop-filter: blur(17px) saturate(118%);
    -webkit-backdrop-filter: blur(17px) saturate(118%);
    scrollbar-width: thin;
    scrollbar-color: rgba(226, 140, 255, 0.5) transparent;
}

.tvclub-player-zap-osd.is-browser .tvclub-player-zap-header {
    gap: 0.55rem !important;
    margin-bottom: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-player-zap-title {
    font-size: clamp(1.05rem, 2.4vw, 1.55rem) !important;
    line-height: 1.15 !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-player-zap-subtitle {
    margin-top: 0.2rem !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-player-zap-meta {
    margin-top: 0.28rem !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-pvr-synopsis {
    max-width: 78rem;
    margin-top: 0.45rem !important;
    line-height: 1.35 !important;
    -webkit-line-clamp: 2 !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-player-zap-timeline {
    margin-top: 0.55rem !important;
}

.tvclub-player-zap-osd.is-browser .tvclub-pvr-status {
    min-height: 1.35rem !important;
    margin-top: 0.55rem !important;
}

.tvclub-pvr-program-strip {
    flex: 0 0 auto !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    width: 100% !important;
    height: 7.15rem !important;
    min-height: 7.15rem !important;
    max-height: 7.15rem !important;
    margin-top: 0.45rem !important;
    padding: 0.12rem 0.08rem 0.48rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: inline proximity;
    scroll-padding-inline: 42%;
}

.tvclub-pvr-program-card {
    display: flex !important;
    flex: 0 0 var(--tvclub-pvr-card-width, 11rem) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: var(--tvclub-pvr-card-width, 11rem) !important;
    min-width: var(--tvclub-pvr-card-width, 11rem) !important;
    max-width: var(--tvclub-pvr-card-width, 11rem) !important;
    height: 6.45rem !important;
    min-height: 6.45rem !important;
    max-height: 6.45rem !important;
    padding: 0.62rem 0.7rem !important;
    overflow: hidden !important;
    scroll-snap-align: center;
    border-color: rgba(255, 255, 255, 0.12) !important;
    border-radius: 0.52rem !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)) !important;
    box-shadow: none !important;
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.tvclub-pvr-program-card:hover:not(.is-selected),
.tvclub-pvr-program-card:focus-visible:not(.is-selected) {
    transform: translateY(-1px);
    background: rgba(142, 58, 154, 0.18) !important;
}

.tvclub-pvr-program-card.is-current {
    border-color: rgba(88, 224, 138, 0.48) !important;
}

.tvclub-pvr-program-card.is-selected {
    transform: translateY(-1px);
    border-color: rgba(226, 140, 255, 0.98) !important;
    background:
        linear-gradient(145deg, rgba(142, 58, 154, 0.58), rgba(89, 33, 100, 0.42)) !important;
    box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(226, 140, 255, 0.22) !important;
}

.tvclub-pvr-program-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    min-width: 0;
}

.tvclub-pvr-program-time {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.7rem !important;
}

.tvclub-pvr-program-state {
    overflow: hidden;
    padding: 0.12rem 0.34rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.58rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-pvr-program-card[data-temporal-status="current"] .tvclub-pvr-program-state {
    border-color: rgba(88, 224, 138, 0.38);
    color: #8af0ad;
    background: rgba(31, 126, 66, 0.18);
}

.tvclub-pvr-program-title {
    display: -webkit-box !important;
    margin-top: 0.48rem !important;
    overflow: hidden !important;
    color: #fff !important;
    font-size: 0.86rem !important;
    font-weight: 780 !important;
    line-height: 1.22 !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tvclub-pvr-program-card-subtitle {
    display: block;
    margin-top: auto !important;
    overflow: hidden !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.tvclub-pvr-program-card.is-short .tvclub-pvr-program-state,
.tvclub-pvr-program-card.is-short .tvclub-pvr-program-card-subtitle {
    display: none !important;
}

.tvclub-pvr-program-card.is-short .tvclub-pvr-program-title {
    -webkit-line-clamp: 3;
}

.tvclub-pvr-program-strip::-webkit-scrollbar {
    height: 0.4rem;
}

.tvclub-pvr-program-strip::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.tvclub-pvr-program-strip::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(142, 58, 154, 0.75), rgba(226, 140, 255, 0.72));
}

.tvclub-pvr-footer {
    margin-top: 0.35rem !important;
}

.tvclub-pvr-hints {
    margin-top: 0.38rem !important;
}

/* ------------------------------------------------------------------
   État du signal et confort plein écran
------------------------------------------------------------------ */
.tvclub-player-signal {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 52;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(34rem, calc(100% - 2rem));
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(226, 140, 255, 0.34);
    border-radius: 0.58rem;
    background: rgba(15, 13, 20, 0.9);
    box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.tvclub-player-signal[hidden] {
    display: none !important;
}

.tvclub-player-signal-spinner {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: #e28cff;
    border-radius: 50%;
    animation: tvclub-player-signal-spin 850ms linear infinite;
}

.tvclub-player-signal.is-error {
    border-color: rgba(255, 104, 130, 0.55);
}

.tvclub-player-signal.is-error .tvclub-player-signal-spinner {
    border-color: rgba(255, 104, 130, 0.35);
    border-top-color: #ff6882;
}

.video-js.tvclub-cursor-hidden,
.video-js.tvclub-cursor-hidden * {
    cursor: none !important;
}

/* Les sous-titres remontent juste assez, sans disparaître derrière l'OSD. */
.video-js.tvclub-osd-visible:not(.tvclub-pvr-browser-open) .vjs-text-track-display {
    bottom: clamp(9.5rem, 22%, 12.5rem) !important;
}

.video-js.tvclub-pvr-browser-open .vjs-text-track-display {
    bottom: clamp(11rem, 24%, 14rem) !important;
}

/* Harmonisation des commandes flottantes du lecteur. */
.player-container > .player-chat-open {
    width: 1.65rem !important;
    height: 1.65rem !important;
    min-width: 1.65rem !important;
    min-height: 1.65rem !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 50% !important;
    background: rgba(12, 12, 16, 0.64) !important;
    box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.32) !important;
    color: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(8px);
}

.player-container > .player-chat-open:hover,
.player-container > .player-chat-open:focus-visible {
    border-color: rgba(226, 140, 255, 0.85) !important;
    background: rgba(142, 58, 154, 0.72) !important;
    color: #fff !important;
}

@keyframes tvclub-player-signal-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 760px), (max-height: 620px) {
    .tvclub-player-zap-osd.is-browser {
        top: 0.42rem !important;
        right: 0.42rem !important;
        left: 0.42rem !important;
        max-height: calc(100% - 4.15rem) !important;
        padding: 0.62rem !important;
    }

    .tvclub-pvr-program-strip {
        height: 6.35rem !important;
        min-height: 6.35rem !important;
        max-height: 6.35rem !important;
    }

    .tvclub-pvr-program-card {
        height: 5.7rem !important;
        min-height: 5.7rem !important;
        max-height: 5.7rem !important;
    }

    .video-js .vjs-control-bar {
        height: 3.25rem !important;
    }

    .video-js .vjs-button > .vjs-icon-placeholder::before {
        line-height: 3.25rem !important;
    }
}

@media (max-width: 480px), (max-height: 430px) {
    .tvclub-player-zap-osd.is-browser .tvclub-pvr-synopsis,
    .tvclub-player-zap-osd.is-browser .tvclub-player-zap-meta {
        display: none !important;
    }

    .tvclub-pvr-program-strip {
        height: 5.9rem !important;
        min-height: 5.9rem !important;
        max-height: 5.9rem !important;
    }

    .tvclub-pvr-program-card {
        height: 5.25rem !important;
        min-height: 5.25rem !important;
        max-height: 5.25rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tvclub-pvr-program-card,
    .tvclub-player-signal-spinner {
        transition: none !important;
        animation: none !important;
    }
}


/* ------------------------------------------------------------------
   Ratio d'affichage strict — surface vidéo

   Le player occupe tout l'écran, mais la surface média reste centrée dans
   le rectangle calculé par player.js. Une source 16:9 sur un écran 16:10
   reçoit donc de fines bandes horizontales ; une source 4:3 reçoit des
   bandes latérales. Aucun pixel n'est étiré.
------------------------------------------------------------------ */
.video-js .vjs-tech,
.video-js video.vjs-tech {
    position: absolute !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    width: var(--player-media-width, 100%) !important;
    height: var(--player-media-height, 100%) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: translate(-50%, -50%) !important;
    object-fit: contain !important;
    background: #000 !important;
}

.video-js.vjs-fullscreen,
.video-js:-webkit-full-screen,
.video-js:fullscreen {
    background: #000 !important;
}
