header {
    height: 80px; /* ou ta hauteur exacte */
    flex-shrink: 0; /* ne pas rétrécir */
    position: fixed;
    top: 0;
    left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: var(--color-white);
    padding: 0 1.3rem;
    width: 100%;
    z-index: 10;
    box-sizing: border-box;
    border-bottom: 1px solid #959595;
}

.header-left {
    display: flex;
    align-items: center;
    margin-top: -5px;
}

.header-left > a:first-child {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: var(--font-secondary);
    letter-spacing: 0.8px;
    color: var(--color-white);
}

.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-logo {
    height: 50px;
    margin-top: 4px;
    margin-right: 15px;
    align-self: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Small profile button for unauthenticated users */
.btn-profile img {
    /* Match language icon size */
    width: 17px;
    height: 17px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    margin-bottom: -4px;
    margin-right: 9px;
}

.mobile-btn-profile img {
    /* Match mobile language icon size */
    width: 16px;
    height: 16px;
    margin-bottom: -2px;
}

.user-menu img {
    height: 19px;
    width: 19px;
    vertical-align: middle;
    margin-right: 5px;
    margin-top: -2px;
}

.title {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.2;
}

.title sup {
    font-size: 11px;
    position: relative;
    top: -3px;
    margin-left: 6px;
    color: var(--color-white);
}

.sub-title {
    font-size: 12px;
}

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu img {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 4px;
}

.user-menu .username {
    font-family: var(--font-primary);
}

.user-menu .caret {
    font-size: 0.8rem;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    border: 1px solid var(--color-secondary);
    border-radius: 4px;
    min-width: 150px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
    margin-top: 3px;
    overflow: hidden; /* This ensures content doesn't overflow the rounded corners */
}

.user-menu-dropdown a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 0; /* Explicitly remove any border-radius from links */
    border: none; /* Remove borders from buttons inside dropdown */
}

/* Remove borders between buttons */
.user-menu-dropdown .btn {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.user-menu-dropdown a:hover {
    background-color: var(--color-primary-hover);
    color: var(--color-white);
}

/* Mobile menu styles */
.mobile-only {
    display: none !important;
}

.hamburger-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 10px 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 38px;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

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

.mobile-menu {
    position: fixed;
    top: 80px; /* Height of the header */
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    overflow: hidden;
    transition: height 0.3s ease;
    z-index: 11000; /* Ensure it's above all other elements */
}

.mobile-menu.active {
    height: calc(100vh - 80px); /* Full height minus header */
    overflow-y: auto;
}

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

.mobile-user-menu {
    position: relative;
    width: 100%;
}

.mobile-user-btn {
    display: flex;
    align-items: center;
    width: calc(100% - 10px);
    padding: 12px;
    justify-content: space-between;
    font-size: 18px;
    margin: 0 auto;
}

.mobile-user-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.mobile-user-dropdown {
    width: calc(100% - 10px);
    margin: 5px auto 0;
    border: 1px solid var(--color-secondary);
    border-radius: 4px;
    overflow: hidden; /* This ensures content doesn't overflow the rounded corners */
}

.mobile-user-dropdown a {
    display: block;
    padding: 12px;
    text-align: left;
    border: none;
    border-radius: 0; /* Explicitly remove any border-radius from links */
}

/* Remove borders between buttons in mobile dropdown, just like in desktop */
.mobile-user-dropdown .btn {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    border-radius: 0; /* Explicitly remove any border-radius from buttons */
}

.mobile-nav-btn {
    width: calc(100% - 40px);
    padding: 15px;
    text-align: center;
    font-size: 18px;
    margin: 0 auto;
}

.mobile-btn-discord {
    width: calc(100% - 40px);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 17px;
}

.mobile-btn-discord img {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* Search icon in mobile header */
.search-icon-mobile {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media query for screens less than 1089px */
@media (max-width: 1089px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    header {
        padding: 10px 9px 12px 17px;
        height: 60px;
    }

    .header-logo {
        height: 37px;
    }

    .mobile-menu {
        top: 60px;
    }

    .mobile-menu.active {
        height: calc(100vh - 60px);
    }
}

/* Message notification bubble styles */
.btn-messages {
    position: relative;
}

.message-notification-bubble {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-red);
    color: white;
    border-radius: 50%;
    min-width: 15px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-messages-mobile {
    position: relative;
}

.message-notification-bubble-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-red);
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 20px;
    font-size: 10px;
    padding: 0 2px;
    margin-left: 5px;
    font-weight: bold;
}

/* Mobile message icon styles */
.mobile-message-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    position: relative;
    text-decoration: none;
    margin-right: 5px;
}

.mobile-message-icon img {
    width: 25px;
    height: 19px;
}

.mobile-message-notification-bubble {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--color-red);
    color: white;
    border-radius: 50%;
    min-width: 15px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Media query for screens less than 458px */
@media (max-width: 458px) {
    .title-container {
        display: flex;
        margin-top: 3px;
    }

    .title {
        font-size: 21px;
        margin-left: -1px;
    }

    .title sup {
        display: none;
    }

    .sub-title {
        font-size: 10px;
    }

    .mobile-message-notification-bubble {
        top: 1px;
        right: -4px;
    }
    }

    /* Language menu styles */
    .language-menu {
        position: relative;
        display: inline-block;
    }

    .language-menu button {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .language-menu img {
        width: 17px;
        height: 17px;
        object-fit: cover;
        margin-right: 4px;
    }

    .language-menu .caret {
        font-size: 0.8rem;
    }

    .language-menu-dropdown {
        position: absolute;
        border: 1px solid var(--color-secondary);
        border-radius: 4px;
        min-width: 110px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        z-index: 99999;
        margin-top: 3px;
        overflow: hidden; /* This ensures content doesn't overflow the rounded corners */
        background-color: var(--color-primary);
        bottom: 42px; /* Position dropdown above the button */
        left: 0;
        right: auto; /* Override the right:0 from the header styles */
    }

    .language-menu-dropdown a {
        display: block;
        padding: 8px 12px;
        text-decoration: none;
        border-radius: 0; /* Explicitly remove any border-radius from links */
        border: none; /* Remove borders from buttons inside dropdown */
    }

    /* Remove borders between buttons */
    .language-menu-dropdown .btn {
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
    }

    .language-menu-dropdown a:hover {
        background-color: var(--color-primary-hover);
        color: var(--color-white);
    }

    .language-menu-dropdown a.active {
        background-color: var(--color-primary-hover);
        color: var(--color-secondary);
        font-weight: bold;
    }

    .lang-check {
        color: white;
        margin-left: 5px;
        font-weight: bold;
    }

    /* Mobile language menu */
    @media (max-width: 1089px) {
        .language-menu.mobile-only {
            margin-right: 10px;
        }

        .language-menu.mobile-only button {
            padding: 6px 10px;
        }

        .language-menu.mobile-only img {
            width: 16px;
            height: 16px;
        }
    }

    /* Mobile language menu dropdown */
    .mobile-language-menu-dropdown {
        position: absolute;
        right: 0;
        border: 1px solid var(--color-secondary);
        border-radius: 4px;
        min-width: 110px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        z-index: 99999;
        margin-top: 3px;
        overflow: hidden;
        background-color: var(--color-primary);
    }
