header{
    height: var(--header-height);
    width: 100vw;
    border-bottom: none;
    box-sizing: border-box;
    padding: var(--header-padding);
    background-color: var(--header-bg);
    position: relative;
    /*z-index: 99999;*/
    z-index:9999999999;

    .header-container{
        display: flex;
        align-items: center;
        height: 100%;
        gap: 1rem;

        .header-content-mobile{
            display: none;
        }

        .header-content{
            display: flex;
            align-items: center;
        }
        #header-content-line-2{
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.5rem;
        }

        > a{
            display: flex;
            align-items: center;
        }
        a img{
            width: 14.25rem;
            height: auto;
        }
        div.space{
            flex-grow: 1;
        }
        #usermanual{
            a{
                display: flex;
                align-items: center;
                gap: 0.375rem;
                text-decoration: none;
                color: var(--app-color-1);
                background-color: var(--app-color-2);
                border-radius: 0.25rem;
                height: 2rem;
                padding: 0.5rem 0.75rem;
                font-size: 0.875rem;
                line-height: 1.2;
                white-space: nowrap;
                margin: 0;

                .lucide{
                    width: 1rem;
                    height: 1rem;
                    flex-shrink: 0;
                }
            }
            a:hover{
                filter: brightness(0.8);
            }
        }
        #collaborators{
            a{
                display: flex;
                align-items: center;
                gap: 0.3rem;
                text-decoration: none;
                color: var(--app-color-2);
                background-color: var(--app-color-1);
                border-radius: 0.25rem;
                height: 2rem;
                padding: 0.5rem 0.75rem;
                font-size: 0.875rem;
                line-height: 1.2;
                white-space: nowrap;
                margin: 0rem;

                .lucide{
                    width: 1em;
                    height: 1em;
                    flex-shrink: 0;
                }
            }
            a:hover{
                filter: brightness(0.8);
            }
        }
        div.options{
            .languages{
                display: flex;
                gap: 0.5rem;

                a{
                    display: inline-flex;
                    color: var(--app-color-2);
                    text-decoration: none;
                    font-size: 0.813rem;
                    padding: 0.2rem 0.4rem;
                    border-radius: 0.25rem;

                    &:hover{
                        background-color: var(--app-color-5);
                    }
                }
                
                .language-option{
                    padding: 0;
                    margin: 0;
                    border-radius: 0;
                }

                .language-option.active{
                    position: relative;
                }

                .language-option.active::before{
                    content: '';
                    display: block;
                    height: 0.15rem;
                    background-color: var(--app-color-2);
                    position: absolute;
                    top: -0.3rem;
                    left: 0;
                    right: 0;
                }
            }
        }
        .language-selector{
            position: relative;
            color: var(--app-color-2);
            font-size: 0.875rem;

            summary{
                display: flex;
                align-items: center;
                gap: 0.375rem;
                height: 2rem;
                padding: 0.5rem 0.75rem;
                border-radius: 0.25rem;
                font-weight: 700;
                line-height: 1.2;
                list-style: none;
                cursor: pointer;

                &::-webkit-details-marker{ display: none; }
                &:hover{ background-color: var(--app-color-5); }
                svg{ width: 1rem; height: 1rem; }
            }
            &[open] summary svg{ transform: rotate(180deg); }
            .language-options{
                position: absolute;
                top: calc(100% + 0.5rem);
                left: 50%;
                transform: translateX(-50%);
                min-width: 10rem;
                margin: 0;
                padding: 0.5rem;
                list-style: none;
                background: var(--header-bg);
                border: 0.1rem solid black;
                border-radius: 0.3rem;
                z-index: 99999;

                a{
                    display: block;
                    padding: 0.5rem;
                    color: var(--app-color-3);
                    text-decoration: none;
                    border-radius: 0.25rem;
                    &:hover, &:focus-visible{ background: var(--app-color-5); }
                    &[aria-current]{ font-weight: 700; }
                }
            }
        }
        div.user-info{
            margin-left: 0;

            .user-container{
                display: flex;
                flex-wrap: nowrap;
                align-items: center;

                .user-toggle{
                    display: flex;
                    align-items: center;
                    gap: 0.375rem;
                    padding: 0.25rem 0.75rem;
                    border: 0;
                    border-radius: 0.25rem;
                    background: transparent;
                    color: inherit;
                    font: inherit;
                    text-align: left;
                    cursor: pointer;

                    &:hover{ background: var(--app-color-5); }
                    .user-dropdown svg{ width: 1rem; height: 1rem; }
                }
                .basic-info{
                    margin: 0;
                    display: flex;
                    flex-direction: column;

                    span:nth-child(1){
                        color: #404344;
                        font-size: 0.813rem;
                        font-weight: 700;
                    }
                    span:nth-child(2){
                        color: #404344;
                        font-size: 0.813rem;
                        font-weight: 400;
                    }
                    .user-info{
                        max-width: 8.8125rem;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                    
                    @media (max-width: 1000px) and (min-width: 900px){
                        .user-info{
                            width: 3rem;
                        }
                    }
                }
                .user-dropdown{
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 1rem;
                    height: 1rem;
                    flex-shrink: 0;
                    cursor: pointer;
                
                    svg{
                        pointer-events: none;
                    }
                }
                .user-options{
                    display: none;
                }
                
                .avatar{
                    width: 2.5rem;
                    height: 2.5rem;
                    border-radius: 50%;
                    object-fit: cover;
                    border: 0.03125rem solid var(--app-color-3);
                    flex-shrink: 0;
                }
            }
            .user-container.show{
                position: relative;

                .user-dropdown{
                    transform: rotate(180deg);
                }
                .user-options{
                    display: inline;
                    position: absolute;
                    top: 3rem;
                    right: 0;
                    z-index: 99999;
                    background-color: white;
                    padding: 1rem;
                    border: 0.1rem solid black;
                    border-radius: 0.3rem;

                    > div{
                        color: #004872;
                        font-size: 1rem;
                        font-weight: 700;
                        border-bottom: 0.1rem solid #004872;
                        padding-bottom: 0.5rem;
                    }

                    ul{
                        list-style: none;
                        padding: 0;
                        margin: 0;
                        
                        li{
                            list-style: none;
                            padding: 0.5rem 0;

                            a{
                                color: #004872;
                                font-size: 1rem;
                                font-weight: 400;
                                text-decoration: unset;
                            }
                        }
                    }
                }
            }
        }
    }
}
body.mobile{
    --header-height: 4.9rem;

    header{
        padding-left: 1rem;
        padding-right: 1rem;

        .header-container{
            align-items: center;

            > a{
                display: flex;
                align-items: center;

                img{
                    width: 14.25rem;
                    height: auto;
                    max-width: 100%;
                }
            }
            .header-content-mobile{
                display: flex;
                align-items: center;

                svg{
                    width: 3rem;
                    height: auto;
                    color: var(--app-color-3);
                }
            }
            .header-content{
                display: none;
            }
        }
        .header-container.show-content{
            .header-content{
                display: flex;
                flex-direction: column;
                align-items: center;
                top: 100%;
                left: 0;
                position: absolute;
                background-color: white;
                padding: 1rem;
                width: 100vw;

                #header-content-line-1{
                    justify-content: center;
                    margin-bottom: 0.5rem;
                    width: 100%;
                }
                #header-content-line-2{
                    flex-direction: column;
                    align-items: center;
                    gap: 0.5rem;
                    width: 100%;
                }

                > div{
                    > div{
                        > a{
                            text-align: center;
                            justify-content: center;
                        }
                    }
                }
                .options{
                    .languages{
                        width: fit-content;
                        margin: 0.5rem auto;
                    }
                }
            }
            .user-info{
                margin: unset;

                .user-container{
                    width: fit-content;
                    margin: 0.5rem auto;
                }
            }
        }
    }
}