:root {
    --primary-color: #4CAF50;
    --secondary-color: #66BB6A;
    --danger-color: #f44336;
    --success-color: #8BC34A;
    --text-color: #333;
    --background-color: #f4f4f4;
    --card-background: #fff;
    --border-color: #ddd;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background: var(--card-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Utilità e Schermi */
.hidden { display: none !important; }
.screen { padding: 20px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 25px; }

/* Area di Input */
.input-area {
    background-color: #e8f5e9;
    border: 1px dashed var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
}

.nota { font-size: 0.9em; color: #6a6a6a; margin-top: 10px; }

/* Pulsanti */
.mode-buttons {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap; /* Permette l'andare a capo su schermi piccoli */
    gap: 15px;
    margin-top: 15px;
}

.btn {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

.btn:hover:not(:disabled) {
    background-color: var(--secondary-color);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-big {
    padding: 15px 25px;
    font-size: 1.2em;
    flex-grow: 1;
    min-width: 250px;
}

.btn-secondary {
    background-color: #9E9E9E; /* Grigio */
    margin-top: 15px;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #757575;
}

/* Visualizzazione Timer */
.timer-display {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--danger-color);
    margin-top: 15px;
    padding: 5px;
    background: #ffebee;
    border-radius: 5px;
    text-align: center;
}

/* Area Quiz */
.question-card {
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.question-text {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.options-list {
    list-style: none;
    padding: 0;
}

.options-list li {
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.options-list li:hover {
    background-color: #f0fff0;
    border-color: var(--secondary-color);
}

/* Stili per la Risposta Selezionata */
.options-list li.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Area Risultati */
.results-area {
    text-align: center;
    padding: 30px;
    background-color: #e8f5e9;
    border-radius: 8px;
}

#final-score {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

#exam-grade {
    font-size: 2em;
    font-weight: bold;
    color: var(--danger-color);
    margin: 10px 0;
}

/* Cronologia */
#score-history {
    list-style-type: none;
    padding: 0;
}

#score-history li {
    background-color: #fff;
    border-left: 3px solid var(--secondary-color);
    padding: 10px;
    margin-bottom: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Stile per la nuova sezione di selezione casuale */
.custom-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    margin-top: 20px;
}

/* Stile base per le card di revisione */
.review-card {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left: 5px solid; /* Verrà impostato da JS */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Stile per le card corrette */
.review-card-correct {
    background-color: #e8f5e9; /* Verde molto chiaro */
}

/* Stile per le card sbagliate */
.review-card-wrong {
    background-color: #ffebee; /* Rosso molto chiaro */
}

/* Assicura che l'area di revisione abbia il padding corretto */
#review-area {
    padding: 20px;
}