/* Font */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');

html, body { height: 100%; }
body { font-family: 'Titillium Web', sans-serif; background-color: #f0f3f6; }

/* Titolo App */
.app-title {
    color: #333;
    font-weight: 600;
}

/* Card e Bottoni (Colori Ufficiali Designers Italia per la PA) */
.quiz-card, .card { border: none; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card-header { background-color: #0066cc; color: white; font-weight: 600; } /* Blu Italia */
.btn { transition: all 0.2s ease-in-out; }
.btn-primary { background-color: #0066cc; border-color: #0066cc; }
.btn-primary:hover { background-color: #0052a3; border-color: #004990; transform: translateY(-2px); }
.btn-success { background-color: #198754; border-color: #198754; }
.btn-success:hover { background-color: #157347; border-color: #146c43; transform: translateY(-2px); }
.btn-info { background-color: #0dcaf0; border-color: #0dcaf0; }
.btn-info:hover { background-color: #31d2f2; border-color: #25cff2; transform: translateY(-2px); }

/* Stile Timer */
#timer {
    background-color: white;
    color: #0066cc;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Animazioni Domande */
#question-animation-wrapper {
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
}
.question-fade-out {
    opacity: 0;
    transform: translateX(-50px);
}
.question-fade-in {
    opacity: 1;
    transform: translateX(0);
}

/* Stili Risposte Quiz */
.list-group-item-action { 
    cursor: pointer; 
    border-radius: 6px; 
    margin-bottom: 10px; 
    border: 1px solid #ddd; 
    position: relative; 
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-group-item-action:hover {
    background-color: #f0f3f6;
    border-color: #0066cc;
}
.list-group.answered .list-group-item-action { 
    pointer-events: none; 
}

/* Stile per la risposta selezionata (MODALITA' ESAME) */
.list-group-item.answered-selected {
    background-color: #0066cc !important;
    border-color: #0066cc !important;
    color: white !important;
    font-weight: bold;
}

/* Stili per la pagina di REVISIONE e ALLENAMENTO */
/* Risposta CORRETTA (verde) */
.list-group-item.correct { 
    background-color: #d1e7dd !important; 
    border-color: #28a745 !important; 
    color: #0f5132 !important; 
    font-weight: bold;
}

/* Risposta selezionata dall'utente ed ERRATA (rosso) */
.list-group-item.incorrect { 
    background-color: #f8d7da !important; 
    border-color: #dc3545 !important; 
    color: #58151c !important; 
    font-weight: bold;
}
.list-group-item.incorrect::after {
    content: ' (La tua risposta)';
    font-weight: normal;
    font-style: italic;
    font-size: 0.9em;
    margin-left: 8px;
}

.progress-bar { 
    background-color: #0066cc; 
    transition: width 0.4s ease;
    color: white;
    font-weight: bold;
}

/* =================================== */
/* STILI PER ATTESTATO E RISULTATI     */
/* =================================== */

#certificate {
    background-color: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    border-radius: 15px;
    font-family: 'Georgia', serif;
}

#certificate::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 3px double #0066cc;
    border-radius: 5px;
    pointer-events: none;
}

.logo-certificato { height: 90px; }
.cert-title { font-size: 1.5rem; font-weight: bold; color: #333; }
.cert-subtitle { font-size: 1.2rem; color: #555; }
.cert-main-title { color: #0066cc; font-weight: bold; letter-spacing: 1px; }
#cert-candidate-name { color: #0052a3; font-weight: bold; font-style: italic; font-size: 2.2rem; }
.result-badge { font-size: 2.2rem; font-weight: 700; padding: 0.5rem 2rem; border-radius: 8px; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.result-badge.promosso { background-color: #28a745; }
.result-badge.bocciato { background-color: #dc3545; }

/* Stile per riepilogo per categoria */
.category-summary-item .progress {
    height: 20px;
    font-size: 0.9rem;
}

@media print {
    body, main { background-color: white !important; font-size: 12pt; }
    #non-printable-section { display: none !important; }
    .container { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    #certificate { box-shadow: none !important; border: 2px solid black !important; width: 100%; height: 100%; page-break-inside: avoid; border-radius: 0; }
    #certificate::before { border: 4px double #000000 !important; border-radius: 0; }
    .result-badge.promosso, .result-badge.bocciato { -webkit-print-color-adjust: exact; color-adjust: exact; }
    footer { display: none !important; }
}

#review-container .card-header { background-color: #f8f9fa; }
#review-container .border-success { border-width: 2px !important; }
#review-container .border-danger { border-width: 2px !important; }

/* =================================== */
/* STILI PER PAGINA STUDIO (OBSOLETO) E ALLENAMENTO  */
/* =================================== */
.study-question-item {
    font-size: 1.05rem;
    font-weight: 600;
}

.study-answer-content {
    margin-top: 15px;
    padding: 15px;
    background-color: #e9f5ff; /* Un blu molto chiaro per lo sfondo */
    border-left: 5px solid #0066cc; /* Bordo blu a sinistra */
    border-radius: 5px;
}

.study-answer-content p {
    margin-bottom: 5px;
}

.study-answer-content .answer-correct {
    font-weight: bold;
    color: #0d6efd;
}

.study-answer-content .explanation {
    font-weight: normal;
    font-size: 0.95rem;
    color: #333;
}