/* Estilos generales del sistema de quiz */
.quiz-system {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.quiz-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: #856404;
}

/* Estadísticas */
.quiz-stats {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #007cba;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    background: linear-gradient(45deg, #007cba, #005a87);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Botones */
.quiz-controls {
    text-align: center;
    margin: 30px 0;
}

.quiz-start-btn, .quiz-reset-btn, .quiz-submit-btn, .quiz-cancel-btn {
    background: #007cba;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

.quiz-start-btn:hover, .quiz-submit-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quiz-start-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.quiz-cancel-btn {
    background: #6c757d;
}

.quiz-cancel-btn:hover {
    background: #545b62;
}

.quiz-reset-btn {
    background: #28a745;
}

.quiz-reset-btn:hover {
    background: #218838;
}

/* Contenedor de preguntas */
.quiz-questions-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f8f9fa;
}

.quiz-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.quiz-header p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Lista de preguntas */
#questions-list {
    margin-bottom: 30px;
}

.question-item {
    background: #f8f9fa;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 4px solid #007cba;
    transition: all 0.3s ease;
}

.question-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.question-item.unanswered {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.question-number {
    font-size: 14px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Opciones de respuesta */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.answer-option:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.answer-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.answer-text {
    font-size: 16px;
    color: #495057;
    font-weight: 500;
}

/* Acciones del quiz */
.quiz-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Resultados */
.quiz-results-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    margin: 20px 0;
}

.score-summary {
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.score-pass {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.score-fail {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
    color: white;
}

.score-percentage {
    font-size: 32px;
}

.score-details {
    font-size: 18px;
    margin: 10px 0;
    color: #333;
}

.score-status {
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
}

.results-details {
    text-align: left;
    margin-top: 30px;
}

.results-details h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.result-item {
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8f9fa;
}

.result-item.correct {
    border-left-color: #28a745;
    background: #f8fff9;
}

.result-item.incorrect {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.result-question {
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.result-answer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.your-answer {
    color: #495057;
}

.correct-answer {
    color: #28a745;
    font-weight: 600;
}

.result-status {
    font-weight: bold;
    font-size: 14px;
}

/* Loading */
.quiz-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.quiz-completed {
    text-align: center;
    padding: 30px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-system {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .quiz-start-btn, .quiz-reset-btn, .quiz-submit-btn, .quiz-cancel-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .quiz-questions-container {
        padding: 20px 15px;
    }
    
    .question-item {
        padding: 20px 15px;
    }
    
    .answer-option {
        padding: 12px;
    }
}
/* Estilos para estadísticas actualizadas */
.quiz-updated-stats {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #007cba;
}

.quiz-updated-stats h4 {
    margin: 0 0 15px 0;
    color: #007cba;
    text-align: center;
}

.stats-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-mini-label {
    font-weight: 600;
    color: #333;
}

.stat-mini-value {
    font-weight: bold;
    color: #007cba;
}

.progress-bar-mini {
    background: #e9ecef;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill-mini {
    background: linear-gradient(45deg, #007cba, #005a87);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}
/* Estilos simplificados para estadísticas actualizadas */
.quiz-updated-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.quiz-updated-stats h4 {
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
    font-size: 16px;
}

.stats-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-update, .remaining-questions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.progress-label, .remaining-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
}

.progress-value, .remaining-value {
    font-weight: bold;
    color: #007cba;
    font-size: 14px;
}

.progress-bar-mini {
    background: #e9ecef;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill-mini {
    background: #28a745;
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
}

/* Estilos simplificados para botones de acción */
.quiz-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.quiz-actions .quiz-start-btn {
    margin: 0;
    width: auto;
    min-width: 250px;
}
.quiz-note {
    background: #fff3cd;
    padding: 10px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.quiz-note small {
    font-size: 13px;
}