// Navbar 
// ---------------
.sidebar,
#sidebar {
  &.span2 {
    width: 0;
  }

  &.span2 + .span10 {
    width: 100%; 
    margin-left: 0;
  }

  .sidebar-title {
    padding: @global-padding @gridGutterWidth;
    text-transform: uppercase;
    color: @white;
    background-color: rgba(0, 0, 0, 0.2);
    height: @global-padding*2 + @fontSizeLarge;

    span {
      display: block;
      overflow: hidden;
      width: calc(~"100% - 14px");
      float: left;
      .transition(width 350ms);
      .text-overflow();
    }

    .fa {
      float: right;
      font-size: @fontSizeLarge;
      cursor: pointer;
    }
  }

  &.sidebar-close {
    .sidebar-title span {
      width: 0;
    }

    #menu,
    #vm-menu,
    #ja-builder-menu {
      > li > a {
        position: relative;
        width: 100%; 
        text-indent: (@gridGutterWidth*2 + @fontSizeLarge);
        overflow: hidden;
        .transition(text-indent 350ms);

        &::before {
          position: absolute;
          left: 13px;
          top: auto;
          text-indent: 0;
        }

        &.dropdown-toggle {
          .caret {
            right: -2px;
            .rotate(-45deg); 
          }
        }
      }

      > li > .dropdown-menu {
        display: none;
      }
    }
  }

  #menu,
  #vm-menu,
  #ja-builder-menu {
    & > li {
      .icon:before {
        content: "";
        display: inline-block;
        font-family: "FontAwesome";
        font-size: 16px;
        height: 24px;
        line-height: 20px;
        margin-right: 5px;
        vertical-align: middle;
        text-align: left;
        width: 24px;
      }

      .site:before {
        content: "\f0e4"; 
      }

      .systems:before {
        content: "\f013";
      }

      .users:before {
        content: "\f0c0";
      }

      .menus:before {
        content: "\f0c9";
      }

      .help:before {
        content: "\f1cd";
      }

      .extensions:before {
        content: "\f0c9";
      }

      .content:before {
        content: "\f0f6";
      }

      .components:before {
        content: "\f085";
      }

      .extensions:before {
        content: "\f1e6";
      }

      .shop:before {
        content: "\f07a";
      }

      i.fa {
        margin-right: 10px;
      }

    }

    .dropdown-menu {
      > li > a {
        padding: 12px @gridGutterWidth;
        color: rgba(255, 255, 255, 0.5);

        &:hover, &:focus, &:active {
          background: rgba(0,0,0,0.2);
          color: @white;
        }
      }

      > .dropdown-submenu:hover > a,
      > .dropdown-submenu:focus > a,
      > .dropdown-submenu:active > a {
        background: rgba(0,0,0,0.2);
      }

      > .dropdown-submenu > a::after {
        margin: 0;
        position: absolute;
        right: @gridGutterWidth;
        top: @gridGutterWidth;
      }
    }

    > li > a {
      border-bottom: 1px solid #2f2f2f;
      color: rgba(255, 255, 255, 0.5);
      font-size: 16px;
      padding: 13px @gridGutterWidth;

      &:hover, &:focus, &:active {
        color: #a4a4a4;
      }

      .caret {
        border-top-color: #666;
        border-bottom-color: #666;
        position: absolute;
        right: @gridGutterWidth;
        margin-top: @global-margin / 2;
        .transition(transfrom 350ms);
      }

      + .dropdown-menu {
        background-color: rgba(0, 0, 0, 0.5);
        position: relative;
        float: none;
        border: 0;
        margin: 0;
        padding: 0 0 0 @global-padding;
        z-index: 1;
        border-radius: 0;
        .box-shadow(none);

        .divider {
          display: none;
        }

        > li > a {
          padding: 12px @gridGutterWidth;
          color: rgba(255, 255, 255, 0.01);

          &:hover, &:focus, &:active {
            color: @white;
          }
        }

        > li.open > a {
          color: @white;
        }

        .dropdown-submenu {
          .dropdown-menu {
            float: none;
            border: 0;
            margin: 0;
            padding: 0;
            z-index: 1;
            border-radius: 0;
            .box-shadow(none);
          }

          > a::after {
            border-width: 4px 0 4px 4px;
          }
        }

        .dropdown-submenu:hover {
          .dropdown-menu {
           display: block;
           background: #222;
          }

          > a {
            color: @white;
          }
        }
      }
    }

    > li.open > a {
      .caret {
        .rotate(0);
      }
    }
  }

  #ja-builder-menu {
    float: left;
    margin: 0;
    padding: 0;

    & > li > a {
      border-bottom: 0;
      line-height: 22px;
    }

    & > li > a .caret {
      position: relative;
      right: auto;
      margin-left: 5px;
    }
  }

  .mCSB_scrollTools {
    z-index: 1;
  }

  // Sideder Nav
  .sidebar-nav {
    position: absolute;
    top: 20px;
    left: 240px;
    right: 0;
    background-color: @grayDarker;
    .transition(left 350ms);

    .nav-list {
      padding: @global-padding @gridGutterWidth;

      > li {
        display: inline-block;

        a {
          margin-right: 0;
          margin-left: 0;
          padding-top: 0;
          padding-bottom: 0;
          padding-left: 0;
          text-shadow: none;

          &:hover, &:focus, &:active {
            color: @white;
            background-color: transparent;
          }
        }

        &.active a {
          margin-right: 0;
          color: @white;
          background-color: transparent;
        }
      }
    }

    @media (max-width: @screen-sm-max) {
      left: 230px;
    } 
  }
}

