/* Sezione della barra di progresso */
.progress-section {
    padding: 30px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    transition: opacity 0.3s ease-in-out;
}

.progress-bar {
    width: 100%; height: 8px; background: #e2e8f0;
    border-radius: 4px; overflow: hidden; margin-bottom: 15px;
}

.progress-fill {
    height: 100%; background: linear-gradient(90deg, #4f46e5, #06b6d4);
    width: 0%; transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1); border-radius: 4px;
}

.progress-text-container {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px; margin-top: 10px; margin-bottom: 15px;
}

.progress-text { font-weight: 600; color: #475569; }

.question-jump-section { display: flex; align-items: center; gap: 8px; }
.question-jump-section label { font-weight: 500; color: #475569; font-size: 0.9rem; }
#questionJump {
    padding: 6px 10px; border-radius: 6px; border: 1px solid #cbd5e1;
    background-color: white; font-family: 'Inter', sans-serif;
    font-size: 0.9rem; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
#questionJump:focus {
    outline: none; border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Stili per la Mappa delle Domande */
.question-map {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding-top: 10px; border-top: 1px solid #e2e8f0; margin-top: 15px;
}

.question-marker {
    width: 28px; height: 28px; border: 1px solid #d1d5db;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; color: #4b5563;
    cursor: pointer; background-color: #f9fafb; transition: all 0.2s ease-in-out;
}
.question-marker:hover { border-color: #6366f1; background-color: #eef2ff; color: #4338ca; }
.question-marker.current {
    border-color: #4f46e5; background-color: #4f46e5; color: white;
    transform: scale(1.15); box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.question-marker.answered { background-color: #e5e7eb; border-color: #9ca3af; color: #374151; }
.question-marker.correct { background-color: #10b981; color: white; border-color: #059669; }
.question-marker.incorrect { background-color: #ef4444; color: white; border-color: #dc2626; }

/* Contenuto del quiz (domande) */
.quiz-content { padding: 40px; flex-grow: 1; transition: opacity 0.3s ease-in-out; }
.question-card {
    background: white; border-radius: 16px; padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); border: 1px solid #f1f5f9;
    animation: fadeInQuestion 0.5s forwards;
}
@keyframes fadeInQuestion {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-text {
    font-size: 1.15rem; line-height: 1.6; color: #1e293b;
    margin-bottom: 25px; font-weight: 500;
}

/* Stili specifici per le card delle domande */
.question-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
}
.pattern-category, .question-type, .question-number {
    padding: 8px 16px; border-radius: 20px; font-size: 0.85rem;
    font-weight: 600; color: white;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    margin-bottom: 20px;   /
}
.grasp { background: linear-gradient(135deg, #10b981, #059669); }
.gof-creational { background: linear-gradient(135deg, #f59e0b, #d97706); }
.gof-structural { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gof-behavioral { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* Opzioni di risposta */
.options { display: grid; gap: 15px; margin-bottom: 25px; }
.options.true-false { grid-template-columns: 1fr 1fr; }
.option {
    padding: 15px 25px; border: 2px solid #e2e8f0; border-radius: 12px;
    background: white; cursor: pointer; transition: all 0.2s ease;
    font-weight: 500; text-align: left; color: #374151;
}
.options.true-false .option { text-align: center; }
.option:not(.selected):not(.correct):not(.incorrect):hover {
    border-color: #4f46e5; transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.1);
}
.option.selected {
    border-color: #4f46e5; background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: white; box-shadow: 0 6px 20px rgba(79, 70, 229, 0.2);
}
.option.correct {
    border-color: #10b981; background: linear-gradient(135deg, #10b981, #059669); color: white;
}
.option.incorrect {
    border-color: #ef4444; background: linear-gradient(135deg, #ef4444, #dc2626); color: white;
}
.option.disabled { cursor: not-allowed; opacity: 0.7; }

/* Spiegazione della risposta */
.explanation {
    margin-top: 25px; padding: 20px; background: #f1f5f9;
    border-radius: 10px; border-left: 4px solid #4f46e5;
    animation: fadeInQuestion 0.5s 0.2s forwards;
}
.explanation h4 { color: #4f46e5; margin-bottom: 10px; }
.explanation p { color: #475569; line-height: 1.6; }

/* Controlli di navigazione */
.controls {
    padding: 30px 40px; background: #f8fafc; border-top: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 15px;
}
.btn {
    padding: 12px 28px; border: none; border-radius: 10px;
    font-weight: 600; cursor: pointer; transition: all 0.2s ease; font-size: 0.95rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #4f46e5, #06b6d4); color: white; }
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: white; }

.current-stats {
    display: flex; gap: 20px; font-weight: 600; color: #475569;
    flex-grow: 1; justify-content: center;
}
.current-stats .correct-count { color: #10b981; }
.current-stats .incorrect-count { color: #ef4444; }

/* Sezione dei risultati */
.results { text-align: center; padding: 60px 40px; }
.score-circle {
    width: 150px; height: 150px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 30px;
}
.score-inner {
    width: 120px; height: 120px; background: white; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-percentage { font-size: 2.2rem; font-weight: 700; color: #4f46e5; }
.score-label { font-size: 0.9rem; color: #6b7280; margin-top: 5px; }
.results h2 { font-size: 2rem; color: #1e293b; margin-bottom: 15px; }
.results p { font-size: 1.1rem; color: #6b7280; margin-bottom: 30px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin: 40px 0; }
.stat { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
.stat-value { font-size: 1.8rem; font-weight: 700; }
#correctStat .stat-value { color: #10b981; }
#incorrectStat .stat-value { color: #ef4444; }
.stat-label { font-size: 0.9rem; color: #6b7280; margin-top: 5px; }

.hidden { display: none !important; }

/* Media Queries specifiche per i quiz */
@media (max-width: 768px) {
    .quiz-content, .controls, .progress-section { padding: 20px; }
    .options.true-false { grid-template-columns: 1fr; } /* Vero/Falso in colonna su schermi piccoli */
    .controls { flex-direction: column; gap: 15px; }
    .current-stats { width: 100%; justify-content: space-around; }
    .progress-text-container { flex-direction: column; align-items: flex-start; gap: 12px; }
    .question-jump-section { width: 100%; }
    #questionJump { flex-grow: 1; }
    .question-map { justify-content: center; }
}