/**
 * Navigation Dropdown Styles
 * Styles pour les menus déroulants dans le header
 */

/* ============================================
   DROPDOWN NAVIGATION
   ============================================ */

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown .dropdown-toggle svg {
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-toggle svg,
.nav-dropdown .dropdown-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    padding: 0.5rem 0;
}

/* Zone de transition invisible élargie pour éviter la fermeture du menu */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: transparent;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover,
.nav-dropdown .nav-dropdown-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-dropdown-item:hover {
    background: #f3f4f6;
    color: #667eea;
}

.nav-dropdown-item span {
    font-size: 1.1rem;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
    .nav-dropdown {
        display: block;
        width: 100%;
    }
    
    .nav-dropdown .dropdown-toggle {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid #e5e7eb;
        justify-content: space-between;
    }
    
    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        display: none;
        background: #f9fafb;
    }
    
    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown .nav-dropdown-menu[aria-hidden="false"] {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-dropdown-item {
        padding: 0.875rem 1rem 0.875rem 2rem;
        font-size: 0.9rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .nav-dropdown-item:last-child {
        border-bottom: none;
    }
}

/* ============================================
   JAVASCRIPT TOGGLE SUPPORT
   ============================================ */

.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    display: block;
}

.nav-dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
}
