@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');

/* --- Reset & Base --- */
body {
    margin: 0%;
    user-select: none;
}

/* --- PRELOADER (Écran de chargement) --- */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2e0352; /* Ton violet foncé */
    z-index: 100000; /* Au-dessus de TOUT, même du message mobile */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out; /* Pour une disparition en douceur */
}

.loader-content {
    text-align: center;
}

.loader-star {
    width: 60px;
    height: auto;
    /* Animation de rotation infinie */
    animation: spinStar 1.5s linear infinite; 
}

@keyframes spinStar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Classe utilitaire pour cacher le loader via JS */
.loader-hidden {
    opacity: 0;
    pointer-events: none; /* Permet de cliquer à travers pendant le fondu */
}

button {
    background-color: transparent;
    cursor: pointer;
    border: 0;
}

/* --- Background Video --- */
#videobg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    pointer-events: none;
}

/* --- Typography --- */
.text {
    font-family: Nunito;
    color: #48057E;
    margin: 0;
}

/* --- Animations Globales --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.slide-in-top {
    opacity: 0;
    margin-top: -50px;
    animation: slideTop 0.6s ease forwards;
}

@keyframes slideTop {
    to {
        opacity: 1;
        margin-top: 0;
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* --- BOUTON DÉBLOCAGE --- */
#unlockBtn {
    position: fixed;
    bottom: 20px;
    right: 20px; /* En bas à gauche */
    z-index: 9999; /* Au-dessus de tout */
    
    background-color: rgba(46, 3, 82, 0.8); /* Ton violet, un peu transparent */
    color: whitesmoke;
    border: 1px solid whitesmoke;
    border-radius: 5px;
    padding: 10px 15px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

#unlockBtn:hover {
    background-color: whitesmoke;
    color: #2e0352;
    transform: scale(1.05);
    opacity: 1;
}

/* Le fond obscurci derrière la fenêtre */
#customConfirmModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
    z-index: 10000; /* Tout devant */
    display: none;
    justify-content: center;
    align-items: center;
}

/* La fenêtre elle-même */
.modal-content {
    background-color: #E0F7FA; /* Un bleu très clair rappelant tes fenêtres de jeu */
    border: 4px solid #48057E;
    padding: 30px;
    width: 400px;
    text-align: center;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.2); /* Ombre "dure" style rétro */
    position: relative;
}

/* Les boutons OUI / NON */
.modal-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.btnModal {
    font-family: 'Pixelify Sans', sans-serif; /* Ta police pixel */
    font-size: 20px;
    padding: 10px 30px;
    border: 2px solid #48057E;
    background-color: white;
    color: #48057E;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btnModal:hover {
    background-color: #d63031;
    color: white;
    transform: scale(1.1);
}

/* Style spécifique pour le bouton OUI pour le différencier */
#confirmYes:hover {
    background-color: #a29bfe; /* Rouge au survol pour l'action destructive */
    border-color: #a29bfe;
}

/* --- Navigation & Planètes (Base) --- */
#nav {
    position: fixed;
    left: 2%;
    top: 2%;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.btnNav {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btnNav:hover {
    transform: scale(1.1);
}

#accueil {
    width: 100px;
    height: auto;
}

.planet {
    position: fixed;
    width: 40%;
    cursor: pointer;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- Onglets & Containers Communs --- */
.ongletWrappermid {
    width: 350px;
    position: fixed;
    top: 50%;
    left: 15%;
    transform: translate(-50%, -50%);
}

.ongletWrapperlarge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* width et height sont souvent gérés inline ou spécifique par page, 
       mais le centrage est global */
}

.ongletlarge, .ongletlong {
    width: 100%;
    height: auto;
    display: block;
}

.boutonfermer {
    position: absolute;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.25s ease;
}

.boutonfermer:hover {
    background-color: #9A0983;
}

.boutonfermer img {
    display: block;
}

#fermeronglet {
    position: absolute;
    display: none;
    right: 53px;
    top: 47.5px;
}

.explicationsplntContainer {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 300px;
    top: 19.8%;
    left: 5.57%;
}

/* --- Détails (Modal) --- */
#details {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 20;
}

#fermerdetails {
    position: absolute;
    right: 4.65%;
    top: 7.5%;
}

#contenudetails {
    position: fixed;
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 390px;
    width: 905px;
    transform: translate(-50%, -50%);
    padding: 1em;
    overflow: hidden;
    box-sizing: border-box;
    top: 55%; /* Ajusté selon ton code P1 */
    left: 50%;
}

#textedetails {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: 100%;
    width: 50%;
    overflow: auto;
    padding-right: 1em;
    box-sizing: border-box;
}

