/// Main Sidebar
/////////////////////////////
.nk{
    &-sidebar{
        position: fixed;
        top: 0;
        display: flex;
        width: $sidebar-width-normal;
        min-height: 100vh;
        max-height: 100vh;
        box-shadow: 1px 0px 6px 0px rgba($base-color, 0.08);
        z-index: 1021;
        left: 0;
        transform: translateX(-100%);
        transition: left $sidebar-transition-duration $sidebar-transition-name,transform $sidebar-transition-duration $sidebar-transition-name;
        &-bar{
            width: $sidebar-bar-width;
            background: $sidebar-bg-color;
            border-right: 1px solid $sidebar-border-color;
            &.is-light{
                background: $sidebar-bg-light-color;
                border-right-color: $sidebar-border-light-color;
            }
            @if($dark_option==true) {
                &.is-dark{
                    background: $sidebar-bg-dark-color;
                    border-right-color: $sidebar-border-dark-color;
                    + .is-dark{
                        background: lighten($sidebar-bg-dark-color,2%);
                    }
                }
            }
            @if($dark_theme_option==true) {
                &.is-theme{
                    background: $sidebar-bg-theme-color;
                    border-right-color: $sidebar-border-theme-color;
                    + .is-theme{
                        background: lighten($sidebar-bg-theme-color,2%);
                    }
                }
            }
            .dropdown-menu{
                .lead-text{
                    color: $base-color;
                }
                .sub-text,.overline-title,.overline-title-alt{
                    color: $base-light;
                }
            }
        }
        &-main{
            flex-grow: 1;
            width: $sidebar-width-normal - $sidebar-bar-width;
            background: $sidebar-bg-color;
            border-right: 1px solid $sidebar-border-color;
            &.is-light{
                background: $sidebar-bg-light-color;
                border-right-color: $sidebar-border-light-color
            }
            @if($dark_option==true) {
                &.is-dark{
                    background: $sidebar-bg-dark-color;
                    border-right-color: $sidebar-border-dark-color;
                }
            }
            @if($dark_theme_option==true) {
                &.is-theme{
                    background: $sidebar-bg-theme-color;
                    border-right-color: $sidebar-border-theme-color;
                }
            }
        }
        &-overlay{
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background: $sidebar-overlay;
            z-index: 801;
            animation: overlay-fade-in .4s ease 1;
        }
        &-element{
            overflow: hidden;
            width: 100%;
            max-height: 100%;
        }
        &.nk-sidebar-active{
            transform: translateX(0);
        }
        &-fixed{
            position: fixed;
            max-height: 100vh;
        }
        &-head{
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: $header-main-gap-y $sidebar-gap-x;
            min-width: 100%;
            width: $sidebar-width-normal;
            height: $header-height;
            border-bottom: 1px solid $border-light;
            @if($dark_option==true) {
                .is-dark &{
                    border-color: $sidebar-border-dark-color;
                }
            }
            @if($dark_theme_option==true) {
                .is-theme &{
                    border-color: $sidebar-border-theme-color;
                }
            }
        }
        &-brand{
            position: relative;
            flex-shrink: 0;
        }
        &-logo{
            transition: opacity .3s ease;
            .logo-img:not(:first-child){
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
            }
        }
        &-footer{
            margin-top: auto;
            padding: .75rem .1875rem .5rem;
        }
        &-body{
            position: relative;
            .simplebar-content{
                padding-bottom: .25rem !important;
                min-height: 100%;
                display: flex;
                flex-direction: column;
            }
            .simplebar-scroll-content{
                min-height: 100%;
                width: 100%;
            }
        }
        &-content{
            display: flex;
            flex-direction: column;
            height: calc(100vh - (#{$header-height} + 60px));
            .nk-sidebar-menu{
                padding-top: 1.5rem;
                &[data-simplebar]{
                    height: 100%;
                }
            }
            &[data-simplebar]{
                > div {width: 100%}
            }
        }
        &-profile{
            &-fixed{
                position: fixed;
                bottom: 0;
                width: $sidebar-bar-width;
                display: flex;
                justify-content: center;
                padding: .25rem 0 1rem;
                z-index: 9;
            }
            &-dropdown{
                &.content-active{
                    display: block;
                    left: 100%;
                    bottom: 0;
                }
            }
        }
        &-inner{
            padding: 1.5rem 1.75rem 2rem;
            max-height: calc(100vh - #{$header-height});
        }
        &.mobile-menu{
            transition: transform .4s ease;
        }
        .nk-menu:not(.apps-menu){
            .nk-menu{
                &-heading{
                    padding-left: 0;
                    padding-right: 0;
                }
                &-toggle{
                    &:after{
                        right: 0;
                    }
                }
            }
            > li > a{
                padding-left: 0;
                padding-right: 0;
            }
        }
    }
}
@keyframes overlay-fade-in{
    0%{
        opacity: 0;
    }100%{
        opacity: 1;
    }
}

@include media-breakpoint-down(lg){
    .nk{
        &-sidebar{
            &-mobile{
                width: $sidebar-width-normal !important;
            }
        }
    }
}
@include media-breakpoint-down(sm){
    .nk{
        &-sidebar{
            &-inner{
                padding: 1.25rem 1.25rem 2.5rem;
            }
        }
    }
}
@include media-breakpoint-up(xl){
    .nk-sidebar-content .nk-sidebar-menu{
        padding-top: .25rem;
        padding-bottom: 1.5rem;
    }
    .nk-sidebar{
        transform: translateX(0);
        &-overlay{
            display: none;
        }
    }
    .has-sidebar .nk-wrap{
        padding-left: $sidebar-width-normal;
    }
}

@media (max-width:420px) {
    .nk-sidebar{
        &-main{
            max-width:calc(100vw - #{$sidebar-bar-width} - 20px)
        }
        &-profile{
            &-dropdown{
                max-width: calc(100vw - #{$sidebar-bar-width} - 10px);
                min-width: calc(100vw - #{$sidebar-bar-width} - 10px);
            }
        }
    }
}
 
/////////////////////////
// Apps Style 
/////////////////////////

.nk-apps{
    &-brand{
        .logo-link{
            position: relative;
            padding: 1.25rem 1.5rem 1.25rem;
        }
        .logo-img:not(:first-child){
            left: 1.5rem;
        }
        &.has-dropdown{
            .logo-link{
                &:after{
                    position: absolute;
                    bottom: 0;
                    left: 50%;
                    transform: translateX(-50%);
                    content: $ni-chevron-down;
                    font-family: $nk-dashlite-font;
                    color: $base-light;
                    font-size: 1.25rem;
                }
            }
        }
        &:hover{
            .nk-apps-dropdown{
                opacity: 1;
                transform: translateX(0);
                visibility:visible;
            }
        }
    }
    &-dropdown{
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 0 0 $border-radius 0;
        transform: translateX(-25px);
        width: 280px;
        background: $white;
        box-shadow: $box-shadow-sm;
        z-index: 1109;
        opacity: 0;
        visibility: hidden;
        transition: all .3s;
        &-list{
            li{
                &:not(:last-child){
                    border-bottom: 1px solid $border-light;
                }
            }
        }
        &-item{
            display: flex;
            align-items: center;
            padding: 1.25rem 1.5rem;
        }
        &-icon{
            flex-shrink: 0;
            width: 36px;
            + .nk-apps-dropdown-text{
                margin-left: 1rem;
            }
        }
    }
}

.nk-sidebar-short{
    overflow: hidden;
    width: $sidebar-width-short;
    box-shadow: 1px 0px 6px 0px rgba($base-color, 0.08);
    flex-direction: column;
    &.nk-sidebar-mobile{
        .nk-sidebar{
            &-logo{
                opacity: 1;
            }
            &-menu-middle{
                margin-top: 0;
            }
        }
    }
    .nk-sidebar{
        &-logo{
            opacity: 0;
            &-small{
                display: none;
            }
        }
        &-menu-middle{
            margin-top: auto;
        }
        &-footer{
            padding: 1rem 0;
        }
    }
    .nk-menu-trigger{
        display: none;
    }
}
@include media-breakpoint-up(md){
    .nk-sidebar-short{
        &.nk-sidebar-mobile{
            width: $sidebar-width-short - 1 !important;
        }
        transform: none;
        + .nk-wrap{
            padding-left: $sidebar-width-short;
        }
        .nk-sidebar{
            &-head{
                width: $sidebar-width-short - 1;
                border-bottom:none;
            }
            &-logo{
                display: none;
                &-small{
                    display: block;
                }
            }
        }
    }
}