/* CSS amélioré avec gestion précise du menu mobile */
.header {
    background-color: var(--gray-light-color);
    color: var(--black-color);
    padding: 10px 5%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.mobile-user-menu
{
    display: none;
}
.header .logo {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.header .logo:hover {
    transform: scale(1.05);
}

/* Navigation */
.menu-container {
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

.nav {
    display: flex;
    align-items: center;
}

.nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav ul li {
    margin: 0 15px;
}

.nav ul li a {
    text-decoration: none;
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav ul li a:hover,
.active-nav {
    color: var(--green-light-color) !important;
}

.nav ul li a::after, .active-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--orange-color);
    transition: all 0.3s ease;
}

.nav ul li a:hover::after,
.active-nav::after {
    width: 100%;
}

/* Header right section */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Bouton Connexion */
.btn-connect {
    text-decoration: none;
    color: var(--white-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 30px;
    background: linear-gradient(90deg, var(--orange-color), var(--green-color));
    background-size: 200%;
    background-position: right;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-connect:hover {
    background-position: left;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dropdown utilisateur */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, var(--orange-color), var(--green-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    gap: 8px;
}

.user-dropdown-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.menu-user-avatar {
    width: 30px;
    height: 30px;
    background-color: white;
    color: var(--orange-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background-color: white;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

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

.user-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 10px;
}

.dropdown-item:hover {
    background-color: rgba(0, 154, 68, 0.1);
    color: var(--orange-color);
    padding-left: 25px;
}

/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 30px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--dark-color);
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Mobile dropdown intégré */
.mobile-dropdown {
    display: none;
    width: 100%;
    padding: 15px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .header {
        flex-wrap: wrap;
        padding: 10px 20px;
    }

    .menu-container {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }

    .header.active .menu-container {
        max-height: 500px;
    }

    .nav {
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
    }

    .nav ul {
        flex-direction: column;
        width: 100%;
    }

    .nav ul li {
        margin: 10px 0;
        text-align: center;
    }

    .nav ul li a {
        padding: 12px 0;
        display: block;
    }

    .user-dropdown {
        display: none;
    }

    .mobile-dropdown, .mobile-user-menu {
        display: block;
    }

    .hamburger-btn {
        display: flex;
    }

    .header-right {
        margin-left: auto;
    }
}

@media (max-width: 576px) {
    .header .logo {
        width: 80px;
        height: 80px;
    }

    .btn-connect {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Nouveaux styles pour le dropdown mobile */
.mobile-dropdown-item {
    display: none; /* Caché par défaut */
    flex-direction: column;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 12px 0;
    width: 100%;
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    gap: 10px;
}

.mobile-dropdown-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-left: 30px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
    overflow: hidden;
}

.mobile-dropdown-item.active .mobile-dropdown-menu {
    display: flex;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 10px;
}

.mobile-menu-item:hover {
    background-color: rgba(0, 154, 68, 0.1);
    color: var(--orange-color);
}

.mobile-menu-item i {
    width: 20px;
    text-align: center;
}

/* Adaptation responsive */
@media (max-width: 992px) {
    .user-dropdown {
        display: none;
    }

    .mobile-dropdown-item {
        display: flex;
    }

    .menu-container {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }

    .header.active .menu-container {
        max-height: 1000px;
    }

    .nav {
        flex-direction: column;
        width: 100%;
    }

    .main-links {
        flex-direction: column;
        width: 100%;
    }

    .main-links li {
        margin: 5px 0;
        text-align: left;
    }

    .main-links li a {
        padding: 12px 0;
        display: block;
    }

    .hamburger-btn {
        display: flex;
    }
}

@media (max-width: 576px) {
    .mobile-menu-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}
