/* ==========================================================================
   STYLE & ANIMATIONS DU MENU DE NAVIGATION (CSMM 2026)
   ========================================================================== */

/* Variables de charte graphique */
:root {
    --csmm-blue: #103c63;
    --csmm-gold: #f29109;
    --csmm-blue-dark: #0b2a46;
}

/* Liens principaux de la navbar */
.navbar-nav .nav-link {
    color: var(--csmm-blue) !important;
    position: relative;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.3s ease;
}

/* Soulignement animé au survol */
.navbar-nav .nav-item:not(.ms-lg-3) .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--csmm-gold);
    transition: width 0.3s ease;
}

.navbar-nav .nav-item:hover .nav-link::after,
.navbar-nav .nav-item .nav-link.active::after {
    width: 100%;
}

.navbar-nav .nav-item:hover .nav-link {
    color: var(--csmm-gold) !important;
}

/* Bouton Contact Stylisé */
.btn-contact {
    background-color: var(--csmm-blue);
    border: 2px solid var(--csmm-blue);
    transition: all 0.3s ease-in-out;
}
.btn-contact:hover {
    background-color: transparent !important;
    color: var(--csmm-blue) !important;
    border-color: var(--csmm-blue);
    transform: translateY(-1px);
}

/* --- ANIMATION DES DROPDOWNS (Desktop uniquement) --- */
@media (min-width: 992px) {
    /* Ouverture au survol mouseover */
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .navbar-nav .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        border: none;
        border-top: 3px solid var(--csmm-gold);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 4px 4px;
        margin-top: 10px !important;
    }
}

/* Style des éléments internes du sous-menu */
.dropdown-item {
    color: #495057;
    font-size: 0.75rem;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(16, 60, 99, 0.04);
    color: var(--csmm-blue) !important;
    padding-left: 1.5rem; /* Léger décalage vers la droite au survol */
}

/* Supprime la flèche par défaut de Bootstrap pour un style plus épuré */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.355em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s ease;
}
.nav-item:hover .dropdown-toggle::after {
    transform: rotate(180deg); /* Rotation de la flèche au survol */
}
/* --- FIX POUR LE MEGA MENU "ÉTUDES" --- */
@media (min-width: 992px) {
    /* On force le conteneur du menu à ignorer le centrage du parent pour prendre toute la largeur */
    .nav-item.position-static .dropdown-menu {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        top: 100% !important;
        margin-top: 0 !important;
        border: none;
        border-bottom: 4px solid var(--csmm-gold); /* Rappel de la couleur école */
        box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
        padding: 30px 0 !important; /* Espace interne pour que ça respire */
        
        /* Animation fluide de haut en bas uniquement */
        transform: translateY(10px);
        transition: all 0.3s ease-in-out;
    }

    .nav-item.position-static:hover .dropdown-menu {
        transform: translateY(0);
    }
}

/* Style des colonnes dans le mega menu */
.mega-menu-col {
    border-right: 1px solid #eee;
    padding: 0 25px;
}
.mega-menu-col:last-child {
    border-right: none;
}
/* --- STYLE COMPOSANT EXAMEN D'ÉTAT --- */
.card-stats {
    border-left: 4px solid var(--csmm-blue);
    background-color: #f8f9fa;
}
.badge-pourcentage {
    font-weight: 700;
    padding: 0.4em 0.75em;
    border-radius: 4px;
}
.bg-mention-excellent { background-color: #d1e7dd; color: #0f5132; } /* >= 70% */
.bg-mention-bien { background-color: #cff4fc; color: #055160; }      /* >= 60% */
.bg-mention-satisfait { background-color: #fff3cd; color: #664d03; }  /* < 60% */

.select-filter {
    border: 2px solid #e2e8f0;
    font-weight: 600;
    color: var(--csmm-blue);
}
.select-filter:focus {
    border-color: var(--csmm-gold);
    box-shadow: 0 0 0 0.25rem rgba(242, 145, 9, 0.15);
}
.top-nav-links a {
    transition: color 0.2s ease-in-out;
}
.top-nav-links a:hover {
    color: #103c63 !important; /* Le bleu de l'école au survol */
}