/* ---- Navbar de base (Desktop par défaut) ---- */
.navbar {
    width: 100%;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    background-color: #272a49;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: nowrap;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-sizing: border-box;
    height: 60px;
}

/* ---- Nouveau conteneur pour les éléments à droite ---- */
.right-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre nav-links et la loupe */
    margin-left: auto; /* Pousse tout à droite */
}

/* ---- Logo ---- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-container img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease;
    cursor: pointer;
}
.logo-container img:hover {
    transform: scale(1.1);
}
.site-title {
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: color 0.3s ease;
    cursor: pointer;
}
.site-title:hover {
    color: #ff5733;
}

/* ---- Liens Desktop ---- */
.nav-links {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    height: 100%;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.nav-links a,
.nav-links .logout-button,
.nav-links .login-button,
.nav-links .signup-button {
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    color: white;
    background-color: #ff3c00;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    box-sizing: border-box;
    margin: auto 0;
}
.nav-links a:hover,
.nav-links .logout-button:hover,
.nav-links .login-button:hover,
.nav-links .signup-button:hover {
    background-color: #ff5733;
}

/* ---- Loupe (search-link) ---- */
/* ---- Loupe (search-link) ---- */
.search-link {
    color: white !important;
    font-size: 1.5em !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
    visibility: visible !important; /* Ajout pour garantir la visibilité */
}
.search-link:hover {
    transform: scale(1.1) !important; /* Agrandissement au survol */
    visibility: visible !important; /* Empêche la disparition */
}

/* ---- Zone utilisateur ---- */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}
.profile-avatar {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar:hover {
    transform: scale(1.1);
}

/* ---- Liens divers (icônes, etc.) ---- */
.messaging-icon {
    font-size: 1.5em;
    margin-right: 10px;
    cursor: pointer;
}
.envelope-link {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.envelope-link:hover .messaging-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Par défaut, éléments mobiles cachés */
.mobile-menu-icon,
.mobile-menu {
    display: none;
}

.guest-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* ---- Media Queries ---- */
@media screen and (min-width: 769px) {
    .nav-links {
        display: flex;
        flex-direction: row;
    }
    .desktop-only {
        display: flex;
    }
    .mobile-menu-icon,
    .mobile-menu {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .right-container {
        display: none !important; /* Masquer tout le conteneur à droite en mobile */
    }
    .mobile-menu-icon {
        display: block !important;
        font-size: 1.8em !important;
        cursor: pointer !important;
        color: white !important;
        margin-left: auto !important;
    }
    .mobile-menu {
        display: none !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #272a49 !important;
        z-index: 999 !important;
        box-sizing: border-box !important;
    }
    .mobile-menu.active {
        display: flex !important;
    }
    .mobile-menu a,
    .mobile-menu .logout-button,
    .mobile-menu .login-button,
    .mobile-menu .signup-button {
        padding: 10px 20px !important;
        text-align: center !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        text-decoration: none !important;
        background-color: #272a49 !important;
        display: block !important;
    }
    .mobile-menu a:last-child,
    .mobile-menu .logout-button:last-child,
    .mobile-menu .login-button:last-child,
    .mobile-menu .signup-button:last-child {
        border-bottom: none !important;
    }
}