/* ===== ESTILOS BASE ===== */
html, body {
    height: 100%;
    margin: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* ===== CONTROLES DESLIZANTES ===== */
.sliders-container {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 1000;
    pointer-events: none;
}

.slider-block {
    background: rgba(0,0,0,0.45);
    padding: 8px 12px;
    border-radius: 8px;
    pointer-events: auto;
    color: white;
    font-family: sans-serif;
    max-width: 90%;
}

input[type=range] {
    width: 260px;
}

.label {
    text-align: center;
    margin-bottom: 4px;
    font-size: 13px;
}

.ticks {
    width: 260px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 3px;
    pointer-events: none;
}

/* ===== BOTONES PRINCIPALES ===== */
#toggleMapBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
}

#toggleMapBtn:hover {
    background: rgba(0,0,0,0.9);
}

/* ===== ESTILOS PARA MÓVILES ===== */
@media screen and (max-width: 768px) {
    #toggleMapBtn {
        top: 15px;
        right: 8px; 
        padding: 8px 12px; 
        font-size: 12px; 
        max-width: 100px; 
        text-align: right; 
        white-space: normal; 
        line-height: 1.3; 
        word-break: break-word;
    }
}

#toggleSlidersBtn {
    position: absolute;
    bottom: 70px;
    right: 20px;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-width: 60px;
    text-align: center;
}

/* ===== MODOS DE MAPA ===== */
.map-spectral-only {
    display: none;
}

.map-spectral-mode {
    background-color: black !important;
}

/* ===== ESTILOS DE ETIQUETAS ===== */
.geojson-label {
    background: transparent;
    border: none;
    box-shadow: none;
    font-family: sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: #333333;
    text-shadow: -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white, 1px 1px 0 white;
    pointer-events: none;
    z-index: 1002;
}

.point-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-family: sans-serif;
    font-size: 11px !important;
    font-weight: bold;
    font-style: italic;
    color: white !important;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    pointer-events: none;
    text-align: center;
    z-index: 1003;
    transform: translateY(-10px);
}

.svg-custom-icon {
    transition: opacity 0.3s ease-in-out;
    z-index: 1001;
}

/* ===== POPUPS ===== */
.spectral-popup .leaflet-popup-content-wrapper {
    background: #2d3436;
    color: white;
    border-radius: 8px;
}

.spectral-popup .leaflet-popup-content {
    color: white;
    margin: 8px 12px;
}

.spectral-popup .leaflet-popup-tip {
    background: #2d3436;
}

/* ===== ESTILOS DE CONTROL URBANO (ÚLTIMAS DEFINICIONES) ===== */
.toggle-controls-urban {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 2px solid #cccccc !important;
}

.toggle-controls-urban:hover {
    background-color: #f4f4f4 !important;
    color: #333333 !important;
}

.toggle-controls-urban:active {
    background-color: #e0e0e0 !important;
}

.info-button-urban {
    background-color: #ffffff !important;
    color: #0078A8 !important;
    border: 2px solid #cccccc !important;
}

.info-button-urban:hover {
    background-color: #f4f4f4 !important;
    color: #005580 !important;
}

.info-button-urban:active {
    background-color: #e0e0e0 !important;
}

.leaflet-control-zoom.urban-zoom a {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 2px solid #cccccc !important;
}

.leaflet-control-zoom.urban-zoom a:hover {
    background-color: #f4f4f4 !important;
    color: #000000 !important;
}

.leaflet-control-zoom.urban-zoom a:active {
    background-color: #e0e0e0 !important;
}

/* ===== ESTILOS DE CONTROL ESPECTRAL (ÚLTIMAS DEFINICIONES) ===== */
.toggle-controls-spectral {
    background-color: #333333 !important;
    color: #ffffff !important;
    border: 2px solid #666666 !important;
}

.toggle-controls-spectral:hover {
    background-color: #444444 !important;
    color: #ffffff !important;
}

.toggle-controls-spectral:active {
    background-color: #555555 !important;
}

.info-button-spectral {
    background-color: #333333 !important;
    color: #87CEEB !important;
    border: 2px solid #666666 !important;
}

.info-button-spectral:hover {
    background-color: #444444 !important;
    color: #a3d9f5 !important;
}

.info-button-spectral:active {
    background-color: #555555 !important;
}

.leaflet-control-zoom.spectral-zoom a {
    background-color: #333333 !important;
    color: #ffffff !important;
    border: 2px solid #666666 !important;
}

