// 
// _horizontal.scss
// 


body[data-layout="horizontal"] {

    .navbar-brand-box {
        width: auto;
    }

    .page-content {
        margin-top: $header-height;
        padding: 0 $grid-gutter-width $footer-height $grid-gutter-width;
    }   

    .page-title-box{
        padding-bottom: 0;
    }

    #page-topbar { 
        background-color: $white;
    }

}

.topnav {
    padding: 0 calc(#{$grid-gutter-width} / 2);

    @media (max-width: 991.98px) {
        position: fixed;
        left: 0;
        right: 0;
        top: $header-height;
        z-index: 100;
        background: $topnav-bg;
        box-shadow: $box-shadow;
    }
    
    
    .topnav-menu {
        margin: 0;
        padding: 0;
    }

    .navbar-nav {
        
        .nav-link {
            font-size: 14px;
            position: relative;
            color: $sidebar-menu-item-color;
            line-height: 70px;
            i{
                font-size: 15px;
            }
            &:focus, &:hover{
                color: $sidebar-menu-item-active-color;
                background-color: transparent;
            }
        }
        
        .dropdown-item{
            color: $sidebar-menu-item-color;
            &.active, &:hover{
                color: $sidebar-menu-item-active-color;
                background-color: transparent;
            }
        }
        
        .nav-item{
            .nav-link.active{
                color: $sidebar-menu-item-active-color;
            }
        }

        .dropdown{
            &.active{
              >a {
                    color: $sidebar-menu-item-active-color;
                    background-color: transparent;
                }
            }

        }

    }
}

@include media-breakpoint-up(xl) {

    body[data-layout="horizontal"] {
        .container-fluid,
        .navbar-header {
            max-width: 90%;
        }
    }

    .topnav {
    
        .navbar-nav {
            
            .nav-link {
                padding: 0 1.1rem;
            }
        
        }
    }
}

@media (min-width: 992px) {



    .topnav {

        .dropdown-item {
            padding: .5rem 1.5rem;
            min-width: 180px;
        }

        .dropdown {
            &.mega-dropdown{
                .mega-dropdown-menu{
                    left: 0px;
                    right: auto;
                }
            }
            .dropdown-menu {
                margin-top: 0;
                border-radius: 0 0 $dropdown-border-radius $dropdown-border-radius;

                .arrow-down {
                    &::after {
                        right: 15px;
                        transform: rotate(-135deg) translateY(-50%);
                        position: absolute;
                    }
                }

                .dropdown {
                    .dropdown-menu {
                        position: absolute;
                        top: 0 !important;
                        left: 100%;
                        display: none
                    }
                }
            }

            &:hover {
                >.dropdown-menu {
                    display: block;
                }
            }
        }

        .dropdown:hover>.dropdown-menu>.dropdown:hover>.dropdown-menu {
            display: block
        }
    }

    .navbar-toggle {
        display: none;
    }
}

.arrow-down {
    display: inline-block;

    &:after {
        border-color: initial;
        border-style: solid;
        border-width: 0 0 1px 1px;
        content: "";
        height: .4em;
        display: inline-block;
        right: 5px;
        top: 50%;
        margin-left: 7px;
        transform: rotate(-45deg) translateY(-50%);
        transform-origin: top;
        transition: all .3s ease-out;
        width: .4em;
    }
}


@media (max-width: 1199.98px) {
    .topnav-menu {
        .navbar-nav {
            li {
                &:last-of-type {
                    .dropdown {
                        .dropdown-menu {
                            right: 100%;
                            left: auto;
                        }
                    }
                }
            }
        }
    }
}

@media (max-width: 991.98px) {
    
    .topnav {
        max-height: 360px;
        overflow-y: auto;
        padding: 0;
        .navbar-nav {
            .nav-link {
                padding: 0.75rem 1.1rem;
                line-height: inherit;
            }
        }

        .dropdown {
            .dropdown-menu {
                background-color: transparent;
                border: none;
                box-shadow: none;
                padding-left: 15px;
            }

            .dropdown-mega-menu-xl,
                .dropdown-mega-menu-lg{
                width: auto;

                .row{
                    margin: 0px;
                }
            }

            .dropdown-item {
                position: relative;
                background-color: transparent;

                &.active,
                &:active {
                    color: $primary;
                }
            }
        }

        .arrow-down {
            &::after {
                right: 15px;
                position: absolute;
            }
        }
    }
}


@media (min-width: 992px) {

    body[data-layout="horizontal"][data-topbar="light"] {
        .topnav{
            background-color: $primary;
            .navbar-nav {
        
                .nav-link {
                    color: rgba($white, 0.5);
                    
                    &:focus, &:hover{
                        color: rgba($white, 0.9);
                    }
                }
        
                > .dropdown{
                    &.active{
                    >a {
                            color: rgba($white, 0.9) !important;
                        }
                    }
                }
            }
        }
    }
}

// Colored Topbar 

body[data-layout="horizontal"][data-topbar="colored"],
body[data-layout="horizontal"][data-topbar="dark"] {
    #page-topbar{
        background-color: $primary;
        box-shadow: none;
    }

    .logo-dark {
        display: none;
    }

    .logo-light {
        display: block;
    }

    .app-search {
    
        .form-control {
            background-color: rgba($topbar-search-bg,0.07);
            color: $white;
        }
        span,
        input.form-control::-webkit-input-placeholder {
            color: rgba($white,0.5);
        }
    }
    .header-item {
        color: $header-dark-item-color;
    
        &:hover {
            color: $header-dark-item-color;
        }
    }

    .navbar-header {
        .dropdown.show {
            .header-item{
                background-color: rgba($white,0.1);
            }
        }

        .waves-effect .waves-ripple {
            background: rgba($white, 0.4);
        }
    }

    .noti-icon {
        i {
            color: $header-dark-item-color;
        }
    }

    @media (min-width: 992px) {
        .topnav{
            .navbar-nav {
        
                .nav-link {
                    color: rgba($white, 0.5);
                    
                    &:focus, &:hover{
                        color: rgba($white, 0.9);
                    }
                }
        
                > .dropdown{
                    &.active{
                      >a {
                            color: rgba($white, 0.9) !important;
                        }
                    }
                }
            }
        }
    }
}

body[data-layout="horizontal"][data-topbar="dark"]  {
    #page-topbar { 
        background-color: $header-dark-bg;
    }
}



// light Topbar 

body[data-layout="horizontal"] {

    .logo-light {
        display: $display-none;
    }

    .logo-dark {
        display: $display-block;
    }  
}

