/*
Theme Name: Wifiblog VodsAndSeries
Author: Presta42
*/

body { 
    background: #050505;
    background-image: var(--main-bg-url, url('/wp-json/cpp/v1/fond'));
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    color: white; 
    font-family: 'Roboto', sans-serif; 
    margin: 0; 
    }
.bodyaccueil {
    display: flex; 
    width: 100vw;
    height: 100vh; 
    overflow: hidden; /* Empêche le rebond du site entier sur mobile */
}
hr {
    width: 100%;
}
#sidebar {
    width: 250px; 
    min-width: 250px; /* Important : empêche la sidebar de rétrécir */
    background: rgba(0, 0, 0, 0.9); 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid rgba(255,255,255,0.1); 
    z-index: 100;
    overflow-y: auto;
    scrollbar-color: grey #ffffff00;
    overflow-x: hidden;
    }
.actions::-webkit-scrollbar, #sidebar::-webkit-scrollbar, #main-container::-webkit-scrollbar, .row-content::-webkit-scrollbar { 
    display: none; 
}
.focusable {
    -webkit-tap-highlight-color: transparent; /* Supprime aussi le flash bleu sur mobile au clic */
}
.nav-item {
    padding: 15px 30px; 
    text-decoration: none; 
    color: #888;
    font-size: 1.1rem; 
    transition: 0.3s; 
    border-left: 4px solid transparent; 
    outline: none;
}
.nav-buton 
    { 
    width:50px; 
    margin-left: 15px; 
    border-color: #ffffff00;
    border: none; margin-top:10px;
    outline: none;
    box-shadow: none;
}
.nav-buton:focus, .nav-buton:hover
    { 
    background: #E91E63; 
    border-radius: 35px; 
    border-color: #ffffff00;
}
.nav-item:focus, .nav-item:hover {
    color: white; 
    background: rgba(233, 30, 99, 0.2); 
    border-left-color: #E91E63;
}
#main-container { 
    flex: 1; /* Prend TOUT l'espace restant après la sidebar */
    overflow-y: auto; 
    padding-top: 20px;
    margin: 0; /* Supprime toute marge qui créerait un écart */
    -webkit-overflow-scrolling: touch;
    scrollbar-color: grey #ffffff00;
}
.logo {
    text-align: end;
}
.logo img { 
    width:150px; 
    background: #ffffff70;
    border-radius: 74px;
    padding: 1px;
}
.sub-menu-container {
    display: none; 
    position: fixed; /* Changement ici : fixed au lieu de absolute */
    top: 60px;       /* Ajustez selon la hauteur de vos icônes */
    left: 230px;     /* Juste après le bord droit de la sidebar */
    background: #1a1a1a;
    border: 1px solid #E91E63;
    border-radius: 8px;
    width: 200px;
    z-index: 9999;   /* S'assure qu'il passe au-dessus de tout */
    box-shadow: 10px 10px 30px rgba(0,0,0,0.8);
    pointer-events: auto;
}
.sub-menu-container.active {
    display: flex;
    flex-direction: column;
}
.sub-notif-container {
    display: none; 
    position: fixed; /* Changement ici : fixed au lieu de absolute */
    top: 60px;       /* Ajustez selon la hauteur de vos icônes */
    left: 230px;     /* Juste après le bord droit de la sidebar */
    background: #1a1a1a;
    border: 1px solid #E91E63;
    border-radius: 8px;
    width: 200px;
    z-index: 9999;   /* S'assure qu'il passe au-dessus de tout */
    box-shadow: 10px 10px 30px rgba(0,0,0,0.8);
    pointer-events: auto;
}
.sub-notif-container.active {
    display: flex;
    flex-direction: column;
}
.sub-menu-item {
    padding: 15px 20px;
    color: #eee;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #333;
    transition: 0.2s;
}
.sub-menu-item:last-child { 
    border-bottom: none; 
}
.sub-menu-item:focus, .sub-menu-item:hover {
    background: #E91E63;
    color: white;
    outline: none;
}


