/* ==================================
   MENU FORMATIONS STYLE PECB
   Fichier: css/formations-pecb-menu.css
   ================================== */

/* Menu principal - Mega Menu */
.formations-mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 1200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    margin-top: 10px;
}

.nav-item:hover .formations-mega-menu {
    opacity: 1;
    visibility: visible;
}

/* Container du mega menu */
.mega-menu-container {
    display: flex;
    min-height: 500px;
    max-height: 600px;
}

/* Panneau gauche - Catégories */
.categories-panel {
    width: 350px;
    background: #f8f9fa;
    border-right: 2px solid #e0e0e0;
    border-radius: 10px 0 0 10px;
    overflow-y: auto;
}

.category-item {
    padding: 18px 25px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-item:first-child {
    border-radius: 10px 0 0 0;
}

.category-item:hover {
    background: #e3f2fd;
}

.category-item.active {
    background: #0076BA;
    color: white;
    border-left: 4px solid #9ACD32;
}

.category-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.category-icon {
    margin-right: 12px;
    font-size: 16px;
    color: #0076BA;
    transition: color 0.3s ease;
}

.category-item.active .category-icon {
    color: #9ACD32;
}

.category-text {
    font-weight: 500;
    font-size: 15px;
}

.category-item .arrow {
    color: #999;
    font-size: 14px;
    transition: color 0.3s ease;
}

.category-item.active .arrow {
    color: white;
}

/* Panneau droit - Sous-menus */
.submenu-panel {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: white;
    border-radius: 0 10px 10px 0;
}

.default-message {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.default-message i {
    font-size: 64px;
    color: #0076BA;
    margin-bottom: 20px;
    display: block;
}

.default-message h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.default-message p {
    font-size: 16px;
    color: #666;
}

/* Sections de sous-menus */
.submenu-section {
    display: none;
    animation: fadeInRight 0.3s ease;
}

.submenu-section.active {
    display: block;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.submenu-title {
    font-size: 24px;
    font-weight: 700;
    color: #0076BA;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #9ACD32;
}

/* Groupes de sous-menus */
.submenu-group {
    margin-bottom: 30px;
}

.submenu-group-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.submenu-group-title i {
    margin-right: 10px;
    color: #0076BA;
}

/* Liens de sous-menus */
.submenu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 15px;
}

.submenu-link {
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.submenu-link::before {
    content: "▸";
    margin-right: 10px;
    color: #9ACD32;
    font-weight: bold;
}

.submenu-link:hover {
    background: #e3f2fd;
    border-left-color: #0076BA;
    padding-left: 20px;
    color: #0076BA;
}

/* Scrollbar personnalisée */
.categories-panel::-webkit-scrollbar,
.submenu-panel::-webkit-scrollbar {
    width: 8px;
}

.categories-panel::-webkit-scrollbar-track,
.submenu-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.categories-panel::-webkit-scrollbar-thumb,
.submenu-panel::-webkit-scrollbar-thumb {
    background: #0076BA;
    border-radius: 4px;
}

.categories-panel::-webkit-scrollbar-thumb:hover,
.submenu-panel::-webkit-scrollbar-thumb:hover {
    background: #005a8f;
}

/* Responsive */
@media (max-width: 1024px) {
    .formations-mega-menu {
        width: 95vw;
    }
    
    .categories-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .formations-mega-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        transform: none;
        border-radius: 0;
        margin-top: 0;
        display: none;
    }
    
    .formations-mega-menu.mobile-active {
        display: block;
    }
    
    .mega-menu-container {
        flex-direction: column;
        max-height: 100vh;
    }
    
    .categories-panel {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        border-radius: 0;
        max-height: 40vh;
    }
    
    .submenu-panel {
        padding: 20px;
        border-radius: 0;
    }
    
    .submenu-title {
        font-size: 20px;
    }
    
    .category-text {
        font-size: 14px;
    }
    
    /* Bouton de fermeture pour mobile */
    .formations-mega-menu::before {
        content: "✕";
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 24px;
        color: #0076BA;
        cursor: pointer;
        z-index: 10000;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* S'assurer que le menu formations a un z-index supérieur */
.nav-item.formations-nav-item {
    position: relative;
}

.nav-item.formations-nav-item:hover {
    z-index: 10000;
}