/* ==========================================
GEOPORTAL UAEMÉX 2.0
Estilo moderno tipo ArcGIS / Mapbox
========================================== */

:root{

 
--primary:#0F766E;
--primary-dark:#115E59;
--secondary:#14B8A6;
--accent:#F59E0B;
--dorado:#C8A75D;

--bg:#F8FAFC;
--surface:#FFFFFF;

--text:#1F2937;
--muted:#6B7280;

--border:#E5E7EB;

--shadow:
    0 10px 25px rgba(0,0,0,.08);
 

}

*{
box-sizing:border-box;
}

body{

 
margin:0;

overflow:hidden;

font-family:'Inter',sans-serif;

background:var(--bg);
 

}

/* ====================================
HEADER
==================================== */

.topbar{

 
position:absolute;

top:0;
left:0;
right:0;

height:70px;

z-index:3000;

background:rgba(255,255,255,.95);

backdrop-filter:blur(12px);

box-shadow:
    0 4px 20px rgba(0,0,0,.08);

display:flex;

justify-content:space-between;

align-items:center;

padding:0 25px;
border-bottom:4px solid var(--dorado);
 

}

.left-header{

 
display:flex;

align-items:center;

gap:15px;
 

}

.left-header a{

 
color:var(--primary);

font-size:20px;
 

}

.logo{

 
height:42px;
 

}

.title{

 
font-weight:700;

color:var(--text);

letter-spacing:.5px;
 

}

.right-header{

 
display:flex;

align-items:center;
 

}

#buscarCapa{

 
width:320px;

border:none;

background:#F3F4F6;

border-radius:999px;

padding:12px 18px;
 

}

#buscarCapa:focus{

 
outline:none;

background:white;

box-shadow:
    0 0 0 4px rgba(20,184,166,.15);
 

}

/* ====================================
MAPA
==================================== */

#map{

 
position:absolute;

top:0;
left:0;
right:0;
bottom:0;

z-index:1;
 

}

/* ====================================
SIDEBAR EXPERIENCE BUILDER
==================================== */

/*
/*Barra completa
#sidebarContainer{
    position:absolute;
    top:85px;
    left:50px;
    bottom:15px;
    display:flex;
    z-index:2000;
}
*/

#sidebarContainer{
    position:absolute;
    top:85px;
    left:50px;
    z-index:2000;
    display:flex;
    align-items:flex-start;
}

/*
/*Barra de menu
#sidebarMenu{
    width:60px;
    background:white;
    border-radius:20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
    padding:10px 0;
}
*/

#sidebarMenu{

    width:55px;
    height:auto;
    background:white;
    border-radius:20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:10px;
    padding:10px 0;
}



.menu-btn{
    width:42px;
    height:42px;
    border:none;
    border-radius:12px;
    background:white;
    cursor:pointer;
    transition:.25s;
    position:relative;
}

.menu-btn:hover{

 
background:#E6FFFA;

color:var(--primary);
 

}

.menu-btn.active{

 
background:var(--primary);

color:white;
 

}

#sidebar{
    width:320px;
    margin-left:10px;
    background:rgba(255,255,255,.95);
    backdrop-filter:blur(12px);
    border-radius:20px;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    display:flex;
    flex-direction:column;
    height:calc(100vh - 100px);
    overflow:hidden;
    transition:.3s;
    transition: width .3s ease, opacity .3s ease;
}

#sidebar.collapsed{ 
    width:0;
    margin-left:0;
    opacity:0;
    overflow:hidden;
}

.sidebar-title{
    padding:18px;
    font-weight:700;
    border-bottom:2px solid var(--dorado);
    display:flex;
    align-items:center;
    gap:10px;
    flex-shrink:0;
}

/* ====================================
CAPAS
==================================== */

.group{

 
margin:10px;
 

}

.group-header{

 
background:#F8FAFC;

border-radius:12px;

padding:14px;

display:flex;

justify-content:space-between;

cursor:pointer;

transition:.25s;

font-weight:600;
 

}

.group-header:hover{

 
background:#E6FFFA;
 

}

.group-content{

 
padding:10px 15px;
 

}

.layer-item{

 
display:flex;

align-items:center;

gap:10px;

padding:10px;

border-radius:10px;

transition:.25s;
 

}

.layer-item:hover{

 
background:#F3F4F6;
 

}

/* ====================================
BASEMAP PANEL
==================================== */

#basemapPanel{

 
position:absolute;

right:20px;

bottom:20px;

z-index:2000;

background:white;

border-radius:16px;

padding:10px;

box-shadow:var(--shadow);
 

}

/* ====================================
PANEL DE INFORMACIÓN
==================================== */

#bottomPanel{

 
position:absolute;

left:95px;

right:20px;

bottom:20px;

height:320px;

background:white;

border-radius:20px;

overflow:hidden;

display:none;

z-index:2500;

box-shadow:
    0 20px 50px rgba(0,0,0,.15);
 

}

.panel-header{

 
height:50px;

background:
    linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );

color:white;

display:flex;

