/* MEGA MENU ENHANCED STYLES - NetworkIT */

/* ⚠️ ULTRA FIX: Cacher toutes les flèches orphelines directement sous body */
body > .mega-arrow,
body > span.mega-arrow,
body > .mobile-arrow,
body > span.mobile-arrow {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    clip: rect(0,0,0,0) !important;
    pointer-events: none !important;
    font-size: 0 !important;
}

/* Cacher les pseudo-éléments orphelins */
body::before,
body::after {
    content: none !important;
    display: none !important;
}

.mega-menu-networkit {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 80px;
    overflow: visible; /* Pour permettre aux submenus de s'afficher */
}

.mega-menu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.mega-menu-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.mega-menu-logo {
    height: 100%;
    display: flex;
    align-items: center;
}

.mega-menu-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}

.mega-menu-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mega-menu-item {
    position: relative;
}

.mega-menu-link {
    color: #374151;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.mega-menu-link:hover {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}

.mega-cta {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
    margin-left: 8px;
}

.mega-cta:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.mega-arrow {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

.mega-menu-item:hover .mega-arrow {
    transform: none !important;
}

/* S'assurer que les flèches ne sortent pas du contexte */
.mega-menu-link {
    overflow: hidden;
}

.mega-menu-link .mega-arrow {
    flex-shrink: 0;
}

/* Mega Submenu */
.mega-submenu {
    position: fixed; /* Fixed au lieu d'absolute pour centrer sur l'écran */
    top: 80px; /* Collé directement au header - SANS espace */
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    z-index: 9999;
    width: 1300px; /* Augmenté de 1100px à 1300px pour plus d'espace */
    max-width: calc(100vw - 40px); /* Ne jamais dépasser la largeur de l'écran */
}

/* Zone de pont pour stabilité au survol - Extended pour couvrir tout l'espace */
.submenu-bridge {
    position: absolute;
    top: -15px; /* Couvre l'espace de translation + zone supplémentaire */
    left: 0;
    right: 0;
    height: 20px; /* Pont étendu pour éviter les gaps */
    background: transparent;
    z-index: 10000;
}

/* États du mega submenu - de base */
.mega-menu-item:hover .mega-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
    transition-delay: 0ms; /* Ouverture immédiate */
}

.mega-menu-item .mega-submenu {
    transition-delay: 600ms; /* Délai avant fermeture - augmenté pour stabilité (600ms au lieu de 250ms) */
}

.mega-submenu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.mega-submenu-medium {
    width: 1100px; /* Augmenté de 900px à 1100px */
    max-width: calc(100vw - 40px);
}

.mega-submenu-wide {
    width: 1400px; /* Augmenté de 1200px à 1400px */
    max-width: calc(100vw - 40px);
}

.mega-submenu-wide .mega-grid {
    grid-template-columns: repeat(4,1fr) 260px; /* Featured card plus large, 5 colonnes au total */
}

/* S'assurer que le menu ne dépasse jamais à droite - Écrans moyens */
@media (max-width: 1200px) {
    .mega-submenu {
        width: calc(100vw - 40px);
        left: 20px;
        transform: translateX(0) translateY(-5px);
    }

    .mega-menu-item:hover .mega-submenu,
    .mega-submenu:hover {
        transform: translateX(0) translateY(0);
    }

    .mega-submenu-medium {
        width: calc(100vw - 40px);
    }
}

.mega-submenu-inner {
    padding: 32px;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr) 260px; /* Featured card plus large: 260px au lieu de 240px */
    gap: 30px; /* Gap réduit à 30px pour optimiser l'espace */
}

.mega-submenu-medium .mega-grid {
    grid-template-columns: repeat(3,1fr) 240px; /* Featured card plus large */
}

/* Colonnes */
.mega-col {
    min-width: 0;
}

.col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.col-icon {
    font-size: 20px;
}

.col-header h4 {
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Items du menu */
.mega-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.mega-item:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(37,99,235,0.05) 100%);
    color: #3b82f6;
    transform: translateX(4px);
}

.mega-item.featured {
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(147,51,234,0.08) 100%);
    border: 1px solid rgba(59,130,246,0.2);
}

.mega-item.featured:hover {
    background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(147,51,234,0.15) 100%);
}

.item-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.item-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.item-content small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

/* Featured Cards - Encarts visuels */
.mega-featured {
    grid-column: span 1;
}

.featured-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    text-align: center;
    box-shadow: 0 10px 30px rgba(59,130,246,0.3);
}

.featured-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.featured-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.featured-card p {
    font-size: 14px;
    opacity: 0.95;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.featured-btn {
    display: inline-block;
    background: white;
    color: #3b82f6;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.featured-btn:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.featured-stats {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.featured-stats strong {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.featured-stats span {
    display: block;
    font-size: 11px;
    opacity: 0.9;
}

/* Featured Small - Petit encart */
.mega-featured-small {
    grid-column: span 1;
}

.featured-card-small {
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(147,51,234,0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid rgba(59,130,246,0.2);
}

.featured-icon-small {
    font-size: 36px;
    margin-bottom: 12px;
}

.featured-card-small h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 8px 0;
}

.featured-card-small p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.featured-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.featured-link:hover {
    color: #2563eb;
    transform: translateX(4px);
}

/* Mobile Toggle Button */
.mega-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 10001;
}

.mega-mobile-toggle span {
    width: 26px;
    height: 3px;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation hamburger actif */
.mega-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mega-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mega-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Menu Mobile Navigation - Complètement géré par mobile-menu-modern.css */
/* Ce fichier ne gère QUE le menu desktop - Pas de styles mobiles ici */

/* Logo sizing */
.mega-menu-logo svg {
    height: 48px !important;
    width: auto !important;
    max-height: 48px !important;
}

/* Responsive Design - Tablettes */
@media (max-width: 1024px) and (min-width: 769px) {
    .mega-grid {
        grid-template-columns: repeat(2,1fr);
        gap: 20px;
    }

    .mega-featured,
    .mega-featured-small {
        grid-column: span 2;
    }

    .mega-submenu-inner {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    /* Masquer menu desktop */
    .mega-menu-nav {
        display: none;
    }

    /* Afficher bouton hamburger */
    .mega-mobile-toggle {
        display: flex;
    }

    /* Réduire hauteur header */
    .mega-menu-content {
        height: 70px;
    }

    .mega-menu-logo svg {
        height: 42px !important;
        max-height: 42px !important;
    }

    body {
        padding-top: 70px !important;
    }

    /* Le reste est géré par mobile-menu-modern.css */
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .mega-menu-content {
        padding: 0 16px;
    }

    .mega-menu-link {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Body padding for fixed menu */
body {
    padding-top: 80px !important;
}
