/* --- RESET INIZIALE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body, html {
    width: 100%;
    min-height: 100%;
    background-color: #f5f5f5;
}

body {
    padding-top: 72px; /* Spazio per l'header fisso */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER (uniformato a index.css) --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: #0d3b66;
    margin-bottom: 0 !important;
    padding: 10px 20px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- LOGO --- */
.logo {
    position: relative; /* Spostato da absolute a relative per evitare glitch di flusso */
    font-size: 24px;
    font-weight: bold;
    color: #ffffff !important; /* Forza il colore bianco ben visibile */
    letter-spacing: 1px;
    z-index: 10000;
}

/* --- NAVBAR --- */
nav {
    position: relative; /* Gestito tramite flexbox dell'header */
    z-index: 10000;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

nav ul li a {
    color: #ffffff !important; /* Forza il testo bianco fin da subito */
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.25s ease;
    background-color: transparent;
}

nav ul li a:hover {
    color: #8fd3ff !important;
}

main {
    margin-top: 0px; 
    flex: 1;
    padding: 20px;
}

.container {
    display: flex;
    gap: 40px;
}

.box {
    border: 1px solid #ccc;
    padding: 15px;
    width: 300px;
    background: white;
}

/* --- TOP RIGHT LINKS --- */
.top-links {
    position: absolute;
    top: 20px;
    right: 20px;
}

.top-links a {
    font-weight: bold;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
}

.top-links a:first-child {
    color: #0077cc; /* Home */
}

.top-links a:last-child {
    color: #d00; /* Logout */
}

/* --- FOOTER / CONTATTI (uniformato a index.css) --- */
#contatti, footer {
    background: #0d3b66;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 1rem;
    line-height: normal;
    width: 100%;
    margin-top: auto;
}

#contatti a, footer a {
    color: #8fd3ff;
    text-decoration: none;
}

#contatti a:hover, footer a:hover {
    text-decoration: underline;
}

/* --- MEDIA QUERY DISPOSITIVI MOBILI --- */
@media(max-width:900px){
    .logo {
        position: static;
        text-align: center;
        margin-top: 5px;
    }
    nav {
        position: static;
        margin-top: 10px;
        text-align: center;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    .header {
        height: auto;
        padding-bottom: 20px;
    }
    .container {
        flex-direction: column;
    }
}