.leaflet-control-zoom.spectral-zoom a:hover {
    background-color: #444444 !important;
    color: #ffffff !important;
}

.leaflet-control-zoom.spectral-zoom a:active {
    background-color: #555555 !important;
}

/* ===== SCROLLBARS ===== */
.spectral-combined-control::-webkit-scrollbar,
.mancha-urbana-text-control::-webkit-scrollbar {
    width: 8px;
}

.spectral-combined-control::-webkit-scrollbar-track {
    background: #444444;
    border-radius: 4px;
}

.spectral-combined-control::-webkit-scrollbar-thumb {
    background: #666666;
    border-radius: 4px;
}

.spectral-combined-control::-webkit-scrollbar-thumb:hover {
    background: #888888;
}

.mancha-urbana-text-control::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.mancha-urbana-text-control::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

.mancha-urbana-text-control::-webkit-scrollbar-thumb:hover {
    background: #aaaaaa;
}

/* ===== FUNCIONALIDAD PARA MÓVIL VERTICAL ===== */
.mobile-only {
    display: none;
}

.sliders-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}

@media (max-width: 768px) and (orientation: portrait) {
    .mobile-only {
        display: block;
    }
    
    .sliders-container {
        display: none !important;
        bottom: 20px;
        pointer-events: none;
    }
    
    .sliders-container.active {
        display: flex !important;
    }
    
    .sliders-container.active + .sliders-overlay {
        display: block;
    }
}

@media (max-width: 600px) {
    input[type=range] {
        width: 200px;
    }
    .ticks {
        width: 200px;
        font-size: 9px;
    }
}

/* ===== ESTADOS DE BLOQUEO (ÚLTIMAS DEFINICIONES) ===== */
#toggleSlidersBtn.hidden-by-lock {
    display: none !important;
}

.controls-locked .sliders-container {
    display: none !important;
}

.controls-locked #toggleSlidersBtn {
    display: none !important;
}

.controls-locked .sliders-overlay {
    display: none !important;
}

/* ===== OTROS ESTILOS ===== */
.leaflet-marker-icon {
    position: absolute;
}

        #compareBtn {
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1000;
            width: 32px;
            height: 32px;
            padding: 0;
            border: none;
            background: transparent;
            cursor: pointer;
            transition: all 0.2s ease;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }
        
        #compareBtn svg {
            width: 100%;
            height: 100%;
            display: block;
        }
        
        #compareBtn:hover {
            transform: translateX(-50%) scale(1.1);
            filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
        }
        
        #compareBtn:active {
            transform: translateX(-50%) scale(0.95);
        }
        
        /* El botón original se mantiene en su posición */
        #toggleMapBtn {
            top: 8px;
        }
        
        /* Estilos para el logo NE */
        #naSVG {
            position: fixed;
            top: 5px;
            left: 50px;
            z-index: 1000;
            width: 50px;
            height: 50px;
            pointer-events: none; /* Para que no interfiera con clics en el mapa */
        }
        
        #naSVG:hover {
            opacity: 1;
        }
        
        #naSVG svg,
        #naSVG img {
            width: 100%;
            height: 100%;
            display: block;
        }
        
        /* Ajuste para dispositivos móviles */
        @media (max-width: 768px) {
            #naSVG {
                top: 5px;
                left: 50px;
                width: 40px;
                height: 40px;
            }
        }

        /* ── Navegación entre popups ─────────────────────── */
.leaflet-popup-content-wrapper {
    overflow: visible !important; /* permite que los botones sobresalgan */
}

.popup-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    z-index: 1000;
    transition: opacity .15s, transform .15s;
    line-height: 1;
    padding: 0;
}
.popup-nav-btn:hover {
    opacity: .85;
    transform: translateY(-50%) scale(1.1);
}
.popup-nav-btn.prev { left: -26px; }
.popup-nav-btn.next { right: -26px; }

/* Estilo: mancha urbana */
.leaflet-popup:not(.spectral-popup) .popup-nav-btn {
    background: #ffffff;
    color: #e040fb;          
    border: 1.5px solid #b3b3b3;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* Estilo: firma espectral (hereda colores de los botones del carrusel) */
.spectral-popup .popup-nav-btn {
    background-color: #333333;
    color: #87CEEB;
    border: 2px solid #666666;
    box-shadow: 0 1px 6px rgba(0,0,0,.4);
}