/* Caricamento Font */
@font-face {
    font-family: 'SEGO';
    src: url('/asset/fonts/sego/SEGO.ttf') format('truetype'),
         url('/asset/fonts/sego/SEGO.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
/* HEADER BASE */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: rgba(31, 17, 68, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

header.scrolled {
    height: 80px;
    background-color: rgba(31, 17, 68, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

header.hidden { transform: translateY(-110%); }

/* Assicurati che il contenitore interno segua i margini del sito */
.header-container {
    width: 100%;
    max-width: none;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 1. LOGO (Sinistra) */
.logo {
    flex: 0 1 auto;
    display: flex;
    justify-content: flex-start;
    z-index: 2100;
    max-width: 250px;
}

.logo img { 
    height: 150px; 
    width: auto;
    transition: 0.3s; 
    object-fit: contain;
}

/* 2. NAV WRAPPER (Centro Reale) */
.nav-wrapper {
    flex: 2;
    display: flex;
    justify-content: center;
    position: relative;
    color:#0D225B;
    left: 0;
    transform: none;
    padding: 0 20px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.nav-list a {
    font-family: 'SEGO', sans-serif;
    color: white;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding: 0.8rem 0;
    font-size: 2,5rem !important;
    transition: all 0.3s ease;
}

/* Nav link underline animation */
.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
}

.nav-list a:hover::after {
    width: 100%;
}

.nav-list a:hover {
    color: #757687;
    text-shadow: 0 0 10px rgba(255, 221, 87, 0.3);
}

/* Active nav link */
.nav-list a.active {
    color: #FFD700 !important; /* Gold/Yellow - high contrast on dark background */
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.nav-list a.active::after {
    width: 100%;
    background: #FFD700; /* Gold underline */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Current/active state for navigation - alternative class */
.nav-list a.current {
    color: #FFD700 !important;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.nav-list a.current::after {
    width: 100%;
    background: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* 3. BURGER (Destra) */
.burger {
    flex: 0 1 auto;
    width: 40px;
    display: flex; 
    justify-content: flex-end;
    align-items: center;
    z-index: 2100;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: none;
}

.burger:hover {
    background: rgba(255,255,255,0.1);
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: white !important;
    margin: 5px 0;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
}

/* Burger active state - transform to X */
.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Remove focus outline from nav elements */
.nav-list a:focus,
.burger:focus,
.btn-nav-login:focus,
button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove button click rectangle */
.nav-list a:active,
.btn-nav-login:active,
button:active {
    outline: none !important;
    box-shadow: none !important;
}

@media (min-width: 901px) {
    .burger {
        visibility: hidden; 
    }
}

/* MOBILE LAYOUT */
@media (max-width: 900px) {
    /* Fix header on mobile */
    header {
        height: 90px;
        padding: 0 15px;
    }
    
    .header-container {
        padding: 0 10px;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .logo img {
        height: 150px;
    }
    
    /* Burger menu - ensure it's visible and positioned correctly */
    .burger {
        width: 40px;
        min-width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0;
        position: relative;
        right: 0;
    }
    
    .burger span {
        width: 25px;
        margin: 5px 0;
    }
    
    /* Full-screen nav overlay */
    .nav-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: #0D225B !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2050;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        padding-top: 70px;
    }

    .nav-wrapper.active {
        transform: translateX(0);
    }
    
    /* Nav list items */
    .nav-list {
        flex-direction: column;
        align-items: center;
        color:#1a2f62;
        gap: 15px;
        width: 100%;
    }
    
    .nav-list a {
        font-size: 1.5rem !important;
        padding: 10px 15px;
    }
    
    /* Login button on mobile */
    .btn-nav-login {
        margin-top: 15px;
        font-size: 1.8rem !important;
        padding: 15px 30px !important;
    }
}

/* ============================= */
/*    NAV BUTTON STYLES          */
/* ============================= */

.btn-nav-login {
    padding: 1rem 1.2rem;
    background: transparent;
    color: white !important;
    font-family: 'SEGO', 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-nav-login::after {
    display: none !important;
}

.btn-nav-login:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
    box-shadow: none;
    color: white !important;
}

@media (max-width: 900px) {
    .btn-nav-login {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
}

/* ============================= */
/*    HEADER SCROLL EFFECTS      */
/* ============================= */

header {
    background: #0D225B;
    backdrop-filter: blur(5px);
}

header.scrolled {
    background: rgba(31, 17, 68, 0.98);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3), 0 0 20px rgba(108, 99, 255, 0.1);
}

/* ============================= */
/*    MOBILE OVERLAY             */
/* ============================= */

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2040;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Body class for menu open state */
body.menu-open {
    overflow: hidden;
}

/* ============================= */
/*    RESPONSIVE ADJUSTMENTS     */
/* ============================= */

@media (max-width: 1200px) {
    .nav-list {
        gap: 20px;
    }
    
    .nav-list a {
        font-size: 0.95rem;
    }
}

@media (max-width: 1024px) {
    .nav-list {
        gap: 15px;
    }
    
    .nav-list a {
        font-size: 0.9rem;
    }
}

/* ============================= */
/*    ACCESSIBILITY              */
/* ============================= */

@media (prefers-reduced-motion: reduce) {
    .nav-list li,
    .burger span,
    .nav-list a,
    .btn-nav-login,
    header,
    header.scrolled {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