.row { 
    margin: 20px 20px 40px 20px; 
}
.row-content { 
    display: flex; 
    overflow-x: auto; 
    overflow-y: hidden;
    gap: 20px; 
    padding: 20px; 
    -webkit-overflow-scrolling: touch;
    scrollbar-color: grey #ffffff00;
    scroll-behavior: smooth;
    will-change: scroll-position; 
    touch-action: pan-x;
}
.row-title { 
    font-size: 1.6rem; 
    margin-bottom: 10px; 
    color: #eee; 
    text-transform: uppercase; 
}
.unavailable { 
    filter: grayscale(1);
}
.logochaine {
    width: 100px;
    height: 100px;
    aspect-ratio: 2 / 3;
    background: #ffffffa8;
    border: 4px solid transparent;
    transition: 0.3s;
    border-radius: 10px;
    flex-shrink: 0;
    position: relative;
    text-decoration: none;
    display: block;
    overflow: hidden;
    outline: none;
}
.tile {
    min-width: 150px; 
    width: 150px; 
    aspect-ratio: 2/3;
    background: #1a1a1a; 
    border: 4px solid transparent;
    transition: 0.3s; 
    border-radius: 10px; 
    flex-shrink: 0; 
    position: relative;
    text-decoration: none; 
    display: block; 
    overflow: hidden; 
    outline: none;
}
.tileSeries {
    min-width: 100px; 
    width: 100px; 
    aspect-ratio: 2/3;
    background: #1a1a1a; 
    border: 4px solid transparent;
    transition: 0.3s; 
    border-radius: 10px; 
    flex-shrink: 0; 
    position: relative;
    text-decoration: none; 
    display: block; 
    overflow: hidden; 
    outline: none;
}
.tile:focus, .tile:hover, .logochaine:focus, .logochaine:hover .tileSeries:focus, .tileSeries:hover {
    transform: scale(1.1); 
    border-color: #E91E63; 
    z-index: 10;
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.5);
}
.tile img, .tileSeries img  { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.badge-saga { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background: #E91E63; 
    color: white; 
    padding: 3px 8px; 
    border-radius: 5px; 
    font-size: 11px;
}


.bg-container {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    filter: blur(20px); 
    opacity: 0.3; 
    z-index: -1;
    }
.details-wrapper { 
    display: flex; 
    flex-direction: column; 
    padding: 50px 5%; 
    box-sizing: border-box; 
    min-height: 100vh;
    }
.main-info { 
    display: flex; 
    gap: 40px; 
    background: rgba(25, 104, 110, 0.6); 
    padding: 40px; 
    border-radius: 20px; 
    flex-wrap: wrap; 
}
.poster { 
    max-width: 200px;
    max-height: 300px;
    aspect-ratio: 2/3;
    object-fit: cover; 
    border-radius: 10px; 
    box-shadow: 0 0 30px rgba(0,0,0,0.8); 
    flex-shrink: 0;
}
.content-info { 
    flex: 1; 
    min-width: 250px; /* Sécurité pour le responsive */
    }
.content-info h1 { 
    font-size: 3.5rem; 
    margin: 0 0 10px 0; 
    font-weight: 900; 
}
.content-info .meta { 
    font-size: 1.2rem; 
    color: #aaa; 
    margin-bottom: 20px; 
}
.content-info .description { 
    font-size: 1rem; 
    line-height: 1.2; 
    margin-bottom: 30px;
    color: #eee;
    }        
.description {
    max-height: 300px; /* Hauteur confortable sur TV */
    overflow-y: hidden; /* On cache la barre de défilement native */
    line-height: 1.6;
    position: relative;
    padding-right: 10px;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    scrollbar-color: grey #ffffff00;
}

.actions { 
    display: flex; 
    gap: 15px; 
    flex-wrap:nowrap;
    overflow-x: auto; /* Si trop de boutons, ils passent à la ligne */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Force l'inertie et le scroll fluide sur WebView */
    scroll-behavior: smooth;
    will-change: scroll-position; 
    padding:5px;
    touch-action: pan-x;
    scrollbar-color: grey #ffffff00;
    }
.btn { 
    padding: 14px 28px; 
    background: rgba(255,255,255,0.1); 
    border: 3px solid transparent; 
    border-radius: 10px; 
    cursor: pointer; 
    color: white; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    transition: all 0.3s; 
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
    }
.btn:focus, .btn:hover { 
    background: #E91E63; 
    border-color: white; 
    transform: scale(1.05); 
    outline: none; 
}
.btn img { 
    width: 22px; 
    height: 22px; 
}
.actor-card, .btn {
    flex-shrink: 0; /* Empêche le WebView d'écraser les éléments pour les faire tenir */
}
/* Empêche les cartes d'être coupées net */
.actor-card {
    flex: 0 0 auto; /* Empêche l'écrasement des cartes */
    width: 150px;
    outline: none;
}
.actor-card img { 
    width: 140px; 
    height: 140px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid transparent; 
    transition: 0.3s; 
}
.actor-card:focus img { 
    border-color: #E91E63; 
    transform: scale(1.1); 
}
.actor-name { 
    margin-top: 10px; 
    font-size: 0.9rem; 
    font-weight: bold; 
}
.actor-char { 
    font-size: 0.8rem; 
    color: #888; 
}



@media (pointer: coarse), (pointer: none) {
    .row-content {
        scrollbar-width: none; /* Firefox */
    }
    .row-content::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
}
@media (pointer: fine) {
            .row-content { scrollbar-width: thin; }
            .row-content::-webkit-scrollbar { height: 6px; display: block; }
            .row-content::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
            #sidebar { scrollbar-width: thin; overflow-y: scroll; }
            #sidebar::-webkit-scrollbar { height: 6px; display: block; }
            #sidebar::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
            #main-container { scrollbar-width: thin; overflow-y: scroll; }
            #main-container::-webkit-scrollbar { height: 6px; display: block; }
            #main-container::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }
        }
@media (max-width: 950px) {
            body { }
    #sidebar {
        width: 230px; /* On réduit un peu la largeur sur mobile pour gagner de la place */
        min-width: 180px;
    }
    
    .nav-item {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .tile {
        min-width: 100px; /* Agrandit les affiches pour l'effet "zoom" */
        width: 100px;
    }
    
    .row-title { font-size: 1.2rem; }
}




/* 1. CONTENEUR PRINCIPAL (SPLIT LAYOUT) */
.netflix-layout {
    display: flex;
    width: 95%;
    height: 70vh; /* Hauteur fixe pour permettre le scroll interne */
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden; /* Empêche le scroll global de la page d'interférer */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 2. COLONNE GAUCHE : SAISONS */
.sidebar-saisons {
    width: 300px;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto; /* Scroll interne si beaucoup de saisons */
    border-right: 2px solid rgba(255, 255, 255, 0.05);
    -webkit-overflow-scrolling: touch;
    scrollbar-color: grey #ffffff00;
}

/* Éléments Saisons */
.saison-nav-item {
    display: block;
    width: 100%;
    padding: 18px 25px;
    font-size: 1.2rem;
    color: #aaa;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Focus sur Saison */
.saison-nav-item:focus {
    color: #fff;
    background: #E91E63; /* Couleur Netflix-style */
    transform: scale(1.05);
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.4);
}

/* 3. COLONNE DROITE : ÉPISODES */
.content-episodes {
    flex-grow: 1;
    padding: 20px 40px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    -webkit-overflow-scrolling: touch;
    scrollbar-color: grey #ffffff00;
}

/* Conteneur de la liste d'épisodes (un par saison) */
.episodes-list-container {
    display: none; /* Géré par le JS au focus */
    flex-direction: column;
    gap: 10px;
}

/* Éléments Épisodes */
.episode-list-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Focus sur Épisode */
.episode-list-item:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #E91E63;
    outline: none;
    transform: translateX(10px); /* Petit décalage vers la droite au focus */
}

/* Icônes et Textes dans l'épisode */
.ep-play-icon {
    margin-right: 20px;
    font-size: 1.2rem;
    color: #E91E63;
}

.ep-title {
    font-size: 1.15rem;
    color: #eee;
    font-weight: 400;
}

/* 4. SCROLLBARS (Pour WebView Android / TV) */
/* On cache les barres pour un look "App" mais on garde le défilement */
.sidebar-saisons::-webkit-scrollbar,
.content-episodes::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* 5. SÉCURITÉ : Éviter les éléments fantômes */
/* Si une liste n'est pas affichée, ses éléments ne doivent pas capter le focus */
.episodes-list-container:not([style*="display: block"]) {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}




#cpm-notif-container { position: fixed; bottom: 20px; right: 20px; z-index: 999999; font-family: sans-serif; }
            #cpm-btn { 
                background: #0073aa; color: white; width: 56px; height: 56px; border-radius: 50%; 
                display: flex; align-items: center; justify-content: center; cursor: pointer; 
                box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: transform 0.3s;
            }
            #cpm-btn:hover { transform: scale(1.1); }
            #cpm-badge { 
                position: absolute; top: 0; right: 0; background: #d63638; color: white; 
                font-size: 11px; padding: 2px 6px; border-radius: 10px; border: 2px solid white;
            }
            #cpm-window { 
                display: none; position: absolute; bottom: 70px; right: 0; width: 320px; 
                max-height: 400px; background: white; border-radius: 8px; overflow: hidden;
                box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid #ddd;
            }
            #cpm-window-header { background: #f6f7f7; padding: 12px; border-bottom: 1px solid #ddd; font-weight: bold; display: flex; justify-content: space-between; }
            .cpm-notif-item { padding: 12px; font-size: 13px; position: relative; }
            .cpm-notif-title { font-weight: 600; display: block; margin-bottom: 3px; }
            #cpm-empty { padding: 20px; text-align: center; color: #666; } 



