/* Estils generals del body */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6; /* Un color de fons clar */
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ocupa tota l'altura de la finestra */
}

/* Estils per al header */
header {
    background-color: #4CAF50; /* Verd distintiu */
    color: white;
    padding: 1.5em 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}

header p {
    font-size: 1.1em;
    margin-top: 0.5em;
}

/* Estils per al contenidor principal del test */
main {
    flex-grow: 1; /* Permet que el contingut principal ocupi l'espai disponible */
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Estils per al footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1em 0;
    margin-top: auto; /* Embotona el footer a la part inferior */
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* --- Estils específics del Test --- */

.question-block {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.15em;
    margin-bottom: 15px;
    font-weight: bold;
    color: #4CAF50; /* Verd igual que el header */
}

.options label {
    display: block; /* Cada opció en una nova línia */
    margin-bottom: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.options label:hover {
    background-color: #e0e0e0;
}

.options input[type="radio"] {
    margin-right: 10px;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background-color: #007bff; /* Blau per al botó principal */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 30px;
}

.submit-button:hover {
    background-color: #0056b3;
}

/* Estils per a la correcció */
.question-block.correct {
    background-color: #e6ffe6; /* Fons verd clar per a respostes correctes */
    border-color: #27ae60;
}

.question-block.incorrect {
    background-color: #ffe6e6; /* Fons vermell clar per a respostes incorrectes */
    border-color: #e74c3c;
}

.question-block.unanswered {
    background-color: #fff9e6; /* Fons groc molt clar per a respostes sense contestar */
    border-color: #e67e22;
}

.correct {
    color: #27ae60;
    font-weight: bold;
}

.incorrect {
    color: #e74c3c;
    font-weight: bold;
}

.unanswered {
    color: #e67e22;
    font-weight: bold;
}

.correct-option {
    background-color: #d4edda; /* Resalta l'opció correcta dins del bloc */
    border: 1px solid #28a745;
    padding: 3px 5px;
    border-radius: 3px;
}

/* Quan les preguntes estan disabled per mostrar el resultat */
.question-block input[type="radio"]:disabled + label {
    cursor: default;
    opacity: 0.8;
}

.question-block input[type="radio"]:disabled + label:hover {
    background-color: transparent; /* No canviar el fons al passar el ratolí */
}

/* Estils per a la responsivitat (adaptació a mòbils) */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 0.9em;
    }

    main {
        margin: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    main {
        margin: 5px;
        padding: 10px;
    }
}
/* --- Estils per a la Navegació (Nav) --- */
nav {
    margin-top: 15px;
}

.main-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Utilitza flexbox per posar els elements en línia */
    justify-content: center; /* Centra els elements */
    gap: 20px; /* Espai entre elements */
    flex-wrap: wrap; /* Permet que els elements saltin de línia en pantalles petites */
}

.main-nav li a {
    text-decoration: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.2); /* Fons lleugerament transparent */
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
}

.main-nav li a:hover {
    background-color: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px); /* Petit efecte hover */
}

.main-nav li a.active {
    background-color: #2e8b57; /* Verd més fosc per a la pàgina activa */
    font-weight: bold;
    pointer-events: none; /* No clickable si ja està actiu */
}

/* Ajust per a mòbils */
@media (max-width: 600px) {
    .main-nav {
        flex-direction: column; /* Posa els elements en columna */
        align-items: center; /* Centra els elements */
    }

    .main-nav li {
        width: 90%; /* Ample gairebé complet per als botons */
        margin-bottom: 10px;
    }
}