//
// _topbar.scss
//

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    background: $topbar-bg;
    box-shadow: $card-box-shadow;
    height: $topbar-height;
    margin-left: $sidenav-width;
    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: $grid-gutter-width;
        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 {
    float: left;
    display: none;
    line-height: $topbar-height;
    padding: 0 $spacer * 0.5;

    .logo-sm {
        display: none;
    }

    .logo-light {
        display: none;
    }

    .logo-dark {
        display: block;
    }
}

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"],
html[data-topbar-color="gradient"] {
    .app-topbar {
        .sidenav-toggle-button {
            background-color: rgba(var(--#{$prefix}white-rgb), 0.03);
            border: 1px dashed rgba(var(--#{$prefix}white-rgb), 0.1) !important;
            color: $white !important;
        }
    }

    &:not([data-bs-theme="dark"]) {
        .app-topbar {
            .app-search {
                .app-search-icon {
                    color: $topbar-item-color !important;
                }

                input::placeholder {
                    color: $topbar-item-color !important;
                    opacity: 0.5;
                }
            }
        }
    }
}

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

// Notification Close Btn
.dropdown-item {
    &:hover {
        .noti-close-btn {
            display: block !important;
        }
    }
}


@media (max-width: 375px) {
    .logo-topbar {
        display: none !important;
    }
}

@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 !important;
    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-menu-color="light"][data-topbar-color="dark"],
html[data-menu-color="light"][data-topbar-color="gradient"],
html[data-menu-color="gray"][data-topbar-color="dark"],
html[data-menu-color="gray"][data-topbar-color="gradient"] {
    .sidenav-menu {
        .logo {
            background: $topbar-bg;
            width: calc(100% + 1px);
        }
    }
}

.thememode-dropdown {
    .dropdown-item {
        .form-check-input {
            opacity: 0;
        }
    }

    /* style the parent label when its radio is checked */
    .dropdown-item input[type="radio"]:checked+* {
        background-color: red;
        color: #fff;
        border-radius: 4px;
        padding: 4px;
    }
}


// Fullscreen Toggle
//
.fullscreen-off {
    display: block;
}

.fullscreen-on {
    display: none;
}

.fullscreen-enable {
    .fullscreen-off {
        display: none;
    }

    .fullscreen-on {
        display: block;
    }
}