/* START OF FILE css/style.css (Versión Social Science Corregida) */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #d0d9e1;
    /* Un poco más oscuro como pediste */
    color: #2c3e50;
    text-align: center;
    padding: 20px;
    padding-top: 80px;
}

/* --- LOGO --- */
.site-logo-link {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 100px;
    height: auto;
    z-index: 1001;
    background-color: #fff;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid #34495e;
    cursor: pointer;
    /* Manita al pasar el ratón */
    display: block;
    /* Importante para que el enlace funcione bien */
}

.site-logo-link img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    display: block;
}

h1 {
    color: #2c3e50;
    font-size: 3em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.container {
    max-width: 950px;
    margin: auto;
}

/* --- SECCIONES --- */
.section {
    background-color: #ffffff;
    border: 1px solid #bdc3c7;
    border-left: 5px solid #8e44ad;
    border-radius: 8px;
    margin: 20px 0;
    padding: 20px;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section-title {
    background-color: #8e44ad;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.6em;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, transform 0.2s;
}

.section-title:hover {
    background-color: #732d91;
    transform: translateX(5px);
}

.content {
    display: none;
    padding-top: 20px;
    font-size: 1.1em;
    line-height: 1.8;
}

/* --- INTERACTIVIDAD --- */
.clickable {
    font-weight: bold;
    color: #c0392b;
    cursor: pointer;
    border-bottom: 2px dotted #c0392b;
    text-decoration: none;
}

.clickable:hover {
    background-color: #fadbd8;
    color: #922b21;
}

/* --- POPUPS (VENTANAS EMERGENTES) --- */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 30px;
    border: 4px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;

    /* Control de tamaño del popup */
    width: auto;
    max-width: 90%;
    /* Nunca más ancho que el 90% de la pantalla */
    max-height: 90vh;
    /* Nunca más alto que el 90% de la pantalla */
    overflow-y: auto;
    /* Scroll si es necesario */
    text-align: center;
    animation: fadeIn 0.3s;
}

.popup h2 {
    color: #c0392b;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    font-weight: bold;
    color: #2c3e50;
}

/* Control de las imágenes DENTRO del popup */
.popup img {
    max-width: 100%;
    max-height: 70vh;
    /* La imagen no ocupará más del 70% de la altura de la pantalla */
    width: auto;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
}

/* --- GALERÍA DE IMÁGENES (MINIATURAS) --- */
.image-gallery {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 20px 0;
    gap: 15px;
}

.image-box {
    display: flex;
    flex-direction: column;
    /* Alinea imagen y texto verticalmente */
    align-items: center;
    /* Centra horizontalmente */
    justify-content: flex-start;
    text-align: center;
    margin: 10px;
    cursor: pointer;
    width: 200px;
    /* Ancho fijo para la caja */
}

/* ESTA ES LA PARTE QUE FALTABA Y HACÍA QUE SE VIERAN GIGANTES */
.image-box img {
    max-width: 100%;
    /* La imagen se adapta al ancho de la caja (200px) */
    height: auto;
    max-height: 150px;
    /* Altura máxima para uniformidad */
    object-fit: contain;
    border-radius: 4px;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.image-box img:hover {
    transform: scale(1.05);
}

.image-box p {
    margin-top: 8px;
    font-size: 0.95em;
    line-height: 1.3;
}

/* --- BOTONES Y LINKS --- */
.button-link {
    display: inline-block;
    background-color: #2980b9;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 0px #1a5276;
}

.button-link:hover {
    background-color: #3498db;
    transform: translateY(-2px);
}

/* --- CONTENEDOR DE BOTONES (AÑADIR ESTO) --- */
.footer-button-container {
    margin-top: 40px;
    /* Separación por arriba */
    margin-bottom: 50px;
    /* Separación por abajo (extra para que no se pegue al borde) */
    text-align: center;
    display: flex;
    flex-direction: column;
    /* Pone los botones en columna */
    gap: 20px;
    /* Espacio entre el botón de Quiz y el de Volver */
    align-items: center;
}

.unit-link {
    display: block;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-left: 6px solid #e67e22;
    padding: 20px 25px;
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
    margin-bottom: 15px;
}

.unit-link:hover {
    background-color: #fff;
    border-left-width: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* --- QUIZ --- */
.quiz-box {
    background-color: #fff;
    border: 2px solid #2980b9;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    text-align: left;
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.15);
}

.quiz-option {
    display: block;
    background-color: #f8f9fa;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quiz-input {
    /* Importante: Los inputs no heredan la fuente del body automáticamente */
    font-family: Arial, Helvetica, sans-serif;
    width: 95%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ccc;
    border-radius: 8px;
    margin-top: 10px;
    color: #333;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.quiz-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
}

.quiz-option:hover {
    background-color: #d6eaf8;
    border-color: #2980b9;
}

.instant-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    /* CAMBIO: Quitamos 'Courier New' y dejamos que herede Arial */
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1em;
    line-height: 1.5;
}

.correct-feedback {
    background-color: #d5f5e3;
    border-left: 5px solid #2ecc71;
    color: #196f3d;
}

.incorrect-feedback {
    background-color: #fadbd8;
    border-left: 5px solid #e74c3c;
    color: #943126;
}

/* --- DRAG & DROP --- */
.draggable-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 8px;
    margin-bottom: 20px;
}

