/* ============================
   MODAL VIDEO
============================ */
#videoModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#videoModal.open {
    display: flex;
}

#playerBox {
    position: relative;
    max-width: 980px;
    width: 95%;
}

.close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    font-size: 38px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
}

/* ============================
   VIDEO PLAYER
============================ */
.video-js {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
}

/* ============================
   PLAYLIST
============================ */
.video-playlist {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.video-playlist img {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    flex-shrink: 0;
}

.video-playlist img:hover {
    transform: scale(1.08);
    box-shadow: 0 0 12px #38bdf8;
}

/* ============================
   BARRE DE CONTRÔLE
============================ */
.video-js .vjs-control-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: rgba(0,0,0,0.6);
    padding: 8px 12px;
    min-height: 44px; /* plus de confort */
}

.video-js .vjs-control {
    margin: 0 2px;
    align-self: center;
}

.video-js .vjs-button:hover {
    color: #38bdf8;
}

/* ============================
   BOUTONS -10S / +10S MODERNES
============================ */
.vjs-back10-button,
.vjs-forward10-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(56,189,248,0.15);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(56,189,248,0.5);
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(56,189,248,0.35);
    font-family: Arial, sans-serif;
}

/* Hover effet néon */
.vjs-back10-button:hover,
.vjs-forward10-button:hover {
    background: rgba(56,189,248,0.3);
    box-shadow: 0 0 16px rgba(56,189,248,0.8), 0 0 24px rgba(56,189,248,0.4);
    transform: translateY(-2px);
}

/* Flèche avec SVG intégré */
.vjs-back10-button::before,
.vjs-forward10-button::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    position: absolute;
    top: 8px;
}

/* Ajouter le SVG pour back et forward */
.vjs-back10-button::before {
    -webkit-mask-image: url('/assets/icons/back-arrow.svg');
    mask-image: url('/assets/icons/back-arrow.svg');
}
.vjs-forward10-button::before {
    -webkit-mask-image: url('/assets/icons/forward-arrow.svg');
    mask-image: url('/assets/icons/forward-arrow.svg');
}

/* Texte -10 / +10 en bas du cercle */
.vjs-back10-button::after {
    content: "-10";
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    position: absolute;
    bottom: 6px;
    text-shadow: 0 0 4px rgba(56,189,248,0.7);
}

.vjs-forward10-button::after {
    content: "10+";
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    position: absolute;
    bottom: 6px;
    text-shadow: 0 0 4px rgba(56,189,248,0.7);
}

