/*
 * =========================================================================
 * ARCHIVO DE ESTILOS CSS COMPLETO (styles.css)
 * =========================================================================
 */

/* Base y Tipografía */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5; /* Fondo gris claro */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Para que el footer se quede abajo */
}

/* ========================================= */
/* ESTILOS DE ESTRUCTURA Y ENVOLTURA         */
/* ========================================= */

.content-wrapper {
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el contenido (las tarjetas) */
}

/* Contenedor Central Blanco (Wrapper) */
.main-content-wrapper {
    width: 95%; /* Ocupa casi todo el ancho */
    max-width: 1400px; /* Limita el ancho máximo */
    background-color: white; /* Fondo blanco */
    padding: 30px 40px;
    margin: 30px 0; /* Espacio arriba y abajo para separarlo del header/footer */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Sombra suave */
    text-align: center;
    display: flex; /* Asegura el centrado de sus hijos */
    flex-direction: column;
    align-items: center;
}

/* Media Query: Asegurar que el wrapper se vea bien en móvil */
@media (max-width: 768px) {
    .main-content-wrapper {
        padding: 20px;
        margin: 15px 0;
    }
}

/* ========================================= */
/* ESTILOS DE HEADER Y FOOTER                */
/* ========================================= */

.main-header {
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(to right, #4CAF50, #00C853);
    color: white;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo-image {
    width: 50px;
    height: 75px;
    display: block;
    margin: 0 auto;
}

.logo-text {
    display: none;
}

.header-title {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0 5px;
}

.header-underline {
    width: 100px;
    height: 4px;
    background-color: #ff4081;
    margin: 0 auto;
}

.main-footer {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(to right, #4CAF50, #00C853);
    color: white;
    text-align: center;
    font-size: 0.9em;
}

/* ========================================= */
/* ESTILOS DE MÓDULOS DE TARJETA (INDEX)     */
/* ========================================= */

.header {
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

.header h1 {
    color: #38a169;
    font-size: 1.8em;
    font-weight: bold;
}

.modulos-contenedor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    width: 90%;
    padding: 20px 0;
}

.tarjeta {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0;
}

.tarjeta:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.tarjeta-icono {
    font-size: 3em;
    margin-bottom: 20px;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: #38a169;
    background-color: #e6f0ed;
}

.tarjeta-titulo {
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
    margin-bottom: 25px;
    min-height: 50px;
}

.tarjeta-submodulos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

.submodulo-btn {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s;
    cursor: pointer;
}

.btn-amarillo {
    background-color: #fff0d1;
    color: #ff9900;
    border: 1px solid #ff9900;
}
.btn-amarillo:hover {
    background-color: #ff9900;
    color: white;
}

.btn-verde {
    background-color: #e6f0ed;
    color: #38a169;
    border: 1px solid #38a169;
}
.btn-verde:hover {
    background-color: #38a169;
    color: white;
}

.btn-azul {
    background-color: #e0f0ff;
    color: #007bff;
    border: 1px solid #007bff;
}
.btn-azul:hover {
    background-color: #007bff;
    color: white;
}

.tarjeta-acceso {
    font-size: 2em;
    color: #999;
    margin-top: 15px;
    width: 100%;
    border-top: 1px solid white;
}

/* Media Query para pantallas pequeñas (Mobile Responsive) */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5em;
    }
    .modulos-contenedor {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
        padding: 15px;
    }
    .tarjeta {
        padding: 25px;
    }
    .tarjeta-submodulos {
        gap: 8px;
    }
}

/* ========================================= */
/* ESTILOS DE INFO ADICIONAL (Modal/Infografía) */
/* ========================================= */
.info-adicional {
    padding: 20px;
    margin-bottom: 30px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #fcfcfc;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.title-adicional {
    color: #38a169;
    font-size: 1.5em;
    font-weight: 600;
}

.btn-ver-imagen {
    background-color: #ff4081;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.btn-ver-imagen:hover {
    background-color: #d1306a;
}

/* Contador de Visitas */
.contador-visitas {
    font-size: 0.9em;
    color: #777;
    margin-top: 30px;
}

/* ========================================= */
/* ESTILOS DEL MODAL (Lightbox)              */
/* ========================================= */
.img-carrusel-preview {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    max-height: 80vh;
    object-fit: contain;
}

.modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.modal-footer-controls {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 30px;
}

.btn-cerrar-modal {
    background-color: #ff4081;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cerrar-modal:hover {
    background-color: #d1306a;
}

@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}


