/* --- BASE & LAYOUT --- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    padding-top: 56px; /* Altezza standard navbar Bootstrap 5 */
    background: #003366;
    font-family: system-ui, -apple-system, sans-serif;
    color: #333;
}

/* --- NAVBAR --- */
.navbar {
    background-color: #123456;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-brand, 
.nav-link {
    color: #ffffff !important;
}

.nav-link:hover {
    color: #ffcc00 !important;
}

.navbar img {
    height: 40px;
    width: auto;
}

/* --- SEZIONI HERO (BANDE COLORATE) --- */
/* Questa regola gestisce tutte le fasce colorate in cima alle pagine */
.hero, .voti-section, .note-section, .assenze-section, .compiti-section {
    padding: 10px 15px;      /* Padding ridotto per rendere le bande sottili */
    text-align: center;
    color: #fff;
    display: flex;           /* Flexbox per centrare il testo verticalmente */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;        /* Altezza minima per un aspetto professionale */
}

/* Rimuove i margini dai titoli h1 per evitare che escano dai bordi */
.hero h1, .voti-section h1, .note-section h1, .assenze-section h1, .compiti-section h1 {
    font-size: 1.5rem;       /* Dimensione ottimizzata */
    margin: 0 !important;    /* Rimuove margini di default che spingono il testo fuori */
    line-height: 1.2;
    font-weight: bold;
}

/* Colori specifici per sezione */
.hero            { background-color: #0055a5; }
.voti-section    { background-color: #D0D32C; color: #003366; }
.note-section    { background-color: #800000; }
.assenze-section { background-color: #E9967A; }
.compiti-section { background-color: #006633; }

/* --- CARDS --- */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden; /* Taglia i contenuti che escono dai bordi arrotondati */
}

.card-header {
    background: #f1c40f;
    font-weight: bold;
    color: #003366;
    padding: 12px 15px;
    border-bottom: none;
}

.card-body {
    padding: 15px;
}

/* --- TABELLE --- */
.table-card {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.table-card th {
    background: #f8f9fa;
    color: #003366;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    border-bottom: 2px solid #dee2e6;
}

.table-card td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Stile per tabelle compatte (Assenze/Voti) */
.small-table {
    font-size: 0.85rem;
    line-height: 1.4;
}

.table-card tbody tr:nth-child(even) { background-color: #fcfcfc; }
.table-card tbody tr:hover { background-color: #f1f8ff; }

/* --- UTILITIES & ANIMAZIONI --- */
.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }

/* --- FOOTER --- */
footer {
    background: #002244;
    color: #ced4da;
    text-align: center;
    padding: 20px 15px;
    font-size: 0.85rem;
    margin-top: auto;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
    
    .hero h1, .voti-section h1, .note-section h1, .assenze-section h1, .compiti-section h1 {
        font-size: 1.3rem;
    }
    
    .card-header {
        text-align: center;
    }

    /* Rende le tabelle leggibili su schermi piccoli */
    .table-responsive {
        border: 0;
    }
}