//
// _topbar.scss
//

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: $topbar-bg;
    box-shadow: $card-box-shadow;
    min-height: $topbar-height;
    transition: margin-left .25s ease-in-out;

    .topbar-menu {
        display: flex;
        justify-content: space-between;
        position: relative;
        border-bottom: $card-border-width solid $card-border-color;
        padding-left: 0;
        padding-right: $grid-gutter-width;

        .topbar-item {
            display: flex;
            align-items: center;
            justify-content: center;
            height: $topbar-height;

            .topbar-link {
                z-index: 1;
                border: none;
                background-color: transparent;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                color: $topbar-item-color;
                position: relative;

                &:hover,
                &:active,
                &:focus {
                    color: $topbar-item-hover-color;
                }

            }

            .topbar-badge {
                position: absolute;
                top: -10px;
                right: -1px;
            }
        }
    }

    ul {
        list-style-type: none;
        margin-bottom: 0;
    }
}

// Topbar Logo
.logo-topbar {
    line-height: $topbar-height;
    padding: 0 $spacer;
    // min-width: $sidenav-width;

    .logo-sm {
        display: none;
    }

    .logo-light {
        display: none;
    }

    .logo-dark {
        display: block;
    }
}

// Sidebar sm hover Toggle Menu Button (sm hover active button)
.button-collapse-toggle {
    background: transparent;
    border: none;
    z-index: 1;
    color: $topbar-item-color;

    &:hover,
    &:focus,
    &:active {
        color: $topbar-item-hover-color;
    }
}

html[data-topbar-color="dark"],
html[data-bs-theme="dark"] {
    .logo-topbar {
        .logo-light {
            display: block;
        }

        .logo-dark {
            display: none;
        }
    }
}

html[data-topbar-color="dark"] {

    &:not([data-bs-theme="dark"]) {
        .app-topbar {
            .topbar-menu {
                border-bottom-color: $topbar-bg;
            }
        }

        .logo-topbar {
            border-right: 0;

            .logo-text {
                color: $white !important;
            }
        }

        .app-topbar {
            .app-search {
                .app-search-icon {
                    color: rgba(var(--#{$prefix}white-rgb), 0.5) !important;
                }

                input::placeholder {
                    color: rgba(var(--#{$prefix}white-rgb), 0.5) !important;
                }
            }
        }
    }
}


// Topbar light/Dark Mode icon 
#light-dark-mode {
    .mode-light-sun {
        display: none;
    }
}

html[data-bs-theme="dark"] {
    #light-dark-mode {
        .mode-light-sun {
            display: block;
        }

        .mode-light-moon {
            display: none;
        }
    }
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: $topbar-height;
    transition: none;

    &::before {
        content: "";
        height: 18px;
        opacity: 0.35;
        width: 1px;
        border-left: 1px solid $topbar-item-color;
    }
}




@include media-breakpoint-down(sm) {
    .app-topbar {

        .topbar-menu {
            position: initial;

            .topbar-badge {
                top: 10px;
            }
        }

        .dropdown {
            position: static;

            .dropdown-menu {
                width: 90%;
            }
        }
    }
}

@include media-breakpoint-down(md) {
    .logo-topbar {
        display: block;

        span.logo-lg {
            display: none;
        }

        span.logo-sm {
            display: block;
        }
    }
}

//
// Topbar Search
//
.topbar-search {
    width: 230px;
    padding: $input-padding-y $input-padding-x;
    background-color: $topbar-search-bg !important;
    color: $topbar-item-color !important;
    border-color: $topbar-search-border;
    line-height: $input-line-height;
    @include border-radius($input-border-radius, 0);
}

//
// Notification
//
.notification-item {
    position: relative;
    cursor: pointer;

    .notification-badge {
        height: 22px;
        width: 22px;
        text-align: center;
        color: $white;
        top: -12px;
        right: -8px;
        border: 2px solid $card-bg;
        line-height: 18px;
        font-size: 11px;
    }
}

// Manage for light & dark logo
html[data-sidenav-color="light"][data-topbar-color="dark"] {
    .sidenav-menu {
        .logo {
            background: $topbar-bg;
            width: calc(100% + 1px);
        }
    }
}