justify-content:space-between;

align-items:center;

padding:0 20px;
 

}

#closePanel{

 
background:none;

border:none;

color:white;

cursor:pointer;

font-size:18px;
 

}

.panel-body{

 
display:flex;

gap:25px;

padding:20px;
 

}

.panel-content{
    flex:1;
    overflow-y:auto;
    overflow-x:hidden;
    padding:0 10px 20px 10px;
    display: none;
    height: 100%;
    position:relative;
    opacity:0;
    transform:translateX(15px);
    transition:.25s;
}

.panel-content::after{
    content:"";
    position:absolute;
    bottom:0px;
    left:50%;
    transform:translateX(-50%);
    width:120px;
    height:50px;
    background:url('../img/administracion.png') no-repeat center;
    background-size:contain;
    opacity:1;
    pointer-events:none;
}

.panel-content.active{
    display:flex;
    flex-direction:column;
    opacity:1;
    transform:translateX(0);
}

.photo img{

 
width:280px;

height:180px;

object-fit:cover;

border-radius:15px;
 

}

.info{

 
flex:1;
 

}

.chart{

 
width:350px;
 

}

/* ====================================
TABLAS
==================================== */

.table{

 
margin-bottom:0;
 

}

.table thead{

 
background:#F8FAFC;
 

}

.table th{

 
border:none;
 

}

.table td{

 
border-color:#F1F5F9;
 

}

/* ====================================
LEAFLET
==================================== */

.leaflet-control{

 
border:none !important;

border-radius:14px !important;

overflow:hidden;

box-shadow:
    0 8px 20px rgba(0,0,0,.12);
 

}

.leaflet-bar a{

 
border:none !important;

width:38px;

height:38px;

line-height:38px;
 

}

.leaflet-popup-content-wrapper{

 
border-radius:14px;
 

}

/* ====================================
SCROLL
==================================== */

::-webkit-scrollbar{

 
width:8px;
 

}

::-webkit-scrollbar-thumb{

 
background:#CBD5E1;

border-radius:20px;
 

}

::-webkit-scrollbar-track{

 
background:#F1F5F9;
 

}

/* ====================================
RESPONSIVE
==================================== */

@media(max-width:900px){

 
#sidebar{
    width:280px;
}

#bottomPanel{

    left:15px;

    right:15px;

    height:350px;

}

.panel-body{

    flex-direction:column;

    overflow:auto;

}

.photo img{

    width:100%;

    height:200px;

}
 

}

/* ====================================
   TREE LAYERS
==================================== */

#treeLayers{
    padding:10px;
    max-height:calc(100vh - 220px);
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:5px;
}

/* Grupo */

.grupo{

    margin-bottom:12px;

    border:1px solid #E5E7EB;

    border-radius:14px;

    overflow:hidden;

    background:white;

    box-shadow:
        0 2px 8px rgba(0,0,0,.04);

}

/* Título */

.grupo-title{

    padding:14px 16px;

    font-size:14px;

    font-weight:600;

    color:#1F2937;

    background:#F8FAFC;

    border-bottom:1px solid #E5E7EB;

    cursor:pointer;

    transition:.25s;
    display:flex;
    justify-content:space-between;
    align-items:center;

}

.grupo-title:hover{

    background:#ECFDF5;

    color:#0F766E;

}

/* Contenido */

.grupo-content{

    padding:8px;

}

/* Layer */

.layer-item{

    display:flex;

    align-items:center;

    gap:12px;

    padding:10px 12px;

    border-radius:10px;

    cursor:pointer;

    font-size:14px;

    color:#374151;

    transition:.25s;

}

.layer-item:hover{

    background:#F3F4F6;

}

/* Checkbox */

.layer-item input[type="checkbox"]{

    width:18px;

    height:18px;

    cursor:pointer;

    accent-color:#0F766E;

}

/* Checkbox activo */

.layer-item:has(input:checked){

    background:#ECFDF5;

    color:#0F766E;

    font-weight:500;

}

/* Animación */

.grupo{

    transition:.25s;

}

.grupo:hover{

    transform:translateY(-1px);

}

/* Scroll moderno */

.panel-content::-webkit-scrollbar{
    width:6px;
}

.panel-content::-webkit-scrollbar-thumb{
    background:#CBD5E1;
    border-radius:20px;
}

.panel-content::-webkit-scrollbar-thumb:hover{
    background:#94A3B8;
}

/*
    Checkboxes redondos modernos
*/

.layer-item input[type="checkbox"]{
    appearance:none;
    -webkit-appearance:none;
    width:20px;
    height:20px;
    border-radius:50%;
    border:2px solid #CBD5E1;
    cursor:pointer;
    transition:.25s;
    position:relative;
    flex-shrink:0;
}

.layer-item input[type="checkbox"]:checked{
    background:var(--primary);
    border-color:var(--primary);
}

.layer-item input[type="checkbox"]:checked::after{
    content:"";
    position:absolute;
    width:6px;
    height:10px;
    border:solid white;
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
    left:6px;
    top:2px;
}

