/* ==========================================================================
   MAPS.CSS - Gestion unifiée des moteurs (2D, Windy, Globe-GL)
   ========================================================================== */

/* 1. CONTENEUR PRINCIPAL 
   S'assure que les cartes occupent tout l'espace sous le header */
   .maps-container {
    position: fixed;
    top: 60px; /* Hauteur de ton header */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000; /* Fond noir pour éviter les flashs blancs */
    overflow: hidden;
}

/* 2. STYLE GÉNÉRIQUE DES CONTENEURS DE CARTE */
.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Caché par défaut */
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* État actif géré par MapSwitcher.js */
.map-container.active {
    display: block;
    z-index: 2;
    opacity: 1;
}

/* 3. SPÉCIFICITÉS GLOBE.GL 
   On s'assure que le canvas Three.js ne dépasse jamais */
#map-globe-gl {
    background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%);
    cursor: grab;
}

#map-globe-gl:active {
    cursor: grabbing;
}

/* 4. SPÉCIFICITÉS WINDY 
   Windy a parfois besoin de forcer l'affichage de son propre canvas */
#windy {
    z-index: 1;
}

#windy.active {
    z-index: 2;
}

/* 5. OVERLAY PORTRAIT (MOBILE) 
   Empêche l'utilisation en paysage si nécessaire */
.portrait-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1e3a52;
    color: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.rotate-icon {
    font-size: 50px;
    margin-bottom: 20px;
    animation: rotatePhone 2s infinite;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* 6. NETTOYAGE DES RÉSIDUS (ANCIENS MOTEURS) 
   On s'assure qu'aucune classe de WebGL Earth ne traîne */
.we-container, .cesium-viewer, #map-globe {
    display: none !important;
    visibility: hidden !important;
}

/* 7. ADAPTATION MOBILE 
   Ajustement de la hauteur si le header change sur petit écran */
@media (max-width: 768px) {
    .maps-container {
        top: 50px; /* Header plus compact sur mobile */
    }
    
    /* On cache certains éléments UI de Leaflet trop encombrants */
    .leaflet-control-attribution {
        font-size: 8px !important;
    }
}