/* === ZONE 1 : GLOBAL (PAYSAGE) === */

/* TEST COULEUR */
/*body { background: red !important; }*/


html, body {
    margin: 0;
    padding: 0;
    overflow: hidden; 
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #012326;
    color: #a8dadc;
    transform: translateZ(0);
}

footer {
    text-align: center;
    font-size: 14px;
    color: #cccccc;
    padding: 12px 0;
    background: #0d0d0d;
    border-top: 1px solid #222;
    flex-shrink: 0;
}

.layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* === HEADER === */
.header {
    display: flex;
    flex-direction: column;
    height: 140px;
    flex-shrink: 0;
}

.header-bottom {
    height: 120px;
    background-color: #01444b;
    display: flex;
    align-items: center;
    overflow-y: hidden;
    overflow-x: auto;
    padding: 0 10px;
    gap: 10px;
}

.logo_ca {
    height: 40px;
}

.header-bottom img {
    width: 120px;
    height: auto;
    border-radius: 10px;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.header-bottom img:hover {
    border-color: #a8dadc;
}

/* === MAIN STRUCTURE === */
.main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    height: calc(100vh - 120px);
    margin: 0;
}

.titre-categorie {
    font-size: 0.85em;
    font-weight: bold;
    padding: 5px;
    background: #01393d;
}

.liste {
    width: 300px;
    background: #000000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin: 1;
}

#playlistWrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#liste {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    overflow-x: hidden;
}

.lecteur {
    flex-grow: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

#videoWrapper {
    position: relative;
    width: 100%;
    max-width: 1920px;
    height: 100%;
    background: black;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    background: black;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    display: block;
}

#posterImage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 2;
    display: block;
    background-color: black;
}

.item {
    padding: 10px;
    margin-bottom: 10px;
    background: #025860;
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item:hover {
    background: #03777d;
}

#recherche {
    width: 90%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: none;
}

.sous-texte {
    font-size: 0.7em;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
    line-height: 1.2em;
}

.fade-out {
    transition: opacity 2s ease;
    opacity: 0;
}

#video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === INDEX ALPHA LIST === */
#index-alpha-list {
    background-color: #111;
    color: #eee;
    padding: 1rem;
    max-height: 100%;
    overflow-y: auto;
    font-family: sans-serif;
}

#index-alpha-list h2 {
    font-size: 1.2rem;
    color: #0ff;
    margin-bottom: 1rem;
}

.index-entry {
    margin: 0.5rem 0;
    cursor: pointer;
    padding: 0.5rem;
    border-bottom: 1px solid #333;
}

.index-entry:hover {
    background-color: #222;
}

.index-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.index-mention {
    font-size: 0.85rem;
    color: #aaa;
}

#index-alpha-list {
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
}

/* === BOUTON FULLSCREEN (reste dans global) === */
#fullscreenButton {
    position: absolute;
    bottom: 20px;
    right: 25px;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    z-index: 10;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreenButton:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#fullscreenButton svg {
    display: block;
}




/* === AJUSTEMENT MOBILE PAYSAGE (hauteur réduite) FONCTION SPECIALE === */
/* Si l’écran est trop bas, on supprime totalement la bannière */
/* Supprimer totalement la bannière si l’écran est trop bas en paysage */
@media screen and (orientation: landscape) and (max-height: 350px) {
    .header {
        display: none !important;
    }
}

/* === 2 EME OPTION DESACTIVE - AJUSTEMENT MOBILE PAYSAGE (hauteur réduite) === */
/* Si l’écran est trop bas, on REDUIT la bannière 
@media screen and (orientation: landscape) and (max-height: 350px) {
    .header {
        height: 40px !important;
    }
    .header-bottom {
        height: 35px !important;
    }
}
*/



/* === ZONE 2 : PLEIN ÉCRAN === */

/* Masquer le bouton fullscreen natif */
video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

video::-moz-full-screen-button { 
    display: none !important;
}

/* HTML et BODY en plein écran */
html:-webkit-full-screen,
html:-moz-full-screen,
html:-ms-fullscreen,
html:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen,
body:fullscreen {
    margin: 0 !important;
    padding: 0 !important;
    background-color: black !important;
    overflow: hidden !important;
}

/* Wrapper vidéo en plein écran */
#videoWrapper:-webkit-full-screen,
#videoWrapper:-moz-full-screen,
#videoWrapper:-ms-fullscreen,
#videoWrapper:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    aspect-ratio: auto !important;
    background-color: black !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 2147483647 !important;
}

/* Vidéo et conteneur interne en plein écran */
#videoWrapper:fullscreen #video-container,
#videoWrapper:fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    position: static !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: black !important;
    display: block !important;
}

/* Bannière mécène en plein écran */
#videoWrapper:fullscreen .mecene-screen {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: black !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Image d'attente (poster) en plein écran */
#videoWrapper:fullscreen #posterImage {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: black !important;
}




/* === ZONE 3 : PORTRAIT (MOBILE) === */
@media screen and (orientation: portrait) {

    html, body {
        overflow: auto; /* Permet le défilement général sur petits écrans */
    }

    .main {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 120px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .lecteur {
        width: 100%;
        order: 1;
        flex: 0 0 40%; 
        height: 60%; 
        box-sizing: border-box;
    }

    .liste {
        width: 100%;
        order: 2;
        padding: 10px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        flex-basis: 0%;
        min-height: 0;
        box-sizing: border-box;
    }

    #playlistWrapper {
        flex-grow: 1;
        min-height: 0;
    }

    #liste {
        overflow-y: auto;
        overflow-x: hidden;
        flex-grow: 1;
        min-height: 0;
    }

    .zone-index {
        font-size: 2em;
        padding: 1em;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .zone-index button {
        margin: 0.4em;
        width: 3em;
        height: 3em;
        font-size: 1.5em;
    }

    /* Règles de tailles images mécènes regroupées ici */
    .img-mecene {
        width: 90%;
    }
}




