/* quiz.css */

/* Header esterno alla card */
.quiz-external-header {
    margin-bottom: 20px;
    padding: 0 5px;
}

.quiz-external-header h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin: 0;
}

.quiz-external-header p {
    margin-top: 5px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#mode-badge {
    margin:5px 0 0 0;
    color: #b01c17;
}

/* Contenitore Quiz con altezza fissa */
.quiz-container-fixed {
    min-height: 320px; /* Come richiesto */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 30px; /* Più respiro interno */
}

#progress-container {
    background: #eee; 
    height: 6px; 
    border-radius: 3px; 
    margin-bottom: 25px; 
    width: 100%;
}

#progress-bar{
    background: var(--primary-color); 
    width: 0%; 
    height: 100%; 
    border-radius: 3px; 
    transition: 0.3s;
}

#quiz-content {
    width: 100%; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column;
}

.question-number {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.25rem; /* Dimensione originale */
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-dark);
    line-height: 1.4;
}

.question-text-container {
    flex: 1; /* Il testo prende tutto lo spazio disponibile */
}

.question-image-container {
    flex-shrink: 0;
    max-width: 250px; /* Regola la grandezza massima dell'immagine */
}

.quiz-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: block;
}



.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}



.options-grid {
    display: grid;
    gap: 12px;
    width: 100%;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    color: var(--text-dark);
    
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.button-container {
    margin-top: auto; 
    padding-top: 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

#btn-skip {
    background: #666;
     color: white; 
     display: none;
}

#btn-next {
    display: none;
}


/* --- STILE PULSANTI VERO / FALSO --- */
.vf-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.vf-btn {
    width: 140px;
    height: 140px;
    border-radius: 15px;
    border: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    -webkit-user-select: none;
    user-select: none;
    position: relative !important;
    overflow: hidden !important;
}

.vf-btn:active {
    transform: scale(0.95);
}

.vf-true {
    background-color: #28a745; /* Verde */
}

.vf-false {
    background-color: #dc3545; /* Rosso */
}

/* Stati di Feedback (per modalità Apprendimento) */
.vf-btn.feedback-correct {
    opacity: 1 !important;
    box-shadow: 0 0 15px #28a745;
    transform: scale(1.05);
}

.vf-btn.feedback-wrong {
    opacity: 0.6; /* Leggermente più visibile per vedere la X */
    box-shadow: 0 0 30px #dc3545;
    border: 2px solid #000; /* Opzionale: bordo nero per staccare */
}

.vf-btn.feedback-wrong::after {
    content: "\2716"; /* Codice Unicode della X pesante */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;     /* Dimensione grande per coprire bene il tasto */
    color: #000000;      /* Nero pieno */
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); 
}

.vf-btn.feedback-correct::after {
    content: "\2714"; /* Codice Unicode per il CHECK (Heavy Check Mark) */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: #000000;
    font-weight: bold;
    z-index: 10;
}

/* Per disabilitare click dopo la risposta */
.vf-disabled {
    pointer-events: none;
}



/* Feedback colori */
.option-btn.correct {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white;
}

.option-btn.wrong {
    background-color: #d9534f !important;
    border-color: #d9534f !important;
    color: white;
}

.explanation-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f7ff;
    border-left: 5px solid var(--primary-color);
    border-radius: 4px;
}

/* Schermata Risultati */
#result-screen{
    display: none; 
    width: 100%;
}

#box-point{
    text-align: center;
}

#timeout-banner {
    display: none; 
    background: #fee2e2; 
    color: #b91c1c; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    border: 1px solid #fecaca; 
    font-weight: bold;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 20px auto;
    border: 8px solid;
}

#res-status {
    font-size: 1.4rem; 
    font-weight: bold;
}

#res-detail {
    margin-bottom: 20px;
}

.res-btn-box {
    display: flex; 
    gap: 10px; 
    justify-content: center; 
    margin-bottom: 30px;
}

#riprova {
width: auto;
}

#torna-home {
background: #333;
 color: white; 
text-decoration: none;
 width: auto; 
display: inline-flex; 
align-items: center;
}

/* Stili per il Riepilogo Finale */
.review-container {
    margin-top: 30px;
    text-align: left;
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

.review-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.review-q-text {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.review-option {
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn-review-list {
    text-align: center;
     margin-top: 30px;
      display: flex; 
      gap: 10px; 
      justify-content: center;
}

/* Sfumature richieste */
.bg-correct {
    background: linear-gradient(90deg, #d4edda 0%, #ffffff 100%);
    border-left: 5px solid var(--secondary-color);
}

.bg-wrong {
    background: linear-gradient(90deg, #f8d7da 0%, #ffffff 100%);
    border-left: 5px solid #d9534f;
}

.bg-skipped {
    background: linear-gradient(90deg, #e9ecef 0%, #ffffff 100%);
    border-left: 5px solid #6c757d;
}

.review-label {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

/* --- TIMER STILE MINIMAL TECH --- */
.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: 'Courier New', Courier, monospace; /* Look tecnico e numeri stabili */
    font-size: 1.5rem;
    font-weight: 700;
    color: #444;
    transition: all 0.4s ease;
}

.timer-display i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Solo cambio colore testo per gli stati */
.timer-display.warning {
    color: #f39c12;
    border-color: #f39c12;
}

.timer-display.danger {
    color: #e74c3c;
    border-color: #e74c3c;
    background: #fff5f5;
}

@media (max-width: 768px) {
    .timer-display {
        font-size: 1.2rem;
        padding: 5px 12px;
    }
}

/* Mobile: l'immagine si sposta sotto il testo */
@media (max-width: 600px) {
    .question-header {
        flex-direction: column;
        align-items: center;
    }
    .question-image-container {
        max-width: 100%;
    }
}