/*=========================================================================================
    File Name: vertical-menu.scss
    Description: A calssic vertical style menu with expand and collops support. It support
    light & dark version, filpped layout, right side icons, native scroll and borders menu
    item seperation.
    ----------------------------------------------------------------------------------------
    Item Name: Robust - Responsive Admin Theme
    Version: 1.2
    Author: PIXINVENT
    Author URL: http://www.themeforest.net/user/pixinvent
==========================================================================================*/

// Core variables and mixins
@import "../../../bootstrap/variables";
@import "../../../bootstrap/mixins";
@import "../../../bootstrap-extended/mixins";

// Core variables and mixins overrides
@import "../../variables/variables";
@import "../../variables/app-variables";

// Overrides user variable
@import "../../../../../assets/scss/variables/variables";
@import "../../../../../assets/scss/variables/app-variables";

// Import first main menu mixin
@import "../../mixins/main-menu-mixin";

//  Vertical menu
//=========================
body.vertical-layout{
    &.vertical-menu {
        // Flipped menu expanded
        &.menu-flipped {
            @include media-breakpoint-up(sm) {
                .main-menu {
                    right: 0;
                }
            }
        }
        //Vertical menu [Expanded]
        &.menu-expanded {
            //Navbar expanded
            .navbar {
                .navbar-header {
                    @include menu-navbar-width($menu-expanded-width);
                }
                &.navbar-brand-center {
                    .navbar-header {
                        @include menu-navbar-width(auto);
                    }
                }
                .navbar-container {
                    @include main-menu-width($menu-expanded-width);
                }
            }
            // Main menu expanded
            .main-menu {
                width: $menu-expanded-width;
                transition: 300ms ease all;
                backface-visibility: hidden;
                .navigation {
                    .navigation-header {
                        .icon-ellipsis {
                            display: none;
                        }
                    }
                    > li {
                        > a {
                            > i {
                                margin-right: 12px;
                                float:left;
                                &:before {                                    
                                    font-size: 1.2rem;                                    
                                }
                            }
                            >span{
                                display: inline-block;
                                &.tag{
                                    position:absolute;
                                    right: 20px;
                                }
                            }
                        }
                    }
                    li {
                        @include vertical-menu-has-sub-arrow(1rem);
                    }
                }
                .main-menu-footer {
                    width: $menu-expanded-width;
                }
            }
            //Content expanded
            .content,
            .footer {
                @include main-menu-width($menu-expanded-width);
            }
            //Brand center content expanded
            .navbar-brand-center {
                .content,
                .footer {
                    @include main-menu-width(0);
                }
            }
        }
        //Vertical menu [Collapsed]
        &.menu-collapsed {
            //Navbar collapsed
            .navbar {
                .navbar-header {
                    @include menu-navbar-width($menu-collapsed-width);
                }
                &.navbar-brand-center {
                    .navbar-header {
                        @include menu-navbar-width(auto);
                    }
                }
                .navbar-brand{
                    padding: 15px 0px;
                }
                .navbar-container {
                    @include main-menu-width($menu-collapsed-width);
                }
            }
            // Main menu collapsed
            .main-menu {
                width: $menu-collapsed-width;
                transform: translateZ(-160px) translateX(-160px);
                transform: translate3d(0, 0, 0);
                transition: 300ms ease all;
                .main-menu-footer {
                    width: $menu-collapsed-width;
                }
                .main-menu-footer,
                .main-menu-header .media-body .media-heading,
                .main-menu-header .media-body .text-muted,
                .main-menu-header .media-right {
                    display: none;
                }
                .main-menu-header .media-body {
                    opacity: 0;
                }
                .user-content {
                    padding: 20px 10px;
                }
                @include menu-content($menu-expanded-width, $menu-collapsed-width, $menu-light-color, $menu-light-bg);
                //Navigation collapsed
                .navigation {
                    overflow: visible;
                    > li.navigation-header {
                         padding: 30px 20px 8px 20px;
                        .icon-ellipsis {
                            display: block;
                            padding: 12px 0px;
                            text-align: center;
                            font-size: 1.6rem;                            
                        }
                        span {
                            display: none;
                        }
                    }
                    > li {
                        >a {
                            padding: 8px 20px;
                            text-align: center;
                            > span {
                                visibility: hidden;
                                opacity: 0;
                                position: absolute;
                                top: 0;
                                right: -($menu-expanded-width);
                                width: $menu-expanded-width;
                                font-weight: 600;
                                color: #fff;
                                text-transform: uppercase;
                                text-align: left;
                                background-color: $brand-primary;
                                border-color: $brand-primary;
                                padding: 11px 20px;
                            }
                            > i {
                                margin-right: 0;
                                font-size: 1.2rem;
                                line-height: 1;
                                visibility: visible;
                                opacity: 1;
                            }
                        }
                        //hide inner span and ul for the collapsed menu 
                        // &.hover{
                        & > ul {
                            display: none;
                        }
                        > a {
                            > span {
                                display: none;
                            }
                        }
                        // }
                    }
                }
                .mTSWrapper {
                    overflow: visible;
                }
            }
            //Brand center content collapsed
            .content,
            .footer {
                @include main-menu-width($menu-collapsed-width);
            }
            .navbar-brand-center {
                .content,
                .footer {
                    @include main-menu-width(0);
                }
            }
            // Flipped menu collapsed
            &.menu-flipped {
                //Content collapsed flipped
                .content {
                    @include vertical-flipped-menu($menu-collapsed-width);
                }
                @include media-breakpoint-up(sm) {
                    .main-menu {
                        right: 0;
                        span.menu-title {
                            right: $menu-collapsed-width;
                        }
                        ul.menu-content {
                            right: $menu-collapsed-width;
                            left: inherit;
                        }
                    }
                }
                //Navbar collapsed flipped
                .navbar {
                    .navbar-header {
                        float: right;
                    }
                    .navbar-container {
                        @include vertical-flipped-menu($menu-collapsed-width);
                    }
                }
                .footer{
                    @include vertical-flipped-menu($menu-collapsed-width);
                }
            }
        }
    }
}
// Collapsed menu RTL
[data-textdirection="rtl"] body.vertical-layout{
    &.vertical-menu.menu-collapsed{
        .main-menu{
            .navigation{
                > li > a{
                    padding: 12px 22px !important;
                }  
                > li.navigation-header .icon-ellipsis {
                    padding: 12px 0px;
                }
            }
        }
    }
}

