/* ===== ARCHIVO style.css COMPLETO Y ORGANIZADO ===== */

/* ===== 1. ESTILOS BASE Y RESET ===== */
html, body {
    padding: 0; 
    margin: 0; 
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#miMapa {
    padding: 0;
    margin: 0;
    width: 100%;
    flex: 1;
    height: auto !important;
    min-height: 0;
    position: relative;
    z-index: 1;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== 2. BANNER SUPERIOR ===== */
.header-banner {
    background: rgba(145,199,61);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    flex-shrink: 0;
    z-index: 2000;
}

.banner-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 0px;
    /* max-width: 1400px; */
    margin: 0 auto;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.banner-logo {
    display: flex;    
    user-drag: none;
}

.banner-logo2 {
    user-drag: none;
    margin-left: 50px;
}

.logo-img {
    height: 70px;
    width: auto;
}

.logo-img2 {
    height: 30px;
    width: auto;
}

.banner-title {
    text-align: right;
    flex: 1;
}

.banner-title h1 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    color: white;
    line-height: 1.2;
}

.banner-title p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* ===== 3. SISTEMA DE FILTROS (REEMPLAZA TODOS LOS ANTERIORES) ===== */

/* Contenedor principal de botones */
.botones-filtro-container {
    position:absolute;
    top: 80px; /* Espacio después del banner */
    left: 10px;
    z-index: 1500;
    display: flex;
    gap: 5px;
    background: transparent;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    z-index: 1000000;
}

/* Botones toggle */
.filtro-toggle {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    color: #0079c1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filtro-toggle:hover {
    background-color: #f0f8ff;
    box-shadow: 0 4px 12px rgba(0,121,193,0.3);
}

.filtro-toggle.abierto {
    background-color: #0079c1;
    color: white;
}

.filtro-toggle.abierto:hover {
    background-color: #005a87;
}

/* Contenedores de filtro */
.filtro-container {
    position: absolute;
    top: 150px; /* Debajo de los botones */
    left: 10px;
    z-index: 1400;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    padding: 15px;
    width: 250px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    display: none; /* Oculto por defecto */
}

.filtro-titulo {
    font-weight: bold;
    margin-bottom: 0px;
    color: #0079c1;
    padding-bottom: 5px;
    font-size: 25px;
}

.filtro-titulo2 {
    padding-top: 1px;
    font-weight: bold;
    margin-bottom: 4px;
    margin-top: 10px;;
    color: #0079c1;
    border-bottom: 3px solid #0079c1;
    padding-bottom: 5px;
    font-size: 14px;
}

.filtro-titulo3 {
    padding-top: 0px;
    font-weight: bold;
    margin-bottom: 0px;
    color: #0079c1;
    padding-bottom: 5px;
    font-size: 14px;
}

.filtro-subtitulo {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.filtro-subtitulo2 {
    font-size: 14px;
    color: #000000;
    margin-top: 10px;
    margin-bottom: 10px;
    font-style: italic;
    font-weight: bold;    
}

/* Opciones de filtro */
.filtro-opcion {
    display: flex;
    align-items: center;
    padding: 2px 15px;
    margin: 0px 0;
    background: white;
    /* border-radius: 8px;
    border: 2px solid #e0e0e0; */
    transition: all 0.3s ease;
    cursor: pointer;
}

.linea-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 50px;
}

.linea-recta {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #e52424, #ed0f0f);
}

.filtro-opcion:hover {
    border-color: #0079c1;
    background-color: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 121, 193, 0.2);
}

.filtro-checkbox {
    margin-right: 15px;
    cursor: pointer;
    accent-color: #0079c1;
    width: 12px;
    height: 12px;
}

.filtro-label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

/* Estadísticas */
.filtro-estadisticas {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
}

.filtro-estadisticas strong {
    color: #0079c1;
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
}

.filtro-estadisticas div {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filtro-estadisticas span {
    font-weight: bold;
    color: #005a87;
    font-size: 16px;
}

/* ===== 4. BUSCADOR DE RUTAS ESPECÍFICO ===== */
#buscarRutaContainer {
    width: 300px;
}

#inputBuscarRuta {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

