/* ==========================================
   STILE DSA - TEORIA CALCOLO COMBINATORIO
   Alta leggibilità, contrasto riposante,
   spaziatura aumentata.
   ========================================== */

:root {
    --bg-dsa: #fdf6e3;
    --text-dsa: #202124;
    --green-dark: #2e7d32;
    --green-light: #4CAF50;
}

body {
    font-family: 'Verdana', 'Geneva', sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 20px;
    color: var(--text-dsa);
    line-height: 1.9;
    letter-spacing: 0.04em;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* --- HEADER --- */
header.header-box {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    border: 2px dashed #28a745 !important;
    padding: 15px !important;
    background-color: white !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 80px !important;
    border-radius: 8px !important;
    margin-bottom: 25px !important;
}

header.header-box img.left-image {
    max-height: 45px !important;
    width: auto !important;
    display: block !important;
}

header.header-box img.right-image {
    max-height: 60px !important;
    width: auto !important;
    display: block !important;
}

/* --- TITOLI --- */
h1, h2, h3 { color: var(--green-dark); }

h1 { font-size: 1.8em; }

h2 {
    font-size: 1.3em;
    margin-top: 25px;
    border-bottom: 2px solid #c8e6c9;
    padding-bottom: 5px;
}

p, li {
    line-height: 1.9;
    font-size: 1.05em;
}

/* --- FISARMONICA (ACCORDION) --- */
.section {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.section-button {
    width: 100%;
    padding: 18px 20px;
    font-size: 1.2em;
    background: #e8f5e9;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--green-dark);
    font-family: 'Verdana', sans-serif;
    transition: background 0.3s ease;
}

.section-button:hover {
    background: #c8e6c9;
}

.section-content {
    display: none;
    padding: 25px;
    border: 1px solid #e8f5e9;
    background-color: #fcfdfc;
    border-radius: 0 0 8px 8px;
    line-height: 1.9;
}

.arrow {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

/* --- BOX FORMULE --- */
.formula {
    background: #fff;
    padding: 15px;
    border-left: 5px solid var(--green-light);
    margin: 15px 0;
    border-radius: 5px;
    font-size: 1.15em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* --- BOX ESEMPIO --- */
.example-box {
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 5px solid var(--green-dark);
    margin: 20px 0;
    border-radius: 8px;
}

/* --- MathJax ingrandito per DSA --- */
:not(.tabella-formule) > .mjx-chtml,
:not(.tabella-formule) > .MathJax {
    font-size: 1.2rem !important;
    margin: 12px 0 !important;
}

/* --- FOOTER --- */
.footer-container {
    padding: 30px 20px;
    border-top: 3px solid var(--green-light);
    background-color: #f9f9f9;
    text-align: center;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-row { width: 100%; }

.flex-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-footer {
    display: inline-block;
    padding: 12px 22px;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: 'Verdana', sans-serif;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.btn-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.2);
    background-color: white !important;
}

.btn-bordeaux { background-color: #9b1c1c; color: white; border-color: #9b1c1c; }
.btn-bordeaux:hover { color: #9b1c1c !important; }

.btn-teal { background-color: #008080; color: white; border-color: #008080; }
.btn-teal:hover { color: #008080 !important; }

.btn-dsa { background-color: #ff9800; color: white; border-color: #ff9800; }
.btn-dsa:hover { color: #ff9800 !important; }

.btn-test-dark { background-color: #0056b3; color: white; border-color: #0056b3; }
.btn-test-dark:hover { color: #0056b3 !important; }

.btn-viola { background-color: #6a1b9a; color: white; border-color: #6a1b9a; }
.btn-viola:hover { color: #6a1b9a !important; }

.btn-green-light { background-color: #45a049; color: white; border-color: #45a049; }
.btn-green-light:hover { color: #45a049 !important; }

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .container { padding: 15px; }
    body { padding: 5px; }
    header.header-box { flex-direction: column !important; text-align: center; }
    .section-button { font-size: 1.05em; padding: 14px; }
    .btn-footer { width: 100%; text-align: center; }
}

/* --- STAMPA --- */
@media print {
    body { background: white !important; }
    .section-content { display: block !important; }
    .footer-container { display: none !important; }
    .section-button .arrow { display: none; }
    header.header-box { display: flex !important; border: 1px solid #28a745 !important; }
}
.btn-questionario { background-color: #e65100; color: white; border-color: #e65100; }
.btn-questionario:hover { color: #e65100 !important; }
/* --- TABELLA FORMULE RESPONSIVE --- */
.tabella-formule {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.78rem;
}

.tabella-formule th {
    background-color: #4CAF50;
    color: white;
    padding: 14px;
    text-align: left;
    border: 1px solid #ddd;
}

.tabella-formule td {
    padding: 14px;
    border: 1px solid #ddd;
    text-align: center;
}

.tabella-formule td:first-child {
    text-align: left;
}
.scroll-hint { display: none; }

@media (max-width: 768px) {
    .scroll-hint { display: block; }
}
}
