/* Navigation */
.navbar {
    padding: 1.5rem 0;
    transition: all 0.3s ease;
    background: transparent !important;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 5px 30px rgba(108, 92, 231, 0.15);
    backdrop-filter: blur(10px);
}

/* Menu mobile - fond blanc permanent */
@media (max-width: 991px) {
    .navbar {
        background: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 10px;
        margin-top: 1rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Logo avec gradient sur mobile */
    .navbar-brand {
        background: var(--gradient-1) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
        color: transparent !important;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: white;
    transition: all 0.3s ease;
}

/* Logo avec gradient quand scrollé */
.navbar.scrolled .navbar-brand {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.8rem;
    position: relative;
    transition: all 0.3s ease;
    color: white !important;
}

/* Liens noirs quand la navbar est scrollée */
.navbar.scrolled .nav-link {
    color: var(--dark-color) !important;
}

/* Override pour mobile - texte toujours noir */
@media (max-width: 991px) {
    .nav-link,
    .navbar .nav-link,
    .navbar.scrolled .nav-link {
        color: var(--dark-color) !important;
    }
    
    /* Exception: le bouton Événements reste blanc */
    .nav-link-special {
        color: white !important;
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

/* Bouton Pages avec dropdown - thème violet */
.nav-link-special {
    background: linear-gradient(135deg, #8b9aee 0%, #9b7bc2 100%) !important;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 25px !important;
    margin: 0 0.5rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.nav-link-special::after {
    display: none !important;
}

.nav-link-special:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 154, 238, 0.4);
    background: linear-gradient(135deg, #9b7bc2 0%, #8b9aee 100%) !important;
}

.nav-link-special.active {
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

/* Menu déroulant personnalisé avec effet impressionnant */
.dropdown-menu-custom {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
    border: none;
    border-radius: 15px;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: perspective(1200px) rotateX(-95deg) rotateY(-15deg) scale(0.3) translateY(-30px) translateZ(-100px);
    transform-origin: top center;
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.75);
    overflow: hidden;
    position: relative;
    animation: none;
}

/* Effet de bordure lumineuse animée */
.dropdown-menu-custom::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 17px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dda0dd);
    background-size: 400% 400%;
    animation: gradientBorder 3s ease infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Effet de particules brillantes */
.dropdown-menu-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.8s ease;
    z-index: 1;
}

/* Animation d'apparition spectaculaire */
.dropdown-menu-custom.show {
    opacity: 1;
    visibility: visible;
    transform: perspective(1000px) rotateX(0deg) scale(1) translateY(0);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.5), 0 0 30px rgba(139, 154, 238, 0.3);
}

.dropdown-menu-custom.show::before {
    left: 100%;
}

.dropdown-menu-custom .dropdown-item {
    color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 0;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-50px) rotateY(-45deg) scale(0.8);
    animation: explosiveEntry 0.8s ease forwards;
    z-index: 2;
}

/* Effet de lueur au survol */
.dropdown-menu-custom .dropdown-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

/* Animations échelonnées spectaculaires */
.dropdown-menu-custom .dropdown-item:nth-child(1) {
    animation-delay: 0.2s;
}

.dropdown-menu-custom .dropdown-item:nth-child(2) {
    animation-delay: 0.4s;
}

.dropdown-menu-custom .dropdown-item:nth-child(3) {
    animation-delay: 0.6s;
}

/* Keyframes pour l'effet explosif */
@keyframes explosiveEntry {
    0% {
        opacity: 0;
        transform: translateX(-50px) rotateY(-45deg) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateX(10px) rotateY(5deg) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
    }
}

.dropdown-menu-custom .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px) scale(1.03) rotateY(2deg);
    padding-left: 2rem;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.2), 0 5px 15px rgba(102, 126, 234, 0.4);
    border-left: 4px solid rgba(255,255,255,0.8);
}

.dropdown-menu-custom .dropdown-item:hover::after {
    left: 100%;
}

.dropdown-menu-custom .dropdown-item i {
    opacity: 0.9;
    transition: all 0.3s ease;
}

.dropdown-menu-custom .dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* Page active dans le dropdown */
.dropdown-menu-custom .dropdown-item.active-page {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    border-left: 3px solid white;
}