#logicielsContainer {
    display: flex;
    flex-direction: row;
    gap: 5px; /* Espace entre les logos */
    margin-top: 20px; /* Espace avec le texte au-dessus */
    flex-wrap: wrap;
}

.icon-logiciel {
    width: 75px; /* Taille des icônes */
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

#instant-tooltip {
    position: fixed; /* Pour suivre la souris n'importe où */
    display: none;   /* Caché par défaut */
    background-color: rgba(46, 3, 82, 0.95); /* Ton violet foncé presque opaque */
    color: whitesmoke;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    pointer-events: none; /* IMPORTANT : permet à la souris de passer au travers */
    z-index: 999999; /* Toujours au-dessus de tout */
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    white-space: nowrap; /* Empêche le texte de se couper */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Conteneur pour aligner flèches et image */
#carouselContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 50%;
    height: 100%;
    position: relative;
    margin-left: auto;
}

/* L'image du détail */
#imagedetails {
    flex: 1;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    user-select: none;
    min-width: 0;
}

#imagedetails:active {
    position: fixed;
    top: 50%;
    left: 50%;
    max-width: 90vw;
    max-height: 90vh;
    transform: translate(-50%, -50%) scale(1);
    z-index: 9999;
    cursor: zoom-out;
}

/* Les boutons de navigation */
.carousel-nav {
    background: rgba(72, 5, 126, 0.8);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    flex-shrink: 0;
}

.carousel-nav:hover {
    background: white;
    color: #48057E;
    transform: scale(1.1);
}

/* Cache les flèches si l'image est seule (géré par JS) */
.hidden-nav {
    display: none !important;
}

#contenudetails:has(#imagedetails:active) {
    overflow: visible;
}

#modalVideo {
    max-width: 40%;
    max-height: 100%;
    display: block;
    height: auto;
    width: 100%;
    margin-bottom: 1em;
}

/* --- Bouton Suite --- */
#suite {
    position: fixed;
    display: none;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    right: 9%;
    bottom: 38%;
}

#legendesuite {
    position: relative;
    background-color: #48057E;
    border-radius: 1em;
    width: 150px;
    height: 50px;
    opacity: 0;
    margin-bottom: 10px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#textelegendesuite {
    color: whitesmoke;
    position: absolute;
    left: 0%;
    top: 0%;
    padding: 15px;
}

#btnsuite {
    margin-top: 10px;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#btnsuite:hover {
    transform: scale(1.1);
}

/* --- Astuce Box --- */
.astuce {
    position: fixed;
    bottom: 0%;
    left: 0%;
    margin: 30px;
    padding: 10px;
    background-color: #9A0983;
    border-radius: 10px;
    width: 18%;
}

#resetBtn {
    position: fixed;
    bottom: 20px;
    right: 20px; /* En bas à droite */
    display: none;
    background-color: rgba(255, 255, 255, 0.6); /* Fond semi-transparent */
    color: #48057E; /* Ta couleur violette */
    border: 1px solid #48057E;
    border-radius: 20px;
    padding: 10px 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#resetBtn:hover {
    background-color: #48057E;
    color: whitesmoke;
    transform: scale(1.05);
}

/* --- BLOCAGE MOBILE --- */

/* 1. Par défaut, le message est caché sur ordi */
#mobile-warning {
    display: none;
}

/* 2. Si l'écran est petit (Tablettes et Mobiles) */
@media screen and (max-width: 1024px) {
    
    /* On cache le contenu principal du site pour éviter les bugs */
    /* On cible la vidéo, le nav, et les conteneurs principaux */
    #videobg, #nav, #systemeSolaire, #presentation, .planet, .planet4Container, #suite {
        display: none !important;
    }

    /* On affiche le message d'alerte en plein écran */
    #mobile-warning {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #2e0352; /* Ton violet foncé de fond */
        background-image: url('medias/Fond.png'); /* Optionnel : ton image de fond fixe */
        background-size: cover;
        z-index: 999999; /* Au-dessus de tout */
        
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
        box-sizing: border-box;
    }

    #mobile-warning h1 {
        font-family: 'Pixelify Sans', sans-serif;
        color: whitesmoke;
        font-size: 30px;
        margin-bottom: 20px;
    }

    #mobile-warning p {
        font-family: 'Nunito', sans-serif;
        color: whitesmoke;
        font-size: 18px;
        max-width: 80%;
        line-height: 1.5;
    }

    #mobile-warning img {
        margin-bottom: 20px;
        animation: float 3s ease-in-out infinite;
    }
}