/* ========================================= */
/* ESTILOS DE FICHA DE DATOS Y TABLAS        */
/* ========================================= */

.data-section {
    background-color: #f7f7f7;
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 10px;
    border-left: 5px solid #38a169;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-section-title {
    font-size: 1.6em;
    color: #38a169;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.data-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* RESPONSIVE: Contenedor para scroll horizontal en tablas */
.data-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    min-width: 600px; /* Ancho mínimo para tablas grandes */
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table thead th {
    background-color: #38a169;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

.data-table tbody tr:hover {
    background-color: #f0f0f0;
}

.btn-descarga {
    background-color: #ff4081;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    font-size: 1em;
}

.btn-descarga:hover {
    background-color: #d1306a;
}

/* ========================================= */
/* ESTILOS DE MAPAS Y FICHAS DE UBICACIÓN    */
/* ========================================= */

/* Contenedor que asegura la proporción 16:9 (para iframes de mapas) */
.map-responsive-container {
    position: relative;
    padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Estilos de Tarjeta/Ficha de Mapa */
.ficha-card, .map-card {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: left;
}

.map-card-title {
    font-size: 1.2em;
    color: #38a169;
    font-weight: bold;
    margin-bottom: 10px;
}

.map-card-details {
    font-size: 0.9em;
    color: #555;
}

.map-card-details p {
    margin: 5px 0;
}

.map-card-actions {
    margin-top: auto; /* Empuja las acciones al final */
    padding-top: 15px;
    border-top: 1px dashed #eee;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.map-card-actions a {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s;
    /* Estilos de ejemplo, ajusta según el color del botón que desees */
    background-color: #007bff;
    color: white;
}

/* Media Query para Fichas de Mapa */
@media (max-width: 500px) {
    .map-card-actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* ========================================= */
/* ESTILOS DE CARRUSEL (para Fichas de Mapa) */
/* ========================================= */
.carousel-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden; /* Oculta los botones originales (nav-button) */
}

.carousel-content-wrapper {
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px; /* Espacio para la sombra de la tarjeta */
}

.carousel-content {
    display: grid;
    /* Por defecto, muestra 3 columnas y permite el scroll */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 5px;
}

.carousel-content > * {
    scroll-snap-align: start;
    width: 300px; /* Ancho fijo para el scroll */
}

/* Botones de navegación (los originales que estaban dentro, ocultos) */
.nav-button {
    display: none; /* Ocultamos los botones flotantes si usamos los externos */
}

/* Controles de navegación externos (los botones grandes 'Anterior'/'Siguiente') */
.carousel-navigation-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
}

.carousel-action-button {
    background-color: #38a169;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.carousel-action-button:hover:not(:disabled) {
    background-color: #2c7c51;
}

.carousel-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Media Query para Carrusel en móvil */
@media (max-width: 650px) {
    .carousel-content {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    .carousel-content > * {
        width: 280px;
    }
}


/* ========================================= */
/* ESTILOS DEL FORMULARIO DE EVALUACIÓN      */
/* ========================================= */

.form-wrapper {
    max-width: 950px;
    text-align: left;
    margin: 50px auto; /* Centrado */
    padding: 40px;
}

.form-header h2 {
    color: #38a169;
    font-size: 1.8em;
    border-bottom: 3px solid #38a169;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.form-header p {
    text-align: center;
    color: #555;
    margin-bottom: 30px;
}

/* Fieldset/Panel General */
.data-fieldset, fieldset {
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 6px;
}

.form-section {
    font-size: 1.25em;
    font-weight: bold;
    color: #004d99;
    padding: 0 10px;
}

/* Datos Generales (Edad y Sexo) */
.form-group-inline {
    display: flex;
    flex-direction: column; /* Predeterminado: apilado en móvil */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.group-label {
    min-width: 150px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px; /* Espacio bajo la etiqueta en móvil */
    margin-right: 20px; /* Espacio lateral en desktop */
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* ---------------------------------------------------- */
/* RESPONSIVE PARA DATOS GENERALES (Desktop/Tablet)      */
/* ---------------------------------------------------- */
@media (min-width: 768px) {
    .form-group-inline {
        flex-direction: row; /* Vuelve a horizontal */
        align-items: center;
    }
    .group-label {
        margin-bottom: 0;
    }
}

/* ----------------