/**
 * Stili per il quiz nel frontend
 */

/* Container principale */
.boost-quiz-wrapper {
    margin: 30px 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Intestazione del quiz */
.boost-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
}

.quiz-difficulty .difficulty-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    color: #fff;
    font-size: 0.9em;
    font-weight: 500;
}

.boost-quiz-info {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

/* Form del quiz */
.boost-quiz-form {
    padding: 20px;
}

/* Lista domande */
.boost-quiz-questions {
    margin-bottom: 30px;
}

.boost-quiz-question {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
}

.boost-quiz-question:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.question-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    color: #333;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.question-content {
    flex-grow: 1;
}

.question-text {
    margin-bottom: 15px;
    font-weight: 500;
    line-height: 1.5;
}

/* .question-answers {
    display: flex;
    gap: 30px;
} */

.answer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.2s;
}

.answer-option:hover {
    background: #f0f0f0;
}

/* Pulsanti */
.boost-quiz-actions {
    text-align: center;
    margin-top: 30px;
}

button.boost-quiz-submit,
button.boost-quiz-retry {
    display: inline-block;
    padding: 10px 25px;
    border: none;
    border-radius: 30px;
    background: #2271b1;
    color: #fff;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button.boost-quiz-submit:hover,
button.boost-quiz-retry:hover {
    background: #135e96;
}

button.boost-quiz-retry {
    background: #6c757d;
}

button.boost-quiz-retry:hover {
    background: #5a6268;
}

/* Risultati */
.boost-quiz-results {
    margin-top: 30px;
    background: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
}

.results-header {
    padding: 15px 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #e5e5e5;
}

.results-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.results-content {
    padding: 20px;
}

/* Punteggio */
.results-score {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.score-circle.passed {
    color: #22c55e;
    border-color: 0 2px 10px rgba(76, 175, 80, 1);
    background: rgba(34, 197, 94, 0.1)
}

.score-circle.failed {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.score-value {
    font-size: 3em;
    font-weight: bold;
}

.score-percent {
    font-size: 1.2em;
    margin-top: -0.5em;
}

.score-message {
    font-size: 1.2em;
    font-weight: 500;
}

.score-passed {
    color: #4CAF50;
}

.score-failed {
    color: #F44336;
}

/* Dettagli risultati */
.results-details {
    margin-top: 20px;
}

.result-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.result-correct .result-number {
    background: #4CAF50;
}

.result-wrong .result-number {
    background: #F44336;
}

.result-content {
    flex-grow: 1;
}

.result-text {
    margin-bottom: 8px;
    font-weight: 500;
}

.result-answer {
    font-size: 0.9em;
}

.result-answer.correct-answer {
    color: #4CAF50;
}

.result-answer.wrong-answer {
    color: #F44336;
    text-decoration: line-through;
}

.result-answer.user-answer::before {
    content: "La tua risposta: ";
    font-weight: normal;
    color: #666;
}

.result-answer.correct-answer::before {
    content: "Correct answer: ";
    font-weight: normal;
    color: #666;
}

/* Stili per risultati domande corrette/errate */
.question-correct {
    /* background-color: rgba(76, 175, 80, 0.1); */
}

.question-wrong {
    /* background-color: rgba(244, 67, 54, 0.1); */
}

.answer-option.selected {
    border: 2px solid #2271b1;
}

.answer-option.correct-answer {
    background-color: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
}

.answer-option.wrong-answer {
    background-color: rgba(244, 67, 54, 0.2);
    border: 2px solid #F44336;
}

/* Responsive */
@media (max-width: 767px) {
    .boost-quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .question-answers {
        flex-direction: column;
        gap: 10px;
    }
    
    .answer-option {
        width: 100%;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 2.5em;
    }
}

button.boost-quiz-submit.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

button.boost-quiz-submit.disabled:hover {
    background: #ccc;
}

.quiz-progress {
    margin-bottom: 30px;
}

.question-counter {
    text-align: center;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 8px;
}

.quiz-progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #2271b1;
    width: 0;
    transition: width 0.3s ease;
}

.answer-option {
    position: relative;
    overflow: hidden;
}

.answer-option:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(34, 113, 177, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.3;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.answer-option.selected:after {
    animation: ripple 0.3s ease-out;
}

/* Stili generali per le opzioni di risposta */
.answer-option {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.answer-option:hover {
    background-color: #e9e9e9;
}

.answer-option.selected {
    border-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
}

/* Stili per le checkbox nelle domande a Multiple Choice */
.multiple-choice-option {
    display: flex;
    align-items: center;
}

.multiple-choice-option input[type="checkbox"] {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 18px;
    height: 18px;
    /* Mostra le checkbox ma con stile */
    opacity: 1;
    cursor: pointer;
}

/* Stili per i radio button nelle domande vero/falso */
.true-false-option {
    display: inline-block;
    margin-right: 15px;
    text-align: center;
    min-width: 100px;
}

.true-false-option input[type="radio"] {
    position: relative;
    margin-right: 8px;
    top: 2px;
    /* Mostra i radio button ma con stile */
    opacity: 1;
    cursor: pointer;
}

/* Stili per le risposte corrette/errate */
.answer-option.correct-answer {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.answer-option.wrong-answer {
    border-color: #F44336;
    background-color: rgba(244, 67, 54, 0.1);
}

/* Stili per le domande corrette/errate */
.question-correct .question-text::before {
    content: "✓";
    color: #4CAF50;
    margin-right: 10px;
    font-weight: bold;
}

.question-wrong .question-text::before {
    content: "✗";
    color: #F44336;
    margin-right: 10px;
    font-weight: bold;
}

/* Pulsante avanti per domande a Multiple Choice */
.next-question-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.next-question-btn:hover:not(:disabled) {
    background-color: #0b7dda;
}

.next-question-btn.disabled,
.next-question-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* Pulsante Check Answers */
.boost-quiz-submit {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.boost-quiz-submit:hover:not(.disabled) {
    background-color: #45a049;
}

.boost-quiz-submit.disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

/* Spiegazione */
.question-explanation {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f8ff;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
}

.explanation-label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Barra di progresso */
.quiz-progress {
    margin-bottom: 30px;
}

.question-counter {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.quiz-progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #2196F3;
    width: 0;
    transition: width 0.3s ease;
}

/* Risultati */
.boost-quiz-results {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.results-header h3 {
    margin-top: 0;
    text-align: center;
}

.results-score {
    text-align: center;
    margin: 20px 0;
}

/* .score-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #2196F3;
    color: white;
} */

.score-value {
    font-size: 30px;
    font-weight: bold;
}

.score-percent {
    font-size: 16px;
}

.score-message {
    margin-top: 10px;
    font-weight: bold;
}

.score-passed {
    color: #4CAF50;
}

.score-failed {
    color: #F44336;
}

.boost-quiz-retry {
    display: inline-block;
    padding: 8px 16px;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.boost-quiz-retry:hover {
    background-color: #546E7A;
}

/* Quiz taxonomies */
.boost-quiz-taxonomies {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.boost-quiz-categories,
.boost-quiz-tags,
.boost-quiz-difficulty {
    margin-bottom: 5px;
}

.taxonomy-label {
    font-weight: bold;
    margin-right: 5px;
}

.difficulty-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    color: white;
    font-size: 12px;
}

/* Stili per i messaggi di risultato */
.score-perfect {
    color: #000;
}

/* Migliora gli stili esistenti */
.score-passed {
    color: #000;
}

.score-failed {
    color: #000;
}

/* Migliora l'aspetto visivo del cerchio del punteggio */
/* .score-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f8f8f8;
    border: 6px solid #ddd;
    margin: 0 auto 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
} */

.score-perfect-animation .score-circle {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

.score-passed .score-circle {
    border-color: #4CAF50;
}

.score-failed .score-circle {
    border-color: #F44336;
}

.score-value {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
}

.score-percent {
    font-size: 18px;
}

/* Update la transizione per i messaggi di feedback */
.score-message {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.quiz-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    margin-right: 10px;
    font-size: 12px;
    font-weight: bold;
}

.quiz-status.free {
    background-color: #4CAF50;
    color: white;
}

.quiz-status.premium {
    background-color: #2196F3;
    color: white;
}

.boost-quiz-wrapper .boost-quiz-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.quiz-item.free .quiz-title {
    color: #4CAF50;
}

.quiz-item.premium .quiz-title {
    color: #2196F3;
}

.quiz-item .quiz-title.locked {
    color: #999;
    cursor: not-allowed;
}