header {
    padding-top: 20px;
    display: flex;
    align-items: center;
    height: 40px;
    color: var(--color-tertiary);
    font-weight: 500;

    background: var(--color-background);

    position: fixed;
    padding: 10px calc(50% - var(--body-width) / 2);
    width: var(--body-width);

    z-index: 2000;
}


#header_btn_search {
    border-style: solid;
    border-color: var(--color-secondary);
    padding: 5px 10px;
    border-radius: 25px;
}

header nav>* {
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

header nav>*:hover {
    transform: scale(1.05);

    color: var(--color-primary);
    cursor: pointer;
}

.dropdown {
    position: relative;
}

.dropdown-button {
    background: none;
    border: none;
    color: var(--color-tertiary);
    font-weight: 100;
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;

    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dropdown-button:hover {
    transform: scale(1.05);

    color: var(--color-primary);
    cursor: pointer;
}

.arrow {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.arrow span {
    display: inline-block;
    position: absolute;
    width: 20px;
    height: 0px;
    border-style: solid;
    border-color: var(--color-secondary);
    border-width: 5px 0 0 0;
    border-radius: 5px;
    transition: 0.3s;
}

.arrow span:nth-child(1) {
    right: 6px;
    transform: rotate(45deg);
}

.arrow span:nth-child(2) {
    left: 6px;
    transform: rotate(-45deg);
}

.arrow.open span:nth-child(1) {
    right: 6px;
    transform: rotate(-45deg);
}

.arrow.open span:nth-child(2) {
    left: 6px;
    transform: rotate(45deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-background-secondary);
    border: 1px solid var(--color-background-tertiary);
    border-radius: 8px;
    min-width: 80px;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease, opacity 0.3s ease;
    visibility: hidden;
    z-index: 10;
}

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

.dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--color-primary);
    text-decoration: none;
}

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

.dropdown-button:hover .arrow::before {
    border-color: var(--color-secondary);
}

.chat-badge {
    background-color: var(--color-secondary);
    color: var(--color-background);
    border-radius: 12px;
    padding: 3px;
    font-size: 12px;
    font-weight: bold;
    position: relative;
    top: -5px;
    right: -5px;
}

header .left {
    gap: 10px !important;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);

    cursor: pointer;

    transition: transform 0.2s ease-in-out;
}

.site-title:hover {
    transform: scale(1.05);
}

.site-title .logo {
    height: 40px;
    margin-bottom: -3px;
}

@media (max-width: 1100px) {
    #mobile_nav>nav {
        display: flex;
        flex-direction: column;
        gap: 10px;

        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;

        position: fixed;
        z-index: 1;

        align-items: end;

        margin-right: -15px;
        padding-right: 15px;
    }

    #mobile_nav>nav::before {
        content: '';
        z-index: -1;
        position: fixed;
        top: var(--mobile-nav-bg-top);
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--color-background);
        max-height: var(--mobile-nav-bg-max-height);

        transition: max-height 0.5s ease-in-out;
    }

    #mobile_nav {
        width: 100%;
        display: flex;
        align-items: end;
        flex-direction: column;
        margin-right: 5px;
        gap: 0;

        --mobile-nav-bg-top: 0px; 
        --mobile-nav-bg-max-height: 0;
    }

    #header_menu_btn {
        position: relative;
        width: 40px;
        height: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 2;
    }

    #header_menu_btn>span {
        display: inline-block;
        position: absolute;
        width: 40px;
        height: 0px;
        border-style: solid;
        border-color: var(--color-secondary);
        border-width: 5px 0 0 0;
        border-radius: 5px;
        transition: 0.3s;
    }

    #header_menu_btn>span:nth-child(1) {
        top: -5px;
        transform: rotate(0);
    }

    #header_menu_btn>span:nth-child(2) {
        opacity: 1;
    }

    #header_menu_btn>span:nth-child(3) {
        bottom: -5px;
        transform: rotate(0);
    }


    .open #header_menu_btn>span:nth-child(1) {
        top: 7px;
        transform: rotate(45deg);
    }

    .open #header_menu_btn>span:nth-child(2) {
        opacity: 0;
    }

    .open #header_menu_btn>span:nth-child(3) {
        bottom: 7px;
        transform: rotate(-45deg);
    }
}