/* === HEADER AMÉLIORÉ === */
.navbar {
    background: linear-gradient(135deg, #0a1628, #000814);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

/* Empêcher tout soulignement au survol/focus du nom du lycée */
.navbar-brand:hover,
.navbar-brand:focus,
.navbar-brand:hover .brand-text,
.navbar-brand:focus .brand-text {
    text-decoration: none;
}

/* Empêcher tout changement de couleur sur le lien de marque */
.navbar .navbar-brand,
.navbar .navbar-brand .brand-text {
    color: #fff;
}

.navbar .navbar-brand:hover,
.navbar .navbar-brand:focus,
.navbar .navbar-brand:hover .brand-text,
.navbar .navbar-brand:focus .brand-text {
    color: #fff !important;
    /* surpasse a:hover global d'accessibility */
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    width: 40px;
    height: 40px;
}

.brand-text {
    display: none;
}

@media (min-width: 1200px) {
    .brand-text {
        display: inline;
    }
}

/* Menu hamburger (mobile) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.navbar-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
}

.navbar-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
    width: 80%;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
}

.navbar-nav a i {
    font-size: 0.9rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.navbar-nav a:hover i,
.navbar-nav a.active i {
    opacity: 1;
    transform: scale(1.1);
}

.navbar-nav a .navbar-icon-img {
    width: 1.1rem;
    height: 1.1rem;
    max-width: 1.1rem;
    max-height: 1.1rem;
    opacity: 0.9;
    transition: all 0.3s ease;
    vertical-align: middle;
    display: inline-block;
    object-fit: contain;
}

.navbar-nav a:hover .navbar-icon-img,
.navbar-nav a.active .navbar-icon-img {
    opacity: 1;
    transform: scale(1.1);
}

.nav-highlight a {
    background: rgba(102, 126, 234, 0.2) !important;
    border: 1px solid rgba(102, 126, 234, 0.4);
}

.nav-highlight a:hover {
    background: rgba(102, 126, 234, 0.3) !important;
}

/* Mobile et Tablette <= 1200px : même header (menu hamburger) */
@media (max-width: 1200px) {
    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: flex;
        order: -1;
    }

    .navbar-brand {
        order: 2;
    }

    .navbar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, #0a1628, #000814);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }

    .navbar-nav.active {
        left: 0;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav a {
        width: 100%;
        padding: 1rem;
        justify-content: flex-start;
        border-radius: 8px;
        margin-bottom: 5px;
    }

    .navbar-nav a::after {
        display: none;
    }

    .navbar-nav a .navbar-icon-img {
        width: 1.1rem !important;
        height: 1.1rem !important;
        max-width: 1.1rem !important;
        max-height: 1.1rem !important;
    }
}