/* Style Responsive for Horizontal Menu */
@media (max-width: @screen-md-max) {
  .navbar-horizontal {
    .admin-container-fluid > .sidebar {
      float: left;
      min-height: calc(~"100% - 81px");
      left: 0;
      position: fixed;
      top: 50px;
      width: 220px;
      z-index: 1000;
      .transition(none);

      .sidebar-title {
        display: block;

        span {
          width: calc(~"100% - 14px");
        }
      }

      #menu {
        display: block;
        float: none;

        li {
          display: block;
        }

        > li > a {
          border-bottom: 1px solid #2f2f2f;
          display: block;
          padding: 13px @gridGutterWidth;

          .caret {
            position: absolute;
            right: @gridGutterWidth;
          }
        }

        > li > a + .dropdown-menu {
          width: 100%;
        }
      }
    }

    .admin-container-fluid > .sidebar-close {
      width: @gridGutterWidth*2 + @fontSizeLarge;

      .sidebar-title span {
        width: 0;
      }

      #menu {
        > li > a {
          position: relative;
          width: 100%;
          overflow: hidden;
          .transition(text-indent 350ms);

          &::before {
            position: absolute;
            left: 13px;
            top: auto;
            text-indent: 0;
          }

          &.dropdown-toggle {
            .caret {
              right: -2px;
              .rotate(-45deg);
            }
          }
        }
      }
    }

    .admin-container-fluid > .main-content {
      padding-left: 220px; 
    }

    .admin-container-fluid > .sidebar-close + .main-content {
      padding-left: 56.25px;
    }
  }
}

@media (max-width: @screen-sm-max) {
  .navbar-horizontal {
    .admin-container-fluid > .sidebar {
      min-height: calc(~"100% - 50px");
      .transition(none);
    }
  }
}

// Fix sidebar in Global Configuration
// .com_config #sidebar .sidebar-nav {
//   display: none;
// }

#j-sidebar-container + #j-main-container {
  width: 100%;
  margin-left: 0;
  padding-left: 0;
}

// Tabs
// ---------------------------------------
#myTabTabs {
  & > li {
    & > a {
      border-radius: 0;
    }

    &.active > a {
    }
  } 
}


// Tabs
// ---------------------------------------
#content {
  .sidebar-nav {
    background-color: transparent;
    padding-right: @global-padding;
    top: 80px;

    #submenu {
      border-bottom: 2px solid @blue;
      margin: 0;
      padding: 0;

      & > li {
        & > a {
          background-color: darken(@grayLighter, 5%);
          color: @grayDarker;
          display: inline-block;
          padding: (@global-padding / 2) @global-padding;

          &:hover, &:focus, &:active {
            background-color: lighten(@grayLight, 10%);
            color: @white;
          }
        }

        &.active {
          & > a {
            background-color: @blue;
            color: @white;
          }
        }
      }
    }
  }
}

.has-j-sidebar.navbar-horizontal #j-sidebar-container .sidebar-nav {
  padding-left: @global-padding;
}


.navbar-vertical {
  .sidebar.sidebar-close {
    #menu > li > a {
      text-indent: 0;
    }

    .menu-title {
      display: none;
    }
  }
}

// Fix for K2 component
.com_k2.navbar-horizontal {
  #sidebar {
    .sidebar-nav {
      position: relative;
      top: auto;
      padding-right: 0;
      left: 0;
      margin-bottom: 20px;
    }
  }
}

.navbar-horizontal {
  .jcomponent #sidebar {
    background-color: transparent;
    .sidebar-nav {
      position: relative;
      left: auto;
      width: 100%;
    }
  }
}