/* Reset & Base */
.navbar * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 80px !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05) !important;
    z-index: 1000 !important;
    font-family: 'Barlow', sans-serif !important;
}

/* Grid Container - Le secret de l'alignement parfait */
.navbar-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Gauche (1 part), Centre (auto), Droite (1 part) */
    align-items: center;
    gap: 40px; /* Espace augmenté entre les colonnes */
}

/* === PARTIE GAUCHE (Logo) === */
.navbar-left {
    justify-self: start; /* Aligné à gauche */
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    color: #1d2630;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: #006994;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}

.brand-logo-image {
    max-height: 42px;
    max-width: 150px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* === PARTIE CENTRALE (Liens) === */
.navbar-center {
    justify-self: center; /* Aligné au centre */
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    gap: 5px;
}

.nav-link {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 25px; /* Espace augmenté entre les liens */
    border-radius: 0;
    transition: all 0.2s ease;
    display: block;
}

.nav-link:hover {
    color: #006994;
    background: transparent;
}

.nav-link.active {
    color: #006994;
    font-weight: 600;
    background: transparent;
    box-shadow: none;
}

.separator {
    width: 1px;
    height: 20px;
    background: #dee2e6;
    margin: 0 10px;
}

/* === PARTIE DROITE (Auth & Mobile) === */
.navbar-right {
    justify-self: end; /* Aligné à droite */
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Bouton Connexion / Inscription */
.btn-login {
    text-decoration: none;
    background-color: #006994;
    color: white;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-login:hover {
    background-color: #005577;
}

/* Menu Utilisateur (Dropdown) */
.user-menu-container {
    position: relative;
}

.user-btn {
    background: transparent;
    border: 1px solid #e9ecef;
    padding: 6px 12px 6px 6px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.user-btn:hover {
    border-color: #ced4da;
    background: #f8f9fa;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #006994;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: #343a40;
}

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

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

.dropdown-header {
    padding: 8px 12px;
    font-size: 13px;
    color: #868e96;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #006994;
}

.dropdown-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 5px 0;
}

.text-danger { color: #e03131 !important; }
.text-danger:hover { background: #fff5f5 !important; }

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-toggle {
    position: relative;
}

.dropdown-submenu .dropdown-toggle .fa-chevron-right {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.dropdown-submenu:hover .dropdown-toggle .fa-chevron-right {
    transform: rotate(90deg);
}

.dropdown-submenu-content {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 1200;
    margin-left: 5px;
}

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

.mobile-submenu {
    position: relative;
}

.mobile-submenu-toggle .fa-chevron-down {
    margin-left: auto;
    transition: transform 0.3s;
}

.mobile-submenu.active .mobile-submenu-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.mobile-submenu-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 20px;
}

.mobile-submenu.active .mobile-submenu-content {
    max-height: 500px;
}

.mobile-user-link.sub-item {
    padding-left: 40px;
    font-size: 13px;
    color: #666;
}

/* === MOBILE TOGGLE === */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.mobile-toggle:hover {
    background: #f8f9fa;
}

.mobile-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #343a40;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* === MOBILE OVERLAY === */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* === MOBILE MENU === */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-header {
    background: linear-gradient(135deg, #006994 0%, #005577 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-brand-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mobile-brand-logo-image {
    max-height: 40px;
    max-width: 150px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.mobile-brand-text {
    display: flex;
    flex-direction: column;
}

.mobile-brand-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.mobile-brand-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.mobile-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.mobile-menu-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 16px;
    text-decoration: none;
    color: #495057;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-link i {
    width: 24px;
    font-size: 18px;
    color: #006994;
    text-align: center;
}

.mobile-link:hover {
    background: linear-gradient(90deg, rgba(0, 105, 148, 0.1) 0%, rgba(0, 105, 148, 0.05) 100%);
    color: #006994;
    transform: translateX(5px);
}

.mobile-link.active {
    background: linear-gradient(90deg, #006994 0%, #005577 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 105, 148, 0.3);
}

.mobile-link.active i {
    color: white;
}

.mobile-user-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #006994 0%, #005577 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.mobile-user-details {
    flex: 1;
    min-width: 0;
}

.mobile-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d2630;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-email {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-user-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    text-decoration: none;
    color: #495057;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: 'Barlow', sans-serif;
}

.mobile-user-link i {
    width: 24px;
    font-size: 16px;
    color: #006994;
    text-align: center;
}

.mobile-user-link:hover {
    background: #f8f9fa;
    color: #006994;
}

.mobile-user-link.logout {
    color: #e03131;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.mobile-user-link.logout i {
    color: #e03131;
}

.mobile-user-link.logout:hover {
    background: #fff5f5;
    color: #c92a2a;
}

.mobile-auth-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.btn-login-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    background: linear-gradient(135deg, #006994 0%, #005577 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 105, 148, 0.3);
}

.btn-login-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 105, 148, 0.4);
}

.btn-login-mobile i {
    font-size: 18px;
}

/* === RESPONSIVE MEDIA QUERIES === */
@media (max-width: 992px) {
    .navbar-container {
        display: flex;
        justify-content: space-between;
    }

    .navbar-center {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .btn-login {
        display: none;
    }

    .user-menu-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-menu {
        width: 300px;
        max-width: 90vw;
    }

    .mobile-menu-header {
        padding: 18px;
    }

    .mobile-brand-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .mobile-brand-title {
        font-size: 16px;
    }

    .mobile-brand-subtitle {
        font-size: 10px;
    }

    .mobile-close {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .mobile-menu-content {
        padding: 15px;
    }

    .mobile-link {
        padding: 12px 14px;
        font-size: 15px;
    }

    .mobile-link i {
        width: 22px;
        font-size: 16px;
    }

    .mobile-user-info {
        padding: 12px;
    }

    .mobile-user-avatar {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .mobile-user-name {
        font-size: 15px;
    }

    .mobile-user-email {
        font-size: 12px;
    }

    .mobile-user-link {
        padding: 11px 14px;
        font-size: 14px;
    }

    .btn-login-mobile {
        padding: 12px 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        max-width: 100vw;
    }

    .mobile-nav {
        gap: 6px;
    }

    .mobile-link {
        padding: 11px 12px;
        font-size: 14px;
    }
}