.dropdown-menu-custom .dropdown-item.active-page::before {
    content: "•";
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Flèche du dropdown */
.dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Menu mobile optimisé */
@media (max-width: 991px) {
    /* Centrer les éléments de navigation sur mobile */
    .navbar-nav {
        text-align: center;
    }
    
    .nav-item {
        margin: 0.25rem 0;
    }
    
    /* Masquer les liens des sections principales sur mobile */
    .nav-link:not(.nav-link-special):not(.nav-link-page) {
        display: none !important;
    }
    
    /* Masquer aussi les nav-items des sections principales */
    .nav-item:not(.mobile-page-btn):not(.dropdown) {
        display: none !important;
    }
    
    /* Masquer complètement le dropdown toggle et son menu sur mobile */
    .nav-item.dropdown {
        display: none !important;
    }
    
    /* Séparateur visuel */
    .navbar-nav::after {
        content: '';
        display: block;
        width: 80%;
        height: 1px;
        background: rgba(255, 255, 255, 0.2);
        margin: 1rem auto;
    }
    
    /* Boutons pages mobiles - avec background */
    .nav-link-page {
        margin: 0.5rem auto !important;
        display: block !important;
        width: fit-content !important;
        padding: 10px 25px !important;
        border-radius: 25px !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        font-weight: 600 !important;
        border: none !important;
        font-size: 0.95rem !important;
        transition: all 0.3s ease !important;
    }
    
    /* Bouton Accueil spécial pour mobile */
    .nav-link-home-mobile {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        color: white !important;
    }
    
    .nav-link-home-mobile:hover {
        background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
        color: white !important;
    }
    
    .nav-link-page:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
        color: white !important;
    }
    
    /* Forcer le texte blanc sur tous les boutons mobiles - TOUTES CONDITIONS */
    .nav-link-page,
    .nav-link-page:hover,
    .nav-link-page:focus,
    .nav-link-page:active,
    .nav-link-page:visited,
    .navbar.scrolled .nav-link-page,
    .navbar.scrolled .nav-link-page:hover,
    .navbar.scrolled .nav-link-page:focus,
    .navbar-scrolled .nav-link-page,
    .navbar-scrolled .nav-link-page:hover,
    .navbar-scrolled .nav-link-page:focus,
    .navbar-light .nav-link-page,
    .navbar-light .nav-link-page:hover,
    .navbar-light .nav-link-page:focus,
    .fixed-top .nav-link-page,
    .fixed-top .nav-link-page:hover {
        color: white !important;
    }
    
    /* Forcer également pour les icônes */
    .nav-link-page i,
    .navbar.scrolled .nav-link-page i,
    .navbar-scrolled .nav-link-page i,
    .navbar-light .nav-link-page i,
    .fixed-top .nav-link-page i {
        color: white !important;
    }
    
    /* Page active sur mobile */
    .active-mobile-page {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5) !important;
        transform: scale(1.02) !important;
    }
}

/* Masquer les boutons pages mobiles sur desktop */
@media (min-width: 992px) {
    .mobile-page-btn {
        display: none !important;
    }
}

/* Règle globale ultra-prioritaire pour forcer le texte blanc des boutons mobiles */
@media (max-width: 991px) {
    .mobile-page-btn .nav-link-page,
    .mobile-page-btn .nav-link-page:hover,
    .mobile-page-btn .nav-link-page:focus,
    .mobile-page-btn .nav-link-page:active,
    .mobile-page-btn .nav-link-page:visited {
        color: white !important;
        text-decoration: none !important;
    }
    
    .mobile-page-btn .nav-link-page i {
        color: white !important;
    }
}

/* Flèche indicatrice "Voir d'avantage" pour le bouton Pages */
.pages-hint {
    position: absolute;
    right: -140px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

/* Texte et flèche BLANCS par défaut (en haut de page) */
.pages-hint i {
    color: white;
    font-size: 0.9rem;
    animation: arrowBounceRight 1.5s ease-in-out infinite;
    transition: color 0.3s ease;
}

.pages-hint .hint-text {
    font-style: italic;
    font-size: 0.85rem;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* Texte et flèche ROUGES quand on scrolle */
.navbar.scrolled .pages-hint i {
    color: #dc3545;
}

.navbar.scrolled .pages-hint .hint-text {
    color: #dc3545;
}

/* Animation de rebond pour la flèche (vers la droite) */
@keyframes arrowBounceRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Effet au survol du bouton Pages */
.nav-item.dropdown:hover .pages-hint {
    opacity: 1;
}

/* Masquer la flèche sur mobile et tablette */
@media (max-width: 1200px) {
    .pages-hint {
        display: none !important;
    }
}

/* Ajuster pour écrans moyens */
@media (max-width: 1400px) {
    .pages-hint {
        right: -145px;
    }
    
    .pages-hint .hint-text {
        font-size: 0.8rem;
    }
}

