/* ============================================
   OGEIN - ESTILOS PERSONALIZADOS v7.0
   ============================================ */

/* CENTRADO DE TÍTULO DE PÁGINA */
h1, .entry-title, .wp-block-post-title {
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ============================================
   CENTRADO DEL MODAL - MEGA REFORZADO
   ============================================ */

/* Prevenir scroll cuando el modal está abierto */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Modal principal - CENTRADO ABSOLUTO CON FLEXBOX */
body.wp-theme-twentytwentyfive.modal-open #modalAdmin.modal,
body.modal-open #modalAdmin.modal.fade.show,
body.modal-open #modalAdmin.modal.show,
body #modalAdmin.modal.show,
#modalAdmin.modal.fade.show,
#modalAdmin.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    z-index: 999999 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Dialog centrado - SOBRESCRIBIR TODO */
body.wp-theme-twentytwentyfive #modalAdmin .modal-dialog,
body.modal-open #modalAdmin .modal-dialog.modal-dialog-centered,
body #modalAdmin .modal-dialog.modal-dialog-centered,
#modalAdmin .modal-dialog {
    display: block !important;
    position: relative !important;
    margin: auto !important;
    margin-top: auto !important;
    margin-bottom: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 500px !important;
    width: 90% !important;
    min-height: auto !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    pointer-events: none !important;
}

/* Contenido del modal */
body #modalAdmin .modal-content,
#modalAdmin .modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    pointer-events: auto !important;
    background-color: #fff !important;
    border: 1px solid rgba(0,0,0,.2) !important;
    border-radius: 0.5rem !important;
    outline: 0 !important;
}

/* Backdrop del modal */
body .modal-backdrop,
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999998 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000 !important;
}

.modal-backdrop.show {
    opacity: 0.5 !important;
}

/* Media queries para responsive */
@media (min-width: 576px) {
    body #modalAdmin .modal-dialog,
    #modalAdmin .modal-dialog {
        max-width: 500px !important;
    }
}

@media (max-width: 575px) {
    body #modalAdmin .modal-dialog,
    #modalAdmin .modal-dialog {
        width: 95% !important;
    }
}

/* ============================================
   COLORES INSTITUCIONALES UV
   ============================================ */
.FondoAzul { 
    background-color: #18529D !important; 
    color: white !important; 
}

.FondoVerde { 
    background-color: #28AD56 !important; 
    color: white !important;
}

.FondoAzul2 { 
    background-color: #B4DEF5 !important; 
    color: #212529 !important;
}

/* ============================================
   TABLAS - ZEBRA STRIPING Y ANCHOS
   ============================================ */

/* Anchos fijos para las columnas */
.table-ogein-striped th:first-child,
.table-ogein-striped td.col-muni {
    width: 50% !important;
    min-width: 180px !important;
    max-width: 250px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-ogein-striped th:last-child,
.table-ogein-striped td:last-child {
    width: 70% !important;
}

/* Zebra striping */
.table-ogein-striped tbody tr:nth-child(even) .col-muni { 
    background-color: #E8F5E9 !important; 
    color: #212529 !important; 
}

.table-ogein-striped tbody tr:nth-child(odd) .col-muni { 
    background-color: #ffffff !important; 
    color: #212529 !important; 
}

/* ============================================
   SLIDER PERSONALIZADO - AZUL UV CON RELLENO PROGRESIVO
   ============================================ */
.custom-slider-azul { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 100%; 
    height: 10px; 
    border-radius: 5px; 
    outline: none; 
    background: #dee2e6 !important;
    cursor: pointer;
    position: relative;
}

/* Relleno azul que crece con el valor */
.custom-slider-azul::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #18529D var(--slider-percent, 0%), #dee2e6 var(--slider-percent, 0%)) !important;
}

.custom-slider-azul::-moz-range-track {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #18529D var(--slider-percent, 0%), #dee2e6 var(--slider-percent, 0%)) !important;
}

/* Bolita azul */
.custom-slider-azul::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background: #18529D !important; 
    cursor: pointer; 
    border: 4px solid white !important; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    margin-top: -7px;
    position: relative;
    z-index: 10;
}

.custom-slider-azul::-moz-range-thumb {
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background: #18529D !important; 
    cursor: pointer; 
    border: 4px solid white !important; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    position: relative;
    z-index: 10;
}

/* Hover effect */
.custom-slider-azul:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(24, 82, 157, 0.4) !important;
}

.custom-slider-azul:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(24, 82, 157, 0.4) !important;
}

/* ============================================
   PESTAÑAS (NAV PILLS)
   ============================================ */
.nav-pills .nav-link.active { 
    background-color: #18529D !important; 
    color: white !important;
}

.nav-pills .nav-link { 
    color: #18529D; 
    background: #f8f9fa; 
    margin: 0 5px; 
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: #e9ecef;
}

/* ============================================
   UTILIDADES ADICIONALES
   ============================================ */
.sticky-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 1020 !important;
}

/* Animaciones suaves */
.modal.fade .modal-dialog {
    transition: transform .3s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}