/* ==========================================
   MTECHLO - Navigation Dropdown Styles
   Navigation restructurée avec sous-menus
   ========================================== */

/* Dropdown Container */
.nav-item {
    position: relative;
}

.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item.has-dropdown > .nav-link::after {
    content: '\f107';
    font-family: 'Font Awesome 7 Free';
    font-weight: 900;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover > .nav-link::after {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: rgba(23, 53, 92, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(59, 155, 201, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999999;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    pointer-events: none;
}

.nav-item.has-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #E2E8F0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.dropdown-item:hover {
    background: rgba(59, 155, 201, 0.15);
    color: #3B9BC9;
    padding-left: 1.5rem;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #3B9BC9;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1rem;
}

/* Dropdown Header (for categories) */
.dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B7280;
    margin-top: 0.5rem;
}

.dropdown-header:first-child {
    margin-top: 0;
}

/* Nested Dropdown (Sub-dropdown) */
.dropdown-item.has-submenu {
    position: relative;
}

.dropdown-item.has-submenu::after {
    content: '\f105';
    font-family: 'Font Awesome 7 Free';
    font-weight: 900;
    font-size: 0.7rem;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.dropdown-item.has-submenu:hover::after {
    transform: translateX(3px);
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 250px;
    background: rgba(23, 53, 92, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(59, 155, 201, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 0;
    margin-left: 0.25rem;
}

.dropdown-item.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Mobile Navigation Dropdown Styles */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -100% !important;
        width: 100% !important;
        max-width: 350px !important;
        height: 100vh !important;
        background: rgba(14, 23, 38, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 5rem 1.5rem 2rem !important;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        gap: 0.5rem !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .nav-menu.active {
        right: 0 !important;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-item.has-dropdown > .nav-link {
        justify-content: space-between;
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        min-width: 100%;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.4s ease, padding 0.3s ease;
    }
    
    .nav-item.has-dropdown.open > .dropdown-menu {
        max-height: 500px;
        padding: 0.5rem 0;
    }
    
    .nav-item.has-dropdown.open > .nav-link::after {
        transform: rotate(180deg);
    }
    
    .dropdown-item {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .submenu {
        position: static;
        min-width: 100%;
        background: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        border-radius: 0;
        margin-left: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.4s ease;
    }
    
    .dropdown-item.has-submenu.open > .submenu {
        max-height: 300px;
    }
    
    .submenu .dropdown-item {
        padding-left: 2.5rem;
    }
    
    .nav-toggle {
        display: flex !important;
        z-index: 10001 !important;
        position: relative !important;
    }
    
    .nav-link {
        display: block !important;
        padding: 1rem 0 !important;
        color: #E2E8F0 !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
    }
    
    .nav-cta {
        display: none;
    }
    
    /* Close button for mobile */
    .nav-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .nav-close:hover {
        background: rgba(37, 99, 235, 0.5);
        transform: rotate(90deg);
    }
}

/* Dropdown Badge (for "Nouveau" items) */
.dropdown-badge {
    background: #3B9BC9;
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

/* Dropdown Icon Container */
.dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Palette unifiée en bleus pour les 4 familles */
.dropdown-icon.blue { background: linear-gradient(135deg, #3B9BC9, #2B7BA8); color: white; }      /* Applications - Mobility */
.dropdown-icon.blue-dark { background: linear-gradient(135deg, #2B7BA8, #17355C); color: white; } /* Applications - Web */
.dropdown-icon.navy { background: linear-gradient(135deg, #17355C, #17355C); color: white; }     /* GAB */
.dropdown-icon.blue-light { background: linear-gradient(135deg, #55A7D2, #3B9BC9); color: white; } /* Robot */
.dropdown-icon.blue-medium { background: linear-gradient(135deg, #17355C, #17355C); color: white; } /* Études */
.dropdown-icon.blue-pale { background: linear-gradient(135deg, #93C5FD, #55A7D2); color: white; }  /* Formation */

/* Classes dépréciées - redirigées vers bleus */
.dropdown-icon.green { background: linear-gradient(135deg, #17355C, #17355C); color: white; }
.dropdown-icon.orange { background: linear-gradient(135deg, #17355C, #17355C); color: white; }
.dropdown-icon.purple { background: linear-gradient(135deg, #2B7BA8, #17355C); color: white; }
.dropdown-icon.pink { background: linear-gradient(135deg, #93C5FD, #55A7D2); color: white; }
.dropdown-icon.cyan { background: linear-gradient(135deg, #55A7D2, #3B9BC9); color: white; }

/* Dropdown Content */
.dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dropdown-content .dropdown-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #E2E8F0;
}

.dropdown-content .dropdown-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.3;
}

.dropdown-item:hover .dropdown-content .dropdown-title {
    color: #3B9BC9;
}

/* Mega Menu for Solutions */
.mega-menu {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px) !important;
    min-width: 700px !important;
    background: rgba(23, 53, 92, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 155, 201, 0.2) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 9999 !important;
    padding: 1.5rem !important;
    margin-top: 0.5rem !important;
    display: block !important;
}

.nav-item.has-dropdown:hover > .mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mega-menu-section {
    padding: 0.5rem;
}

.mega-menu-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #3B9BC9;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mega-menu-section h4 i {
    font-size: 0.9rem;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    color: #E2E8F0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mega-menu-item:hover {
    background: rgba(59, 155, 201, 0.15);
    color: #3B9BC9;
    padding-left: 0.75rem;
}

.mega-menu-cta {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.mega-menu-cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3B9BC9, #17355C);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mega-menu-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

@media (max-width: 1024px) {
    .mega-menu {
        position: static;
        min-width: 100%;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        border-radius: 0;
        padding: 0.5rem;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item.has-dropdown.open > .mega-menu {
        max-height: 800px;
        padding: 1rem;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-cta {
        justify-content: flex-start;
    }
}
