.page-with-sidebar {
  padding-top: $header-height;
  padding-bottom: 25px;
  transition: padding $sidebar-transition-duration;

  .sidebar-wrapper {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
    transition: width $sidebar-transition-duration;
  }
}

.sidebar-wrapper {
  z-index: 1000;
  background: $background-color;

  .nicescroll-rails-hr {
    // TODO: Figure out why nicescroll doesn't hide horizontal bar
    display: none!important;
  }
}

.content-wrapper {
  width: 100%;
  transition: padding $sidebar-transition-duration;

  .container-fluid {
    background: #fff;
    padding: 0 $gl-padding;

    &.container-blank {
      background: none;
      padding: 0;
      border: none;
    }
  }
}

.nav-sidebar {
  position: absolute;
  top: 50px;
  bottom: 0;
  width: $sidebar_width;
  overflow-y: auto;
  overflow-x: hidden;

  @media (min-width: $sidebar-breakpoint) {
    bottom: 50px;
  }

  &.navbar-collapse {
    padding: 0 !important;
  }

  li {
    &.separate-item {
      padding-top: 10px;
      margin-top: 10px;
    }

    .icon-container {
      width: 34px;
      display: inline-block;
      text-align: center;
    }

    a {
      padding: 7px 15px 7px 12px;
      font-size: $gl-font-size;
      line-height: 24px;
      display: block;
      text-decoration: none;
      font-weight: normal;
      outline: none;

      &:hover,
      &:active,
      &:focus {
        text-decoration: none;
      }

      i {
        font-size: 16px;
      }

      i,
      svg {
        margin-right: 13px;
      }
    }
  }

  .count {
    float: right;
    padding: 0 8px;
    @include border-radius(6px);
  }
}

.toggle-nav-collapse {
  width: $sidebar_width;
  position: absolute;
  top: 0;
  left: 0;
  min-height: 50px;
  padding: 5px 0;
  font-size: 18px;
  line-height: 30px;
}

.nav-header-btn {
  padding: 10px 5px;
  color: inherit;
  transition-duration: .3s;

  &:hover,
  &:focus {
    color: $white-light;
    text-decoration: none;
  }
}

.pin-nav-btn {
  display: none;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 50px;
  width: $sidebar_width;
  line-height: 30px;

  @media (min-width: $sidebar-breakpoint) {
    display: block;
  }

  .fa {
    transition: transform .15s;
  }

  &.is-active {
    .fa {
      transform: rotate(90deg);
    }
  }
}

.page-sidebar-collapsed {
  padding-left: 0;

  .sidebar-wrapper {
    width: 0;
  }
}

.page-sidebar-expanded {
  .sidebar-wrapper {
    width: $sidebar_width;
  }
}

.page-sidebar-pinned {
  .content-wrapper,
  .layout-nav {
    @media (min-width: $sidebar-breakpoint) {
      padding-left: $sidebar_width;
    }
  }
}

header.header-pinned-nav {
  @media (min-width: $sidebar-breakpoint) {
    padding-left: ($sidebar_width + $gl-padding);

    .side-nav-toggle {
      display: none;
    }

    .header-content {
      padding-left: 0;
    }
  }
}

.right-sidebar-collapsed {
  padding-right: 0;

  @media (min-width: $screen-sm-min) {
    padding-right: $sidebar_collapsed_width;
  }

  .sidebar-collapsed-icon {
    cursor: pointer;
  }
}

.right-sidebar-expanded {
  padding-right: 0;

  @media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
    &:not(.build-sidebar) {
      padding-right: $sidebar_collapsed_width;
    }
  }

  @media (min-width: $screen-md-min) {
    padding-right: $gutter_width;
  }

  &.with-overlay {
    padding-right: $sidebar_collapsed_width;
  }
}
