/* ============================================================================
 * Amarok e-Santé — Lecteur vidéo "branded"
 * Overlay plein écran, splash blanc + logo XL, contrôles minimaux
 * Desktop : contrôles sous la vidéo. Mobile : overlay bas sur la vidéo.
 * ==========================================================================*/

.aes-video-lock { overflow: hidden !important; }

.aes-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.aes-video-overlay.is-visible { opacity: 1; }

/* ---------- Splash blanc ---------- */
.aes-video-splash {
    position: absolute;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 40px;
    text-align: center;
    animation: aesSplashIn .5s ease;
}
@keyframes aesSplashIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.aes-video-splash__text {
    font-size: clamp(13px, 1.4vw, 18px);
    color: #666;
    font-weight: 400;
    margin-bottom: 28px;
    letter-spacing: 0.3px;
    animation: aesSplashTextIn .6s ease both .15s;
}
.aes-video-splash__logo {
    max-width: min(60vw, 520px);
    max-height: 40vh;
    object-fit: contain;
    animation: aesSplashLogoIn .7s cubic-bezier(.2,.7,.2,1) both .35s;
}
@keyframes aesSplashTextIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes aesSplashLogoIn {
    from { opacity: 0; transform: scale(.86); }
    to   { opacity: 1; transform: scale(1); }
}

/* Variante mini-splash entre 2 vidéos de playlist */
.aes-video-splash--mini .aes-video-splash__text { font-size: clamp(14px, 1.6vw, 18px); margin-bottom: 20px; }
.aes-video-splash--mini .aes-video-splash__logo { max-width: min(40vw, 340px); max-height: 26vh; }

/* ---------- Stage = conteneur vidéo + barre de contrôles ---------- */
.aes-video-stage {
    position: relative;
    width: min(96vw, 1280px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Le frame contient strictement la vidéo + watermark + counter */
.aes-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;            /* léger border-radius demandé */
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.aes-video-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    border-radius: 8px;
}

/* ---------- Watermark logo partenaire (haut-droite, sous le splash) ---------- */
.aes-video-watermark {
    position: absolute;
    right: 16px;
    top: 36px;
    height: 42px;
    max-width: 140px;
    opacity: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 2;
}

/* ---------- Counter playlist ---------- */
.aes-video-counter {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    z-index: 2;
}

/* ---------- Controles bas (desktop = sous la vidéo) ---------- */
.aes-video-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(20, 22, 28, .92);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.aes-video-btn {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    padding: 0;
    flex-shrink: 0;
}
.aes-video-btn:hover { background: rgba(255,255,255,.22); }
.aes-video-btn.is-muted { background: rgba(220,80,80,.4); }

/* Bouton "Passer la vidéo" — design des boutons verts de l'app (primary-btn) */
.aes-video-btn--skip {
    width: auto;
    height: auto;
    padding: 10px 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, #6adc8a, #53be71);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(106, 220, 138, .4);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    margin-left: 6px;
    line-height: 1;
    opacity: 1;
}
.aes-video-btn--skip:hover {
    background: linear-gradient(90deg, #72ff9a, #6adc8a);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(106, 220, 138, .55);
}
.aes-video-btn--skip:active { transform: translateY(0); }

.aes-video-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,.18);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.aes-video-progress__bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: #4cc2ff;
    border-radius: 3px;
    transition: width .15s linear;
}
.aes-video-time {
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    min-width: 86px;
    text-align: center;
    flex-shrink: 0;
}

/* ---------- Fin de playlist : assombrissement de la vidéo ---------- */
.aes-video-frame.is-finished::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 3;
    animation: aesDimIn .45s ease both;
}
@keyframes aesDimIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- CTA "Continuer" — design des boutons de l'app (primary-btn) ---------- */
.aes-video-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    border: none;
    cursor: pointer;
    /* Match exact .primary-btn */
    background: linear-gradient(90deg, #6adc8a, #53be71);
    color: #fff;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(106, 220, 138, .4);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    animation: aesCtaIn .35s ease both;
    white-space: nowrap;
    line-height: 1;
}
.aes-video-cta .aes-video-cta__label { line-height: 1; }
.aes-video-cta:hover {
    background: linear-gradient(90deg, #72ff9a, #6adc8a);
    transform: translate(-50%, calc(-50% - 2px));
    box-shadow: 0 8px 16px rgba(0, 0, 0, .1);
}
.aes-video-cta:active { transform: translate(-50%, -50%); }
.aes-video-cta:focus-visible {
    outline: 3px solid rgba(255,255,255,.6);
    outline-offset: 3px;
}

@keyframes aesCtaIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================================================
 * MOBILE — Contrôles en overlay sur la vidéo, fullscreen
 * ==========================================================================*/
@media (max-width: 640px) {
    .aes-video-stage {
        width: 100vw;
        height: 100vh;
        gap: 0;
    }
    .aes-video-frame {
        flex: 1;
        height: 100%;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
    }
    .aes-video-player { border-radius: 0; }
    .aes-video-controls {
        position: absolute;
        left: 0; right: 0; bottom: 0;
        padding: 8px 10px;
        gap: 8px;
        background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 100%);
        border-radius: 0;
        box-shadow: none;
    }
    .aes-video-watermark { height: 32px; max-width: 110px; top: 30px; right: 8px; }
    .aes-video-time { display: none; }
}
