/* Stili Generali Matefilia (ripetuti per coerenza o da importare da un file CSS esterno) */
:root {
    --primary: #2c3e50; /* Blu scuro/Grigio per testi principali */
    --secondary: #3498db; /* Blu per link/bottoni */
    --accent: #e74c3c; /* Rosso per accenti/errori */
    --background: #f8f9fa; /* Sfondo leggero */
    --border-color: #dee2e6; /* Colore per bordi/linee */
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background);
    color: var(--primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header-box {
    width: 100%;
    border: 2px dashed #008000;
    box-sizing: border-box;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    min-height: 80px;
    margin-bottom: 30px;
}

.left-image, .right-image {
    max-height: 50px;
    height: auto;
    margin: 10px;
}

h1, h2, h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5em;
    margin-top: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}
h2 {
    font-size: 1.8em;
    margin-top: 0.5rem;
    color: #4CAF50; /* Verde più scuro */
}

/* Contenitore principale del compito e soluzioni */
.task-container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}

/* Stili per la sezione link - Rimosso il link PDF, ma mantenuta la classe se volessi aggiungere altri link in futuro */
.links-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f0f4f7;
    border-radius: 8px;
    border: 1px dashed #c1d3e0;
}

.links-section .link-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    font-size: 1em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.links-section .link-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.links-section .link-button span {
    margin-left: 8px;
}

/* Icone per i bottoni */
.link-button.pdf::before {
    content: "📄";
    font-size: 1.2em;
}
.link-button.solution::before {
    content: "✅";
    font-size: 1.2em;
}

/* Stili per le sezioni interne (Problema, Quesiti, Soluzioni) */
.section-title {
    color: var(--secondary);
    font-size: 1.6em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Nuovo stile per Esercizio 1 (e 2) */
.exercise-title {
    color: var(--secondary);
    font-size: 1.6em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.problem, .question {
    margin-bottom: 2rem;
    line-height: 1.7;
}

.problem-text {
    font-weight: bold;
    margin-left: 8px;
    padding-left: 17px;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.1em;
    line-height: 1.7;
}

.problem ol, .question ol {
    list-style: decimal;
    margin-left: 20px;
}
.problem li, .question li {
    margin-bottom: 1em;
}

/* Stile specifico per le formule matematiche con MathJax */
.math {
    font-family: 'Times New Roman', serif;
    font-size: 1.1em;
}

/* SOLUTION STYLES */
.solution {
    display: none;
    background-color: #f8f9fa;
    padding: 15px 15px 15px 25px;
    margin: 15px 0 15px 8px;
    border-left: 4px solid #0000FF;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

button {
    background-color: #a5d6a7;
    color: black;
    border: 2px solid #81c784;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 8px 4px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: 600;
}
button:hover {
    background-color: #81c784;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.graph {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}
.graph img {
    max-width: 500px;
    height: auto;
    border-radius: 5px;
}

.separator {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #28a745, transparent);
    margin: 15px 0 25px 0;
}
 
/* Footer styles */
.footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #777;
    font-size: 0.9em;
}

.footer .button-link-style {
    display: inline-block;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.footer .button-link-style:hover {
    background: #2980b9;
}

/* Responsive Design styles */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.6em;
    }
    .task-container {
        padding: 15px;
    }
    .links-section {
        flex-direction: column;
        gap: 10px;
    }
    .links-section .link-button {
        width: 90%;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .header-box {
        flex-direction: column;
        align-items: center;
    }
    .left-image, .right-image {
        margin-bottom: 10px;
    }
}
.centered-image-container {
    text-align: center;
}