#inputBuscarRuta:focus {
    outline: none;
    border-color: #0079c1;
    box-shadow: 0 0 0 2px rgba(0,121,193,0.2);
}

#btnBuscarRuta {
    width: 50px;
    /* flex: 1; */
    padding: 10px;
    background-color: #ffffff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#btnBuscarRuta:hover {
    background-color: #6ac3f0;
}

#btnLimpiarRuta {
    /* flex: 1; */
    width: 65px;
    padding: 10px;
    background-color:#ffffff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#btnLimpiarRuta:hover {
    background-color: #6ac3f0;
}

.botones-busqueda-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.rutasimbolo{
    width: 28px;
    height: 2px;
    background-color: #F7E6AD;
    border-radius: 2px;
    display: inline-block;
}

#resultadoBusquedaRuta {
    font-size: 13px;
    color: #666;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 4px;
}

#infoResultado {
    display: none;
}

#sinResultados {
    display: none;
    color: #d9534f;
    padding: 10px;
    background: #fdf7f7;
    border-radius: 4px;
    border: 1px solid #f2dede;
}

#sugerenciasRutas {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}

#listaSugerencias {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/*tamaños de iconos */
.sw-icon-img{    
    width: 35px;
}

/* ===== 5. WIDGETS ARCGIS ===== */
.esri-ui-top-right .esri-widget--button {
    margin: 10px 10px 0 10px !important;
}