/* Personnalisation des couleurs de la barre */
.video-js .vjs-play-progress { background-color: #e74c3c; }
.video-js .vjs-control-bar { background: rgba(0, 0, 0, 0.7); height: 4em; align-items: center; }


.Connexion {
        background-color: #ffffff;
        width: 60%;
        margin-left: calc(20%);
        margin-top: 10px;
        margin-bottom: 10px;
    }
    .container {
        clear: both;
        border-radius: 10px;
        padding: 20px;
    }
    .titreform { font-size: xx-large;
                    text-align: center;
                    color: black;
                    margin: 15px; }
    .messageAccueil { color: blue;
                    padding: 10px;
                    text-align: center; }
    .divForm { border: 1px solid gray;
                    border-radius: 5px;
                    padding: 10px;
                    margin-bottom: 10px; }
    * {
        box-sizing: border-box;
    }
    .login-username, .login-password, .login-submit, .login_keyparrain, .login-email {
        box-sizing: inherit;
    }
    .login-username > .input, .login-password > .input, .login-keyparrain > .input, .login-email > .input {
        padding: 12px;
        color: #898989;
        border: 1px solid #e3e3e3;
        border-radius: 0px;
        background: #f2f2f0;
        font-size: 13px;
        margin: 0 0 10px;
        width: 100%;
        font-family: "Lato", Georgia, serif;
        line-height: 1.5;
        font: inherit;
    }
    .login-submit > .button {
        text-align-last: center;
        width: 100%;
        text-align: left;
        padding: 10px 5px;
        color: #fff;
        background-color: #000;
    }
    .button:hover {
        background-color: #272727;
    }