/* Styles pour le menu mobile */
.mobile-menu-button {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.mobile-menu-button:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-button:active {
    transform: scale(0.95);
}

/* Icône hamburger et son animation */
.hamburger-icon {
    position: relative;
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-icon span:nth-child(1) {
    top: 0;
}

.hamburger-icon span:nth-child(2) {
    top: 8px;
    transition: all 0.15s ease;
}

.hamburger-icon span:nth-child(3) {
    bottom: 0;
}

.hamburger-icon.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-icon.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

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

/* Menu mobile */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    width: 100%;
    padding-bottom: 8px;
    background: linear-gradient(135deg, #2e3e98 0%, #4ecce2 100%);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
}

.mobile-menu a {
    display: block;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    padding-left: 1.75rem;
}

.mobile-menu a:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Styles pour le lien actif dans le menu mobile */
.mobile-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid white;
    padding-left: calc(1.5rem - 3px);
}

/* Animations pour le menu mobile */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
    -webkit-animation: fadeIn 0.3s ease-in-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
    -webkit-animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Pour Safari */
@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(-20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
}

@-webkit-keyframes fadeOut {
    from {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
    to {
        opacity: 0;
        -webkit-transform: translateY(-20px);
    }
}

/* Styles responsive spécifiques */
@media (max-width: 767px) {
    body.menu-open {
        overflow: hidden;
    }

    .mobile-menu {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .mobile-menu.hidden {
        display: none;
    }
    
    .mobile-menu.animate-fade-in {
        animation: fadeIn 0.3s ease-in-out forwards;
    }
    
    .mobile-menu.animate-fade-out {
        animation: fadeOut 0.3s ease-in-out forwards;
    }
}

/* Icône hamburger et son animation */
.hamburger-icon {
    position: relative;
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-icon span:nth-child(1) {
    top: 0;
}

.hamburger-icon span:nth-child(2) {
    top: 8px;
    transition: all 0.15s ease;
}

.hamburger-icon span:nth-child(3) {
    bottom: 0;
}

.hamburger-icon.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-icon.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

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