/* ============================================================================
   LECTEUR VIDÉO DES LEÇONS (components/media-players/video-player.blade.php)
   ============================================================================ */

.lp-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1220;
    color: #fff;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Le cadre de la page de cours réserve une hauteur minimale pensée pour les autres
   contenus : la vidéo garde son format 16/9 */
.cs-player-inner:has(> .lp-player) {
    min-height: 0;
}

.lp-stage,
.lp-player .lp-iframe,
.lp-player .lp-video,
.lp-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lp-player .lp-video {
    background: #000;
    object-fit: contain;
}

/* --- Façade (miniature cliquable) ------------------------------------------ */

.lp-facade {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    color: inherit;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 85, 0, 0.35), transparent 55%),
        radial-gradient(circle at 80% 90%, rgba(14, 165, 233, 0.25), transparent 50%),
        #0b1220;
}

.lp-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-play {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255, 85, 0, 0.92);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    font-size: 2.6rem;
    line-height: 1;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.lp-play .bi {
    margin-left: 0.2rem;
}

.lp-facade:hover .lp-play,
.lp-facade:focus-visible .lp-play {
    transform: scale(1.08);
    background: rgba(255, 85, 0, 0.98);
}

.lp-facade:focus-visible {
    outline: 3px solid #fda274;
    outline-offset: -3px;
}

.lp-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.75rem 1.1rem 0.9rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    text-align: left;
}

.lp-caption-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lp-caption-duration {
    flex-shrink: 0;
    font-size: 0.85rem;
    opacity: 0.9;
    white-space: nowrap;
}

/* --- Messages (vidéo en préparation, absente) ------------------------------ */

.lp-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1rem;
    text-align: center;
    color: #cbd5e1;
}

.lp-message .bi {
    font-size: 2.5rem;
    color: #ff5500;
}

.lp-message p {
    margin: 0.4rem 0 0;
    font-weight: 600;
    color: #fff;
}

.lp-notice {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 4;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.75rem;
    pointer-events: none;
}

/* --- Plein écran ------------------------------------------------------------ */

.lp-fullscreen {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.lp-player:hover .lp-fullscreen,
.lp-fullscreen:focus-visible,
.lp-player.lp-pseudo-fullscreen .lp-fullscreen,
.lp-player:fullscreen .lp-fullscreen {
    opacity: 1;
}

.lp-fullscreen:hover {
    background: rgba(255, 85, 0, 0.95);
}

/* Écrans tactiles : pas de survol, bouton toujours visible */
@media (hover: none) {
    .lp-fullscreen {
        opacity: 0.85;
    }
}

.lp-player:fullscreen {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.lp-player:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.lp-player.lp-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
}

html.lp-noscroll,
html.lp-noscroll body {
    overflow: hidden;
}

@media (max-width: 576px) {
    .lp-play {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .lp-caption {
        padding: 2rem 0.8rem 0.65rem;
    }

    .lp-caption-title {
        font-size: 0.9rem;
    }
}