.draggable {
    background-color: #e67e22;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: grab;
    border-bottom: 3px solid #d35400;
}

.droppable-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.droppable-pair {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.droppable {
    width: 180px;
    height: 50px;
    background-color: #eaeded;
    border: 2px dashed #7f8c8d;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background-color 0.2s;
}

.droppable.drag-over {
    border-color: #2980b9;
    background-color: #d4e6f1;
}

/* Objetivo de texto para Drop */
.droppable-text-target {
    background-color: #fff;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 10px;
    height: auto;
    min-height: 60px;
    width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* --- OTROS --- */
.highlight {
    font-size: 1.1em;
    /* Un poco más grande */
    color: #e74c3c;
    /* Rojo tomate */
    font-family: 'Comic Sans MS', cursive, sans-serif;
    /* Fuente divertida */
    font-weight: bold;
}

.important-word {
    color: #8e44ad;
    font-weight: 800;
    text-transform: uppercase;
}

/* Animación Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Barras de progreso */
.progress-bar-container {
    background-color: #dcdcdc;
    border-radius: 20px;
}

.progress-bar {
    background-color: #27ae60;
    border-radius: 20px;
}

.star-rating {
    font-size: 3em;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.star.filled {
    color: #f1c40f;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

/* --- NUEVOS ESTILOS PARA EL BOTÓN DE LECTURA EN VOZ ALTA (CORREGIDO) --- */

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Espacio ajustado */
}

/* Botón Play/Pause/Altavoz */
.read-aloud-btn {
    font-size: 1.4em;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    user-select: none;
    display: inline-block;
    width: 30px;
    text-align: center;
    line-height: 1;
    /* Asegura centrado vertical */
}

.read-aloud-btn:hover {
    transform: scale(1.2);
}

.read-aloud-btn.is-reading {
    color: #f1c40f;
    /* Amarillo fuerte (se ve bien sobre morado) */
    animation: pulse 1s infinite;
}

.read-aloud-btn.is-paused {
    color: #bdc3c7;
    /* Gris claro */
    animation: none;
}

/* NUEVO: Botón de Stop (TRANSPARENTE Y LIMPIO) */
.stop-btn {
    font-size: 1.4em;
    /* Mismo tamaño que el Play */
    cursor: pointer;
    user-select: none;
    animation: fadeIn 0.3s;

    display: inline-block;
    width: 30px;
    text-align: center;
    line-height: 1;

    color: #c0392b;
    /* Rojo */
    background-color: transparent;
    /* Fondo transparente */
    border: none;
    box-shadow: none;
}

/* Hemos eliminado el ::before que duplicaba el icono y el background blanco */

.stop-btn:hover {
    transform: scale(1.2);
    color: #e74c3c;
    /* Rojo un poco más claro al pasar el ratón */
}

/* Animaciones */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Popups Audio */
.popup-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}