.esri-expand__container {
    border-radius: 8px;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.esri-expand__content {
    position: absolute !important;
    z-index: 100 !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    border: 1px solid #ccc !important;
    max-height: 600px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 280px !important;
    box-sizing: border-box !important;
}

.esri-expand--expanded {
    z-index: 100 !important;
}

.esri-ui-top-right,
.esri-ui-top-left,
.esri-ui-bottom-left,
.esri-ui-bottom-right {
    z-index: 50 !important;
}

/* ===== 6. RESPONSIVE ===== */
@media (max-width: 992px) {
    .banner-container {
        flex-direction:row;
        text-align: center;
        gap: 15px;
        display: flex;
        align-items: center;
        /* justify-content: space-between; */
        padding: 0px 0px;
        /* max-width: 1400px; */
        margin: 0 auto;
    }

    .botones-filtro-container {
    position: absolute;
    top: 60px;
    }

    .logo-img {
        height: 30px;
    }
    
    .logo-img2 {
        height: 30px;
    }
    
    .banner-left {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .banner-title {
        text-align: center;
        width: 100%;
    }
    
    .banner-title h1 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    /* Banner ajustado */
    .header-banner {
        padding: 10px 0;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .logo-img2 {
        height: 25px;
    }
    
    .banner-title h1 {
        font-size: 18px;
    }
    
    .banner-title p {
        font-size: 13px;
    }
    
    /* Sistema de filtros responsive */
    
    .filtro-toggle {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .filtro-container {
        top: 130px;
        left: 5px;
        right: 5px;
        width: auto;
        max-width: calc(315px - 10px);
        max-height: 350px;
    }
    
    #buscarRutaContainer {
        width: auto;
    }
    
    /* Widgets más pequeños */
    .esri-ui-top-right .esri-widget--button {
        margin-top: 5px !important;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .esri-expand .esri-widget {
        width: 250px !important;
        max-height: 350px !important;
    }
}

@media (max-width: 718px) {  
    
    .banner-title {
        display: none;
    }

    .banner-container {
        flex-direction:row;
        text-align: center;
        gap: 15px;
        display: flex;
        align-items: center;
        /* justify-content: space-between; */
        padding: 0px 0px;
        max-width: 1400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    #filtroTecnologiaTexto, #filtroTexto, #buscarRutaTexto{
        display: none;
    }

    .banner-container{
        display: flex;
        justify-content: end;
    }

    .botones-filtro-container {
        top: 10px;
        flex-direction: column;
    }
    
    .filtro-toggle {
        width: 80%;
        justify-content: center;    
        min-width: 40px;    
    }
    
    .filtro-container {
        top: 180px; /* Más espacio para los botones en columna */
    }
    
    .banner-title h1 {
        font-size: 16px;
    }
    
    .banner-title p {
        font-size: 12px;
    }
}

@media (max-width: 370px) {
    .logo-img{
        display: none;
    }

       .botones-filtro-container {
        top: 10px;
        flex-direction: row;
    }
}
/* ================================================================
   NUEVOS ESTILOS – WIDGETS EXTENDIDOS
   ================================================================ */
 .esri-ui calcite-theme-light{
    inset: 0;
 }
   

/* ---- SPLASH ---- */
#splashOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
#splashModal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    max-width: 520px;
    width: 92%;
    padding: 32px 36px 28px;
    text-align: center;
    animation: splashIn .35s ease;
}
@keyframes splashIn {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.splash-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}
.splash-logo  { height: 60px; }
.splash-logo2 { height: 28px; }
.splash-title {
    font-size: 24px;
    font-weight: 700;
    color: #0079c1;
    margin: 0 0 14px;
}
.splash-body {
    text-align: left;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 22px;
}
.splash-body p { margin: 0 0 10px; }
.splash-btn {
    background: #0079c1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 48px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.splash-btn:hover { background: #005a87; }

/* ---- SIDEBAR DE WIDGETS ---- */
.sidebar-widgets {
    position: absolute;
    top: 78px;
    right: 10px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    padding: 6px 4px;
}
.sw-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: #444;
    font-size: 11px;
    gap: 2px;
    transition: background .15s, color .15s;
}
.sw-btn:hover, .sw-btn.active {
    background: #0079c1;
    color: #fff;
}
.sw-icon { font-size: 18px; line-height: 1; }
.sw-label { font-size: 9px; font-weight: 600; letter-spacing: .3px; }
.sw-separator {
    width: 36px;
    height: 1px;
    background: #e0e0e0;
    margin: 2px auto;
}

/* ---- PANELES LATERALES ---- */
.side-panel {
    position: absolute;
    top: 78px;
    right: 70px;
    z-index: 4500;
    width: 290px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelIn .2s ease;
}
.side-panel.open { display: flex; }
@keyframes panelIn {
    from { transform: translateX(10px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0079c1;
    color: #fff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.panel-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.panel-close:hover { opacity: .7; }
.panel-body {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1;
}

/* ---- BOTONES AUXILIARES ---- */
.btn-primary-sm {
    background: #0079c1;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.btn-primary-sm:hover { background: #005a87; }
.btn-secondary-sm {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}
.btn-secondary-sm:hover { background: #e0e0e0; }

/* ---- MEDICIÓN ---- */
.btn-measure {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
}
.btn-measure:hover, .btn-measure.active-measure {
    background: #0079c1;
    color: #fff;
    border-color: #0079c1;
}

/* ---- CARGA DE ARCHIVOS ---- */
.upload-zone {
    border: 2px dashed #b0c8e0;
    border-radius: 8px;
    padding: 20px 12px;
    text-align: center;
    font-size: 13px;
    color: #555;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color .2s;
}
.upload-zone.dragover { border-color: #0079c1; background: #e8f3fc; }
.upload-icon { font-size: 30px; margin-bottom: 8px; }

/* ---- DESCARGA ---- */
.btn-download {
    background: #fff;
    border: 1px solid #0079c1;
    color: #0079c1;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.btn-download:hover {
    background: #0079c1;
    color: #fff;
}

/* ---- INPUT BUSCADOR ---- */
#inputBuscarRuta {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
}
#inputBuscarRuta:focus {
    outline: none;
    border-color: #0079c1;
    box-shadow: 0 0 0 2px rgba(0,121,193,.2);
}

/* ---- LAYERLIST CUSTOM ---- */
.custom-layer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.custom-layer-item:last-child { border-bottom: none; }
.custom-layer-item input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: #0079c1;
    flex-shrink: 0;
    cursor: pointer;
}
.layer-icon-custom {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ---- SCALEBAR override ---- */
.esri-scale-bar { bottom: 30px !important; left: 70px !important; }

/* ---- GEOCODER custom ---- */
#geocoderContainer .esri-search {
    width: 100% !important;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .sidebar-widgets { right: 4px; }
    .side-panel { right: 62px; width: calc(100vw - 80px); }
    .splash-logo { height: 40px; }
}
