/* ============================= */
/*      Contenedor Principal     */
/* ============================= */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================= */
/*      Filtros y Mapa           */
/* ============================= */
.filters-and-map {
    display: flex;
    width: 100%;
    gap: 20px;
    height: 85vh;
}

.filters {
    flex: 0 0 30%;
    min-width: 250px;
    padding: 1.5rem;
    background-color: white;
    border-radius: 20px;
    transition: width 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    margin: auto;
}

.map {
    flex: 1;
    min-height: 500px;
}

/* ============================= */
/*      Filtros de Búsqueda      */
/* ============================= */
.filters label {
    font-size: 1rem;
    color: var(--colorInstitucional2);
    font-weight: bold;
    display: block;
    margin-top: 1rem;
}

.filters select, 
.filters button {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 2px solid var(--colorInstitucional1);
    border-radius: 15px;
    font-size: 1rem;
    background-color: white;
    font-family: "Institucional-Regular", Arial, sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}

.filters input {
    width: 92%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 2px solid var(--colorInstitucional1);
    border-radius: 10px;
    font-size: 1rem;
    background-color: white;
    font-family: "Institucional-Regular", Arial, sans-serif;
}

.filters button {
    background-color: var(--colorInstitucional1);
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-family: "Institucional-Regular", Arial, sans-serif;
}

.filters button:hover {
    background-color: var(--colorBotonHover);
}

.select2-container {
    width: 100% !important;
}

.btn-apply-filters {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 10px !important;
}

/* ============================= */
/*      Tabla de Unidades        */
/* ============================= */
.table-responsive {
    overflow-x: auto;
}

#unidadesTable {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    border-radius: 15px;
}

#unidadesTable th, 
#unidadesTable td {
    padding: 12px;
    text-align: left;
    border: 1px solid #dddddd00;
}

#unidadesTable th {
    background-color: var(--colorInstitucional1);
    color: white;
}

#unidadesTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* ============================= */
/*     Paginación de Búsqueda    */
/* ============================= */
.pagination {
    margin: 20px 0;
    text-align: center;
}

.pagination button {
    background: var(--colorInstitucional1);
    padding: 5px 10px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 15px;
    color: white;
}

.pagination button:hover {
    background-color: var(--colorBotonHover);
    color: white;
}

.pagination button:active {
    background-color: var(--colorInstitucional3);
    color: white;
}

.pagination button:disabled {
    color: black;
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    margin: 0 10px;
    font-weight: bold;
}

/* ============================= */
/*      Tabla de Resultados      */
/* ============================= */
#selectedInfo {
    width: 100%;
    margin-top: 0;
    padding: 15px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ============================= */
/*      Estilos de Marcadores    */
/* ============================= */
.marker-popup {
    font-size: 14px;
    line-height: 1.4;
    padding: 3px;
}

/* ============================= */
/*      Estilos de Mapas         */
/* ============================= */
.enlace-mapa {
    display: inline-block;
    padding: 3px 3px;
    margin: 2px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: normal;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.enlace-mapa:hover {
    border-bottom-color: currentColor;
}

.enlace-gmaps {
    color: #1a73e8;
}

.enlace-amaps {
    color: #000000;
}

.separador-mapas {
    color: #ddd;
    margin: 0 5px;
}

/* ============================= */
/*      Media Queries            */
/* ============================= */
@media (max-width: 992px) {
    .filters {
        width: 35%;
    }
    
    .filters-and-map {
        padding-top: 10px;
        flex-direction: column;
        height: auto;
    }
    
    .filters {
        width: 100%;
    }
    
    .map {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .filters {
        width: 100%;
        min-width: 100%;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #unidadesTable th, 
    #unidadesTable td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* ============================= */
/*         Modo Oscuro           */
/* ============================= */
[data-bs-theme="dark"] #unidadesTable th {
    color: white;
}

[data-bs-theme="dark"] .filters {
    background-color: #000000;
}

[data-bs-theme="dark"] .filters label {
    color: #ffffff;
}

[data-bs-theme="dark"] button#btnGlobalSearch i {
    background-color: #333;
    color: #ffffff;
    border-color: #555;
}

[data-bs-theme="dark"] button#btnGlobalSearch:hover i {
    background-color: #343434;
    color: #ffffff;
    border-color: #555;
}

[data-bs-theme="dark"] .pagination button {
    background-color: #444;
}

[data-bs-theme="dark"] .pagination button:hover {
    background-color: #343434;
}

[data-bs-theme="dark"] .enlace-mapa {
    background-color: #ffffffa7;
}