* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Navbar Blu --- */
.navbar {
    background-color: #004a99;
    color: white;
    padding: 10px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

/* Logo a sinistra */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    gap: 12px;
}

.logo img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Pulsanti a destra */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- Area utente a destra (home/admin/scoreboard) --- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Il browser applica di default un colore "link" (blu) agli <a>, che vince
   sull'ereditarietà del colore bianco della navbar: qui va forzato esplicitamente,
   altrimenti icone come il logout (blu su sfondo blu) diventano invisibili. */
.nav-right a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.nav-right a:hover,
.nav-right a:focus-visible {
    background: rgba(255, 255, 255, 0.15);
}

.nav-buttons a {
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Centro navbar - sfoglia le challenge e la scoreboard */
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

.nav-center .nav-link {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.12s ease;
}

.nav-center .nav-link:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}

/* Stato active per la pagina corrente */
.nav-center .nav-link.active {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.nav-center .nav-link.active i {
    color: #ffea00; /* evidenzia icona */
}

/* --- Footer --- */
footer {
    background-color: #004a99;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: white;
    line-height: 1.6;
}

.school-info strong {
    color: white;
    display: block;
    margin-bottom: 5px;
    font-size: 1.3rem;
    font-weight: url("flag{look_4t_th3_sourc3_code_9a21}");
}

.nav-buttons a:not(.btn-outline):hover {
    text-decoration: underline;
}

.nav-center .nav-link.admin-link {
    background: #ffea00;
    color: #1a1a1a;
}

.nav-center .nav-link.admin-link:hover {
    background: #fff45c;
    transform: translateY(-1px);
}

.nav-center .nav-link.admin-link.active {
    background: #ffd400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.nav-center .nav-link.admin-link i {
    color: #1a1a1a;
}

.nav-center .nav-link.tutor-link {
    background: rgba(255,255,255,0.1);
}

.view-mode-form {
    display: inline-block;
}

.view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.view-mode-btn:hover {
    background: rgba(255,255,255,0.22);
}

.view-mode-btn.active {
    background: #ffea00;
    color: #1a1a1a;
    border-color: #ffea00;
}

.admin-badge {
    background: #ffea00;
    color: #2c3e50;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

/* --- Responsività --- */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 20px;
    }
    .logo {
        font-size: 1.1rem;
    }
    .nav-buttons a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}