/* Styles pour le menu déroulant des formations */
.nav-item {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: visible;
}

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

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 86, 179, 0.05);
    color: #0056b3;
    padding-left: 25px;
}

.dropdown-item i {
    margin-right: 10px;
    color: #0056b3;
    width: 20px;
    text-align: center;
}

/* Sous-menu */
.has-submenu {
    position: relative;
    cursor: pointer;
}

.submenu-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 400px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

/* Ajustement automatique de la position du sous-menu */
.submenu.adjust-position {
    top: auto;
    bottom: 0;
}

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

.submenu-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.submenu-item:hover {
    background-color: rgba(0, 86, 179, 0.05);
    color: #0056b3;
    padding-left: 20px;
}

.submenu-item:last-child {
    border-bottom: none;
}

/* Scrollbar personnalisée */
.submenu::-webkit-scrollbar {
    width: 6px;
}

.submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.submenu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.submenu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mode sombre */
.dark-theme .dropdown-menu {
    background-color: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme .dropdown-item {
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-theme .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #4CAF50;
}

.dark-theme .dropdown-item i {
    color: #4CAF50;
}

.dark-theme .submenu {
    background-color: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme .submenu-item {
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark-theme .submenu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #4CAF50;
}