/* ========================================
   VERTICAL MENU - BASE STYLES
======================================== */

.vertical-menu-container {
    position: relative;
    overflow: hidden;
}

.menu-levels-wrapper {
    position: relative;
    min-height: 50px;
    overflow: hidden;
}

.vertical-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Tous les niveaux sont en position absolue */
.vertical-menu-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Le niveau actif est visible et en position relative */
.vertical-menu-list.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Animation: slide entrée depuis la droite (descendre dans le menu) */
.vertical-menu-list.slide-in-right {
    position: absolute;
    animation: slideInFromRight 0.3s ease forwards;
}

/* Animation: slide sortie vers la gauche (être poussé) */
.vertical-menu-list.slide-out-left {
    position: absolute;
    animation: slideOutToLeft 0.3s ease forwards;
}

/* Animation: slide retour depuis la gauche (remonter dans le menu) */
.vertical-menu-list.slide-in-left {
    position: absolute;
    animation: slideInFromLeft 0.3s ease forwards;
}

/* Animation: slide sortie vers la droite (être poussé en arrière) */
.vertical-menu-list.slide-out-right {
    position: absolute;
    animation: slideOutToRight 0.3s ease forwards;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   BOUTON RETOUR
======================================== */

.menu-back-button {
    display: none;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e0e0e0;
}

.menu-back-button.show {
    display: flex;
}

.menu-back-button .back-icon {
    margin-right: 8px;
    font-size: 18px;
}

.menu-back-button:hover {
    background-color: #f5f5f5;
}

/* ========================================
   TITRE DE NIVEAU (rappel du contexte)
======================================== */

.menu-level-title {
    font-weight: 600;
    list-style: none;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 5px;
}

/* ========================================
   MENU ITEMS
======================================== */

.menu-item {
    position: relative;
    display: block;
    transition: all 0.3s ease;
    list-style: none;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item a,
.menu-item-has-children > span.menu-item-text {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.menu-item-has-children > span.menu-item-text {
    position: relative;
}

.menu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.menu-label {
    flex: 1;
}

.submenu-indicator {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ========================================
   HOVER MODE (optionnel)
======================================== */

.vertical-menu-container[data-trigger="hover"] .menu-item {
    position: relative;
}

.vertical-menu-container[data-trigger="hover"] .vertical-menu-list:not(.level-1) {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 250px;
}

.vertical-menu-container[data-trigger="hover"] .menu-item-has-children:hover > .vertical-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */

@media (max-width: 768px) {
    .vertical-menu-container[data-mobile-behavior="accordion"] .vertical-menu-list:not(.level-1) {
        position: static !important;
        transform: none !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .vertical-menu-container[data-mobile-behavior="accordion"] .menu-item-has-children.open > .vertical-menu-list {
        max-height: 2000px;
    }
    
    .vertical-menu-container[data-mobile-behavior="accordion"] .submenu-indicator {
        transform: rotate(0deg);
    }
    
    .vertical-menu-container[data-mobile-behavior="accordion"] .menu-item-has-children.open .submenu-indicator {
        transform: rotate(90deg);
    }
    
    .vertical-menu-container[data-mobile-behavior="accordion"] .menu-level-title {
        display: none;
    }
}

/* ========================================
   HOVER EFFECTS
======================================== */

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ========================================
   ACTIVE STATES
======================================== */

.menu-item.current-menu-item {
    font-weight: 600;
}

/* ========================================
   ACCESSIBILITY
======================================== */

.menu-item a:focus,
.menu-item-has-children > span:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.vertical-menu-container[data-highlight="no"] .menu-item.current-menu-item {
    font-weight: inherit;
}

/* ========================================
   UTILITIES
======================================== */

.vertical-menu-container * {
    box-sizing: border-box;
}