// Initially menu & content width for lg and up screen
@include media-breakpoint-up(lg) {
    body.vertical-layout {
        &.vertical-menu {
            .main-menu {
                width: $menu-expanded-width;
                .main-menu-footer {
                    width: $menu-expanded-width;
                }
            }
            .navbar {
                .navbar-header {
                    width: $menu-expanded-width;
                }
            }
            .content,
            .footer {
                @include main-menu-width($menu-expanded-width);
            }
            &.menu-flipped {
                //Content expanded flipped
                .content {
                    @include vertical-flipped-menu($menu-expanded-width);
                }
                //Navbar expanded flipped
                .navbar {
                    .navbar-header {
                        float: right;
                    }
                    .navbar-container {
                        @include vertical-flipped-menu($menu-expanded-width);
                    }
                }
                .footer{
                    @include vertical-flipped-menu($menu-expanded-width);
                }
            }
        }
    }
}

// Initially menu & content width for md and down screen
@include media-breakpoint-down(md) {
    body.vertical-layout {
        &.vertical-menu {
            .main-menu {
                width: $menu-collapsed-width;
                .main-menu-footer {
                    width: $menu-expanded-width;
                }
            }
            .navbar {
                .navbar-header {
                    width: $menu-collapsed-width;
                }
            }
            .content,
            .footer {
                @include main-menu-width($menu-collapsed-width);
            }
        }
    }
}

// Initially menu & content width for sm and down screen
@include media-breakpoint-down(sm) {
    body.vertical-layout {
        &.vertical-menu {
            .content,
            .footer {
                @include main-menu-width(0);
            }
        }
    }
}