/* Responsive */
@media (max-width: 768px) {
    .vjs-back10-button,
    .vjs-forward10-button {
        width: 44px;
        height: 44px;
    }
    .vjs-back10-button::after,
    .vjs-forward10-button::after {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .vjs-back10-button,
    .vjs-forward10-button {
        width: 36px;
        height: 36px;
    }
    .vjs-back10-button::after,
    .vjs-forward10-button::after {
        font-size: 10px;
    }
}


/* ============================
   MENU VITESSE VIDÉO
============================ */
.vjs-playback-rate {
    margin-left: 10px !important;
}

.vjs-playback-rate .vjs-menu-button {
    min-width: 50px;
    text-align: center;
}

.vjs-playback-rate .vjs-control {
    font-size: 13px;
    color: #fff;
    font-weight: bold;
}

.vjs-menu {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.vjs-menu-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 6px;
}

.vjs-menu-item {
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.vjs-menu-item:hover {
    background: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.vjs-menu-item.vjs-selected {
    background: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    font-weight: bold;
}

/* ============================
   OVERLAY PASSER L'INTRO
============================ */
.vjs-skip-overlay {
    position: absolute;
    bottom: 60px;
    left: 20px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 2px solid #38bdf8;
    border-radius: 6px;
    cursor: pointer;
    z-index: 9999;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.vjs-skip-overlay:hover {
    background: rgba(0, 0, 0, 0.85);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
    .vjs-back10-button,
    .vjs-forward10-button {
        width: 44px;
        height: 44px;
        font-size: 11px;
        margin: 0 4px;
    }

    .video-playlist img {
        width: 110px;
        height: 65px;
    }

    .vjs-skip-overlay {
        bottom: 50px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .vjs-back10-button,
    .vjs-forward10-button {
        width: 36px;
        height: 36px;
        font-size: 10px;
        margin: 0 2px;
    }

    .close-btn {
        font-size: 28px;
    }
}
/* ============================
   OVERLAY TITRE + DESCRIPTION
============================ */
.vjs-info-overlay {
    position: absolute;
    top: 16px;              /* EN HAUT */
    left: 20px;             /* À GAUCHE */
    right: auto;
    bottom: auto;

    background: none;       /* ❌ SUPPRIME LA BANDE NOIRE */
    padding: 0;             /* ❌ AUCUN BLOC */
    border-radius: 0;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-6px);
    z-index: 9998;

    max-width: 70%;
}

.vjs-info-overlay.visible {
    opacity: 1;
    transform: translateY(0);
}

/* TITRE */
.vjs-info-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.85);
}

/* DESCRIPTION */
.vjs-info-desc {
    font-size: 13px;
    color: #e5e7eb;
    opacity: 0.9;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}

/* Responsive */
@media (max-width: 768px) {
    .vjs-info-overlay {
        top: 12px;
        left: 14px;
        max-width: 85%;
    }

    .vjs-info-title {
        font-size: 15px;
    }

    .vjs-info-desc {
        font-size: 12px;
    }
}

/* ============================
   BOUTONS PREV / NEXT EPISODE
   ICÔNES |<  et  >|
   SVG INLINE – 100% LOCAL
============================ */
.vjs-prev-episode,
.vjs-next-episode {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(56,189,248,0.15);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(56,189,248,0.5);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(56,189,248,0.35);
    position: relative;
}

/* Hover */
.vjs-prev-episode:hover,
.vjs-next-episode:hover {
    background: rgba(56,189,248,0.3);
    box-shadow: 0 0 16px rgba(56,189,248,0.8);
    transform: translateY(-2px);
}

/* Icône commune */
.vjs-prev-episode::before,
.vjs-next-episode::before {
    content: "";
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* PREV |< */
.vjs-prev-episode::before {
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'>\
<path d='M6 5h2v14H6zM18 18l-8-6 8-6v12z'/>\
</svg>");
}

/* NEXT >| */
.vjs-next-episode::before {
    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'>\
<path d='M16 5h2v14h-2zM6 6l8 6-8 6V6z'/>\
</svg>");
}

/* Responsive */
@media (max-width: 768px) {
    .vjs-prev-episode,
    .vjs-next-episode { width: 44px; height: 44px; }
    .vjs-prev-episode::before,
    .vjs-next-episode::before { width: 18px; height: 18px; }
}
@media (max-width: 480px) {
    .vjs-prev-episode,
    .vjs-next-episode { width: 36px; height: 36px; }
    .vjs-prev-episode::before,
    .vjs-next-episode::before { width: 14px; height: 14px; }
}

/* ===== Catalogue regroupé et menu saisons/épisodes des animés ACE ===== */
.anime-catalog-card > img { cursor: pointer; width: 100%; object-fit: cover; }

#playerBox {
    position: relative;
    width: min(1400px, 96vw);
    max-width: 96vw;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.85fr);
    gap: 16px;
    align-items: start;
    overflow: hidden;
}
#playerBox .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
}
#playerBox > .video-js,
#playerBox > video,
#playerBox .video-js { width: 100%; max-width: 100%; }

#playerBox .video-playlist.anime-series-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-height: min(75vh, 720px);
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}
.anime-series-heading { margin: 0; font-size: 1.15rem; }
.anime-season-select {
    width: 100%; min-height: 42px; padding: 8px 10px;
    border-radius: 8px; border: 1px solid #444;
    background: #171717; color: #fff;
}
.anime-episode-list {
    display: flex; flex-direction: column; gap: 6px;
    overflow-y: auto; min-height: 0;
}
.anime-episode-button {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; padding: 10px; text-align: left; color: inherit;
    background: rgba(127,127,127,.12); border: 1px solid transparent;
    border-radius: 8px; cursor: pointer;
}
.anime-episode-button:hover,
.anime-episode-button.is-playing {
    border-color: #38bdf8; background: rgba(56,189,248,.14);
}
.anime-episode-number { font-weight: 700; }
.anime-episode-title { font-size: .9rem; opacity: .8; overflow-wrap: anywhere; }

@media (max-width: 850px) {
    #playerBox {
        grid-template-columns: minmax(0, 1fr);
        overflow-y: auto;
        max-height: 92vh;
    }
    #playerBox .video-playlist.anime-series-panel { max-height: 38vh; }
}
