@mixin hover-navbar {
    border-color: transparent;
    background-color: $gray-100;
}
$navbar-color: #b5bcc7;
.navbar.fixed-top {
    --navbar-height: #{$navbar-height};
    padding-top: 0;
    padding-bottom: 0;
    align-items: stretch;
    box-shadow: 0 0.563rem 1.125rem rgba(92, 107, 121, .1);
    background: #ffffff;
    .navbar-brand {
        margin-right: $spacer !important;
        .logo {
            max-height: calc(var(--navbar-height) - (#{$primary-nav-padding-y} * 2));
        }
    }
    .nav-link {
        height: 100%;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }
    .divider {
        width: 1px;
        background-color: $gray-300;
    }
    #usernavigation {
        .nav-link {
            padding: 0 $primary-nav-padding-x;
        }
        .divider {
            width: 1px;
            background-color: $navbar-color;
            border: 0;
            opacity: .7;
        }
        .usermenu-container {
            .userpicture {
                width: 48px;
                height: 48px;
                border-radius: 50%;
                border: 2px solid $navbar-color;
                margin-right: 0.25rem;
            }
            .usermenu {
                #user-menu-toggle {
                    color: $navbar-color;
                    &:focus {
                        outline: none;
                        background-color: transparent;
                        box-shadow: none;
                    }
                    .viewingas {
                        color: #ffffff;
                    }
                }
            }
        }
    }
    .login {
        display: flex;
        align-items: center;
    }
    .usermenu {
        display: flex;
        .action-menu {
            display: flex;
            align-items: center;
        }
        .dropdown {
            display: flex;
            align-items: center;
            .dropdown-toggle {
                padding-top: 0;
                padding-bottom: 0;
                border-radius: 0;
                display: flex;
                align-items: center;
                height: 100%;
            }
        }
        .dropdown-menu {
            min-width: 235px;
            .carousel-navigation-link {
                > * {
                    pointer-events: none;
                }
            }
            .dropdown-item {
                padding: .25rem 1.75rem .25rem .75rem;
                &.carousel-navigation-link::after {
                    font: var(--fa-font-solid);
                    content: fa-content($fa-var-caret-right);
                    font-size: 1rem;
                    padding-top: .2rem;
                    right: .75rem;
                    position: absolute;
                }
            }
            .submenu {
                .header {
                    padding: .25rem .75rem;
                    font-size: .975rem;
                    .icon {
                        font-size: 20px;
                        height: 20px;
                        width: 20px;
                        margin: 0;
                    }
                }
                .items {
                    .dropdown-item {
                        &[aria-current="true"]::before {
                            font: var(--fa-font-solid);
                            content: fa-content($fa-var-check);
                            font-size: 0.75rem;
                            padding-left: .25rem;
                        }
                    }
                }
            }
        }
        .login {
            display: flex;
            align-items: center;
        }
    }
    .usermenu,
    .langmenu {
        .dropdown {
            display: flex;
            align-items: center;
            height: 100%;
            .dropdown-toggle {
                padding-top: 0;
                padding-bottom: 0;
                border-radius: 0;
                display: flex;
                align-items: center;
                height: 100%;
            }
        }
    }
    .langmenu {
        .dropdown-menu {
            .dropdown-item {
                &[aria-current="true"]::before {
                    content: "\f00c";
                    font-size: 0.75rem;
                    padding-left: .25rem;
                }
            }
        }
        @include media-breakpoint-down(md) {
            .langbutton {
                display: none;
            }
        }
    }
    .moodle-actionmenu .menubar,
    .action-menu-trigger .dropdown {
        height: 100%;
        display: flex;
    }
    &.navbarlayout-classic {
        background-color: $primary !important;
    }
    &:not(.navbarlayout-classic) {
        height: calc(var(--navbar-height) + 1px);
    }
    &.brandcolor-background {
        background: $primary;
        .nav-link,
        .navbar-brand,
        .langmenu .btn {
            color: #ffffff;
            &.active {
                font-weight: 700;
                color: #ffffff;
                background-color: transparent;
                border-bottom-color: #ffffff;
            }
        }
        .btn-primary {
            --bs-btn-color: #{$primary};
            --bs-btn-hover-color: #{$primary};
            --bs-btn-active-color: #{$primary};
            --bs-btn-disabled-color: #{$primary};
            --bs-btn-bg: rgba(255, 255, 255, .74);
            --bs-btn-border-color: #{$white};
            --bs-btn-hover-bg: #{lighten($white, 5%)};
            --bs-btn-hover-border-color: #{lighten($white, 3%)};
            --bs-btn-focus-shadow-rgb: #{red(mix($white, white, 30%))}, #{green(mix($white, white, 30%))}, #{blue(mix($white, white, 30%))};
            --bs-btn-active-bg: #{darken($white, 5%)};
            --bs-btn-active-border-color: #{darken($white, 8%)};
            --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
            --bs-btn-disabled-bg: #{$white};
            --bs-btn-disabled-border-color: #{$white};
        }
        .simplesearchform {
            background: #ecf3fa66;
            .btn {
                border-left: 1px solid #ffffff9c !important;
                .icon {
                    color: #ffffff;
                }
            }
            .form-control::placeholder {
                color: #ffffff;
                opacity: .7;
            }
        }
        .form-check-input:checked {
            background-color: mix(white, $primary, 30%);
            border-color: mix(black, $primary, 40%);
        }
        .navbar-toggler-icon {
            --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        }
        .navbar-content-background {
            background-color: $top_scroll_background_color;
            position: absolute;
            z-index: -1;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 0;
        }
    }
    &.navbar-layout-institutional {
        height: auto;
        //min-height: 118px;
        align-items: stretch;
        background: #ffffff;
        .navbar-content-background {
            display: none;
        }
        .navbar-content-background {
            display: none;
        }
        > .container-fluid {
            padding-left: 0;
            padding-right: 0;
        }
        .navbar-row-top {
            min-height: 72px;
            background: #ffffff;
            border-bottom: 1px solid $gray-200;
            gap: .5rem;
            .navbar-brand {
                margin-right: 0.75rem !important;
                .logo {
                    max-height: 56px;
                    width: auto;
                    object-fit: contain;
                }
            }
            #usernavigation {
                min-height: 72px;
                gap: .125rem;
                > .divider:first-child {
                    display: none;
                }
                .divider {
                    background-color: $gray-700;
                    opacity: 1;
                }
                .usermenu-container {
                    .userpicture {
                        width: 42px;
                        height: 42px;
                        border-color: $gray-700;
                    }
                    .usermenu {
                        display: flex;
                        align-items: center;
                        #user-menu-toggle {
                            color: $gray-700;
                        }
                    }
                }
            }
        }
        .navbar-row-bottom {
            min-height: 46px;
            background: $primary;
            box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .15);
            .primary-navigation {
                height: 54px;
                display: flex;
                align-items: stretch;
                .moremenu {
                    height: 100%;
                    display: flex;
                    align-items: stretch;
                }
                .nav-item {
                    display: flex;
                    align-items: stretch;
                }
                .nav-link {
                    height: 100%;
                    display: flex;
                    align-items: center;
                    color: #ffffff;
                    border: 0;
                    border-radius: 0;
                    padding-left: 1rem;
                    padding-right: 1rem;
                    &:hover,
                    &:focus {
                        color: #ffffff;
                        background: rgba(255, 255, 255, .08);
                    }
                    &.active {
                        background: $secondary;
                        color: #ffffff;
                        font-weight: 600;
                    }
                }
                .nav-item.active > .nav-link {
                    background: $secondary;
                    color: #ffffff;
                    font-weight: 600;
                }
            }
            > .navbar-nav {
                height: 46px;
                align-items: center;
                .nav-link,
                a {
                    color: #ffffff;
                }
                .dropdown-toggle {
                    color: #ffffff;
                }
            }
            .moodle-actionmenu .menubar,
            .action-menu-trigger .dropdown {
                height: 46px;
                align-items: center;
            }
        }
        &.brandcolor-background {
            .navbar-row-bottom {
                background: $primary;
            }
            .navbar-row-top {
                .langmenu .btn,
                .nav-link,
                .navbar-brand {
                    color: $gray-700;
                }
            }
        }
        .simplesearchform{
            .btn {
                .icon {
                    color: $gray-700;
                }
            }
        }
        @include media-breakpoint-down(md) {
            min-height: 61px;
            .navbar-row-top {
                min-height: 61px;
                .navbar-brand .logo {
                    max-height: 42px;
                }
                #usernavigation {
                    .simplesearchform {
                        display: none;
                    }
                    .divider {
                        display: none;
                    }
                }
            }
            .navbar-row-bottom {
                display: none !important;
            }
        }
    }
}
.usermenu-modal-userlinks {
    min-height: 400px;
    @media (max-width: 992px) {
        max-width: 95%;
    }
    .modal-content {
        .modal-header {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background-image: var(--background_profile, url([[pix:theme_eadtraining|user-modal-background]]));
            background-position: center center;
            background-size: cover;
            background-repeat: no-repeat;
            padding: 50px 1rem 60px;
            h5 {
                color: #ffffff;
                font-size: 42px;
            }
            button {
                background-color: #ffffff !important;
                border-radius: 12px;
                width: 40px;
                height: 40px;
                margin: 0;
                padding: 0;
                order: 3;
                display: flex;
                justify-content: center;
                align-items: center;
                color: #000000 !important;
                &:before {
                    filter: invert(1);
                }
            }
            .user-action {
                display: flex;
                align-items: center;
                gap: 12px;
                margin-left: auto;
                margin-right: 20px;
                .languages {
                    position: relative;
                    * {
                        transition: all .2s ease-out;
                    }
                    a {
                        background-color: #f0f4f9a3;
                        color: #3f3f3f !important;
                        border-radius: 17px;
                        font-size: 20px;
                        padding: 5px 22px;
                        &:hover {
                            background-color: #f0f4f9;
                        }
                    }
                    .submenus {
                        background-color: #f0f4f9a3;
                        color: #3f3f3f !important;
                        border-radius: 17px;
                        position: absolute;
                        right: -30px;
                        opacity: 0;
                        height: 0;
                        overflow: hidden;
                        a {
                            background: #fff0;
                            color: #ffffff;
                            &:hover {
                                background-color: #f0f4f9;
                            }
                        }
                    }
                    &:hover {
                        .submenus {
                            opacity: 1;
                            height: auto;
                        }
                    }
                }
            }
            .avatar {
                display: none;
                position: absolute;
                bottom: -40px;
                left: 190px;
                z-index: 99;
            }
            &.show-avatar {
                .avatar {
                    // display: block;
                }
            }
        }
        .modal-body {
            padding: 0;
        }
        .usermenu-modal-tabs {
            display: flex;
            overflow: auto;
            .tabs-menu-link {
                list-style: none;
                padding: 14px;
                min-width: 180px;
                border-right: 2px solid #f0f4f9;
                a {
                    padding: 10px;
                    border-radius: 17px;
                    &.active,
                    &:hover {
                        background-color: #f0f4f9;
                        color: #3f3f3f;
                    }
                    &[href="#"] {
                        display: none;
                    }
                }
                @media (max-width: 575px) {
                    width: 100%;
                }
            }
            .usermenu-modal-tabs-content {
                overflow: hidden;
                width: 100%;
                @media (max-width: 575px) {
                    display: none;
                }
            }
        }
    }
}
.dir-rtl .navbar.fixed-top {
    .usermenu {
        .dropdown-menu {
            .dropdown-item {
                &.carousel-navigation-link::after {
                    font: var(--fa-font-solid);
                    content: fa-content($fa-var-caret-left);
                }
            }
            .carousel {
                .carousel-inner {
                    .carousel-item-prev.carousel-item-right,
                    .carousel-item-next.carousel-item-left {
                        transform: translateX(0);
                    }
                    .carousel-item-next,
                    .carousel-item-right.active {
                        transform: translateX(-100%);
                    }
                    .carousel-item-prev,
                    .carousel-item-left.active {
                        transform: translateX(100%);
                    }
                }
            }
        }
    }
}
#page {
    margin-top: $navbar-height;
}
.pagelayout-maintenance,
.pagelayout-embedded {
    #page {
        margin-top: 0;
        background: #ffffff;
        #page-content {
            padding: 0 20px;
        }
    }
}
.navbar-bootswatch {
    .navbar-brand {
        overflow: hidden;
        text-overflow: ellipsis;
        .sitename {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    }
}