/* Eliminar el border-radius de los controles de Leaflet */
.leaflet-control-scale.leaflet-control {
    border-radius: 0 !important;
}

/*
    Estilo del botón descargar
*/
.layer-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.layer-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.download-btn{
    border:none;
    background:transparent;
    width:32px;
    height:32px;
    border-radius:8px;
    cursor:pointer;
    color:#64748B;
    transition:.25s;
}

.download-btn:hover{
    background:#F1F5F9;
    color:var(--primary);
}

.layer-actions{
    display:flex;
    gap:5px;
}

.layer-item.active{
    background:#E6FFFA;
    border-left: 4px solid var(--primary);
}

/* ======================================
   MANUAL DE USUARIO
====================================== */

.manual-content{
    padding:20px;
    overflow-y:auto;
    max-height: calc(100vh - 220px);
}

.manual-welcome{

    display:flex;

    gap:15px;

    align-items:flex-start;

    background:linear-gradient(
        135deg,
        #0F766E,
        #14B8A6
    );

    color:white;

    padding:20px;

    border-radius:18px;

    margin-bottom:20px;

}

.manual-welcome i{

    font-size:32px;

    opacity:.9;

}

.manual-welcome h4{

    margin:0 0 10px;

}

.manual-welcome p{

    margin:0;

    opacity:.95;

}

/* ===================== */

.manual-section{

    background:white;

    border:1px solid #E5E7EB;

    border-radius:16px;

    padding:18px;

    margin-bottom:15px;

    transition:.25s;

}

.manual-section:hover{

    box-shadow:
        0 5px 15px rgba(0,0,0,.08);

}

.manual-section h5{

    margin-bottom:12px;

    display:flex;

    align-items:center;

    gap:10px;

    color:#0F766E;

    font-weight:600;

}

.manual-section ul{

    margin:0;

    padding-left:20px;

}

.manual-section li{

    margin-bottom:8px;

    color:#475569;

    line-height:1.5;

}

/* ===================== */

.manual-contact{

    display:flex;

    gap:15px;

    background:#F8FAFC;

    border:1px solid #E2E8F0;

    border-radius:16px;

    padding:18px;

    margin-top:20px;

}

.manual-contact i{

    color:#0F766E;

    font-size:24px;

}

.manual-contact p{

    margin-top:5px;

    color:#64748B;

}

/* ===================== */

#manual{

    height:100%;

    overflow-y:auto;

}

#manual::-webkit-scrollbar{

    width:6px;

}

#manual::-webkit-scrollbar-thumb{

    background:#CBD5E1;

    border-radius:20px;

}

.d-none-layer{
    display:none !important;
}

/* =====================================
   LEYENDA
===================================== */

.legend-control{
    min-width:220px;
    max-width:280px;
    background:rgba(255,255,255,.95);
    backdrop-filter:blur(12px);
    border-radius:18px;
    box-shadow:  0 10px 30px rgba(0,0,0,.15);
    overflow:hidden;
    border:1px solid rgba(255,255,255,.5);
}

/* Cabecera */

.legend-control .control-header{
    padding:14px 16px;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );
    color:white;
    font-size:14px;
    font-weight:600;
}

/* Contenido */

.legend-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 14px;
    font-size:13px;
    color:#334155;
    transition:.2s;
}

.legend-item:hover{
    background:#F8FAFC;
}

/* Cuadrito de color */

.legend-color{
    width:20px;
    height:20px;
    border-radius:6px;
    border:1px solid rgba(0,0,0,.15);
    flex-shrink:0;
}

/* Separador */

.legend-item:not(:last-child){
    border-bottom:
        1px solid #F1F5F9;
}

.hidden{
    display:none;
}

#sidebar.collapsed{
    width:0;
    opacity:0;
    margin-left:0;
    overflow:hidden;
    transform:translateX(-15px);
    opacity:0;

}

/* ======================================
   LOADER
====================================== */

#loaderCapas{

    position:absolute;

    left:45%;

    bottom:25px;

    z-index:5000;

    display:none;

}

.loader-card{

    display:flex;

    align-items:center;

    gap:15px;

    background:rgba(255,255,255,.95);

    backdrop-filter:blur(10px);

    border-radius:16px;

    padding:15px 18px;

    box-shadow:
        0 10px 25px rgba(0,0,0,.15);

}

.spinner{

    width:35px;

    height:35px;

    border:4px solid #E2E8F0;

    border-top-color:var(--primary);

    border-radius:50%;

    animation:spin .8s linear infinite;

}

.loader-text{

    display:flex;

    flex-direction:column;

}

.loader-text strong{

    font-size:14px;

}

.loader-text span{

    color:#64748B;

    font-size:12px;

}

@keyframes spin{

    to{
        transform:rotate(360deg);
    }

}

#contadorCapasActivas{
    position:absolute;
    top:-5px;
    right:-5px;
    min-width:18px;
    height:18px;
    padding:0 5px;
    background:#EF4444;
    color:white;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
    display:none;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 10px rgba(0,0,0,.18);
}