/* Quiz Styles - quiz-style.css */
:root {
    --primary: #0245AB;
    --secondary: #4A90E2;
    --success: #28a745;
    --error: #dc3545;
    --text: #333;
    --bg: #fff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ejercicio-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-height: 600px;
    position: relative;
}

@media (max-width: 768px) {
    .ejercicio-container {
        margin: 10px;
        padding: 15px;
    }
    .contenedor-botones {
        flex-direction: column;
    }
    .btn-cta {
        width: 100%;
    }
}

.ejercicio-container h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 15px;
    font-size: 28px;
}

.descripcion-ejercicio {
    text-align: center;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 0 20px;
}

.progreso {
    background-color: #f0f0f0;
    height: 10px;
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
}

.barra-progreso {
    height: 100%;
    background-color: var(--secondary);
    width: 0%;
    transition: width 0.5s ease;
}

.contador {
    text-align: center;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 20px;
}

.pregunta {
    display: none;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.pregunta.activa {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pregunta h4 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.opciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.opcion {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: var(--bg);
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.opcion:hover:not(.deshabilitada) {
    border-color: var(--secondary);
    background-color: #e6f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.opcion.deshabilitada {
    pointer-events: none;
    opacity: 0.6;
}

.opcion input[type="radio"] {
    margin-right: 12px;
}

.input-respuesta {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    margin-bottom: 20px;
}

.input-respuesta:focus {
    outline: 0;
    border-color: var(--secondary);
}

.input-respuesta:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.btn-siguiente {
    background-color: var(--primary);
    color: #fff;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
    opacity: 0.5;
    pointer-events: none;
}

.btn-siguiente.activo {
    opacity: 1;
    pointer-events: auto;
}

.btn-siguiente.activo:hover {
    background-color: #023380;
    transform: scale(1.05);
}

.btn-siguiente.siguiente-naranja {
    background-color: var(--secondary) !important;
}

.btn-siguiente.siguiente-naranja:hover {
    background-color: #357ABD !important;
}

.explicacion {
    margin: 0 -20px;
    margin-top: 20px;
    padding: 20px;
    border-radius: 0;
    display: none;
}

.explicacion.correcta {
    background-color: #d4edda;
    border-top: 3px solid var(--success);
}

.explicacion.incorrecta {
    background-color: #f8d7da;
    border-top: 3px solid var(--error);
}

.explicacion h5 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 18px;
}

.explicacion p {
    line-height: 1.6;
    color: var(--text);
}

.mensaje-final {
    display: none;
    background: #fff;
    padding: 30px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
}

.mensaje-final.visible {
    display: block;
    animation: fadeIn 0.6s ease;
}

.mensaje-final::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.titulo-completado {
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.texto-promocional {
    color: #333;
    font-size: 24px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    background-color: #f0f7ff;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid var(--secondary);
}

.texto-promocional strong {
    color: var(--primary);
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

.contenedor-botones {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 25px 0;
}

.btn-cta {
    padding: 18px 45px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 18px;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-cta:visited {
    text-decoration: none;
}

.btn-accedi {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(2,69,171,0.2);
}

.btn-accedi:hover {
    background-color: #023380;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2,69,171,0.3);
}

.btn-registrati {
    background-color: #C60B1E;
    color: #fff;
    border: none;
}

.btn-registrati:hover {
    background-color: #A00918;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198,11,30,0.3);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    .texto-promocional {
        font-size: 20px;
        padding: 20px;
    }
    .texto-promocional strong {
        font-size: 26px;
    }
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.puntuacion-final {
    font-size: 32px;
    color: var(--secondary);
    font-weight: 700;
    margin: 15px 0 10px;
}

.mensaje-puntuacion {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.btn-reiniciar {
    background-color: var(--success) !important;
    color: #fff !important;
    padding: 16px 45px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 25px auto 0;
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
    text-transform: none;
}

.btn-reiniciar:hover {
    background-color: #218838 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
}

/* Loading placeholder styles */
.quiz-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #666;
    text-align: center;
}

.quiz-placeholder .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quiz-placeholder p {
    font-size: 18px;
    color: var(--primary);
}

.quiz-content {
    display: none;
}

.quiz-content.loaded {
    display: block;
}