﻿html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: Arial, sans-serif;
    background: linear-gradient(120deg, #e0f7fa, #ffffff);
}

body {
    min-height: 100vh;
    /* Solo bloqueamos el eje horizontal: el scroll vertical debe ser siempre natural */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

    body > .container {
        position: relative;
        z-index: 1;
        flex: 1;
        /* Remove max-width or other constraints causing padding */
        max-width: none !important;
        width: 100%;
    }
/* Quiz container */
.quiz-container {
    max-width: 800px;
    margin: 100px auto 20px auto;
    background: linear-gradient(180deg, #f9f9f9, #e6f2ff);
    border-radius: 16px;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Contenido del quiz */
.quiz-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Imagen: se escala al ancho disponible, nunca fuerza scroll horizontal */
.quiz-image {
    max-width: 100%;
    width: 300px;
    height: auto;
    border-radius: 10px;
    border: 3px solid #ddd;
    margin-bottom: 1.5rem;
}

/* Opciones: una columna por defecto (mobile-first), 2 columnas en pantallas más anchas */
.options-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: stretch;
}

@media (min-width: 576px) {
    .options-grid-2x2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.option-box {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-wrap: break-word;
    padding: 0.6rem 1rem;
    border: 2px solid #cce3de;
    border-radius: 10px;
    background-color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

    .option-box:hover {
        background-color: #e8f6f3;
        border-color: #007bff;
        transform: scale(1.03);
    }

.correct {
    border-color: green;
    background-color: #e6ffe6;
    color: green;
    font-weight: bold;
}

.incorrect {
    border-color: red;
    background-color: #ffe6e6;
    color: red;
    font-weight: bold;
}

/* Header flotante */
.quiz-header {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    background-color: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    text-align: right;
    min-width: 160px;
}

/* Cabecera de los modos de mapa (Test/Quiz/Colocar de Comarcas): a diferencia
   del quiz-header flotante original (pensado para una página sin header.nav
   propio), aquí compite con el header.nav sticky del layout (theme.css) y
   lleva controles adicionales (dificultad, volumen) que tienen que quedar
   siempre alcanzables. Se saca del position:fixed y se deja en el flujo
   normal, igual que el resto del contenido de la página -- mismo criterio
   que Pages/Flashcards/Estudio.cshtml, donde la barra de acciones nunca
   flota y por eso nunca tapa nada al hacer scroll. */
.quiz-header.quiz-header--mapa {
    position: static;
    width: 100%;
}

@media (max-width: 576px) {
    /* En móvil el header deja de flotar sobre el contenido: pasa al flujo normal */
    .quiz-header {
        position: static;
        width: 100%;
        margin-bottom: 15px;
    }

    .header-info {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .quiz-container {
        margin: 10px auto 20px auto;
        padding: 15px;
        border-radius: 12px;
    }

    /* Objetivo táctil mínimo (44x44px, WCAG 2.5.5) para las áreas de respuesta:
       en desktop el padding ya suele bastar, pero en móvil hay que garantizarlo. */
    .option-box {
        min-height: 44px;
    }
}

/* Resultados */
.result.correct-result {
    color: #2e8b57;
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.3rem;
}

.result.incorrect-result {
    color: #c0392b;
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.3rem;
}

/* Botones */
button {
    padding: 10px 25px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: 0.2s ease;
}

    button:hover {
        background-color: #0056b3;
    }

/* Botón de confirmar respuesta: siempre a lo ancho y con separación en móvil */
.btn-confirm {
    margin-top: 1.5rem;
    width: 100%;
}

@media (min-width: 576px) {
    .btn-confirm {
        width: auto;
        min-width: 200px;
    }
}

footer {
    text-align: center;
    font-size: 0.8em;
    padding: 15px 0;
    background: none;
    color: #333;
    flex-shrink: 0;
}
