/* Stile per Compiti - Versione DSA */
body {
  font-family: Arial, Verdana, sans-serif;
  background: #f5f7fa;
  margin: 0;
  padding: 20px;
  letter-spacing: 0.04em;
  line-height: 1.9;
}

.container {
  width: 95%;        /* Quasi tutta la larghezza sui cellulari */
  max-width: 1100px; /* Non supera mai questa larghezza sui monitor grandi */
  margin: auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* HEADER */
.header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e8f5e9;
}

.header h1 {
  color: #2e7d32;
  margin-bottom: 10px;
  font-size: 2em;
}

.subtitle {
  font-size: 1.1em;
  color: #666;
  margin-top: 10px;
}

/* SEZIONI ESPANDIBILI */
.section {
  margin-bottom: 20px;
}

.section h2 {
  margin: 0;
  padding: 0;
  font-size: 1em;
}

.section-button {
  width: 100%;
  padding: 15px;
  font-size: 1.2em;
  background: #e8f5e9;
  border: 2px solid #c8e6c9;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-weight: bold;
  color: #2e7d32;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-button:hover {
  background: #c8e6c9;
  transform: translateY(-2px);
}

.section-content {
  display: none;
  padding: 20px;
  border: 2px solid #e8f5e9;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #fafafa;
}

.section-content.active {
  display: block;
}

.arrow {
  transition: transform 0.3s ease;
  font-size: 0.8em;
}

.arrow.rotated {
  transform: rotate(180deg);
}

/* CONTENUTI SPECIFICI */
.problem-text {
  background: #f0f4f8;
  padding: 15px;
  margin: 15px 0;
  border-left: 5px solid #2e7d32;
  border-radius: 4px;
}

.solution-box {
  background: white;
  padding: 20px;
  margin-top: 20px;
  border-radius: 8px;
  border: 2px solid #4caf50;
}

.step {
  background: #f1f8e9;
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
}

.formula-box {
  background: white;
  padding: 15px;
  margin: 15px 0;
  border-left: 4px solid #4caf50;
  border-radius: 4px;
  overflow-x: auto;
}

.result-box {
  background: #e8f5e9;
  padding: 15px;
  border: 2px solid #2e7d32;
  border-radius: 8px;
}

/* STAMPA */
@media print {
  body { background: white; padding: 0; }
  .container { max-width: 100%; box-shadow: none; border: none; }
  .section-button { background: white !important; border: 1px solid #ccc !important; }
  .arrow, .nav-buttons { display: none !important; }
  .section-content { display: block !important; border: none !important; }
  .section { page-break-inside: avoid; margin-bottom: 30px; }
  .step, .formula-box, .solution-box { page-break-inside: avoid; border: 1px solid #eee !important; }
}

/* NAVIGAZIONE */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.btn-nav {
  padding: 12px 24px;
  background: white;
  color: #2e7d32;
  border: 2px solid #2e7d32;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.btn-nav:hover { background: #2e7d32; color: white; }
.graph {
  text-align: center;      /* Centra l'immagine e la didascalia */
  margin: 25px 0;          /* Distanzia il grafico dal testo */
  background-color: #ffffff !important; /* Sfondo bianco puro */
  padding: 20px;           /* Spazio interno tra bordo bianco e immagine */
  border: 1px solid #eee;  /* Una linea sottile per definire i bordi */
  border-radius: 12px;     /* Angoli arrotondati come il resto del layout */
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Ombra leggera per farlo "staccare" dal fondo */
}

.graph img {
  display: block;          /* Permette l'uso di margin auto */
  margin: 0 auto 10px auto; /* Centra l'immagine e dà spazio alla didascalia */
  max-width: 95%;          /* Leggermente più grande per sfruttare il bianco */
  height: auto;
}
/* Aggiungi questo al tuo stile-compiti-dsa.css */
.header-box {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 15px !important;
  border: 2px dashed #28a745 !important;
  border-radius: 8px !important;
  background-color: white !important;
  margin-bottom: 25px !important;
}

@media (max-width: 600px) {
  .header-box {
    flex-direction: column !important;
    gap: 15px !important;
  }
}
/* --- MIGLIORAMENTO TABELLE ALTA LEGGIBILITÀ --- */
table {
    border-collapse: collapse;
    width: 100%; /* Occupa tutto lo spazio disponibile */
    margin: 20px 0;
    background-color: #ffffff;
}

table th {
    background-color: #e8f5e9; /* Verde chiarissimo per distinguere l'intestazione */
    color: #2e7d32;            /* Testo verde scuro coerente con il sito */
    font-weight: bold;
}

table td, table th {
    padding: 12px;
    border: 2px solid #ccd1d9 !important; /* Bordi netti e visibili */
    text-align: center;
}

/* Effetto riga alternata (Zebra) per non perdere il segno */
table tr:nth-child(even) {
    background-color: #fcfdfc;
}
.instruction-box {
    background-color: #e8f5e9; 
    border-left: 5px solid #2e7d32; 
    padding: 15px;
    margin: 20px auto; /* Centrato */
    border-radius: 4px;
    font-size: 0.9em;
    color: #1b5e20;
    display: block; 
    text-align: left; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 90%; /* Evita che sia troppo largo su schermi giganti */
}

/* Per nasconderlo su PC, tenere solo questa, 
   ma per ora commentarla per vedere se il codice funziona */
/* @media screen and (min-width: 1024px) {
    .instruction-box { display: none; }
} 
*/