.sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  width: 40rem;
  padding: 0;
  border-right: 1px solid $border-color-default;
  word-wrap: break-word;

  .dashboard & {
    border-right-width: 1px;
    padding: 4rem 0 0 3rem;
    width: 22rem;
  }

  .admin-dashboard & {
    border-right-width: 1px;
    padding: 2rem 0 0 3rem;
    width: 22rem;
  }

  .dashboard-filter & {
    border-right: 1px solid $border-color-default;
    padding: 2rem;
    width: 25rem;
  }

  .row {
    margin: 0 -1rem;
  }

  .content {
    padding: 1rem 1.5rem;
  }

  hr {
    margin: .5rem 0;
  }

  .btn ~ nav {
    margin: 2rem 0;
  }

  .sub-category {
    padding-left: 2em;
  }
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  height: 48px;
  background: $off-white;
  border-bottom: 1px solid $gray-lightest;

  & > * {
    margin-top: 0;
    margin-bottom: 0;
  }

  .header-controls {
    flex: 1;
    text-align: right;
    font-size: 1.2rem;
  }
}

.btn.sidebar-header-nav-btn {
  padding: 4px 1px;
  background: none;
  color: $shade-normal;
  font-size: 2rem;
  border: 1px solid $shade-normal;
  margin-right: 5px;

  &:hover,
  &:focus {
    background: none;
    color: $shade-normal;
    border: 1px solid $shade-normal;
  }
}

.sidebar-static {
  flex: none;
  position: relative;
  border-bottom: 2px solid $border-color-default;
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  &:first-child {
    border-bottom: 2px solid $border-color-default;
  }

  &:last-child {
    border-top: 2px solid $border-color-default;
    border-bottom: none;
  }

  > div {
    width: 100%;
  }

  p {
    line-height: 1.3;
  }

  .sidebar-actions {
    margin-left: auto;

    > * {
      display: inline-block;
    }

    .btn {
      margin-bottom: 0;
    }

    button, a {
      margin-left: 5px;
    }
  }
}

.sidebar-actions-group {
  display: flex;
  justify-content: space-between;
  align-items: center;

  label,
  .label {
    margin: 6px 0;
  }
}

.sidebar-scrollable {
  overflow: auto;
  flex: 1;
}

.sidebar-category {
  * {
    margin: 0.2em;
  }
}

.sidebar-category-title {
  font-weight: 700;
}

.sidebar-selection {
  cursor: pointer;
  &:hover {
    color: $brand-primary;
  }
}

.sidebar-category-actions {
  * {
    color: $brand-primary;
    &:hover {
      color: $shade-light;
    }
  }
}

.sidebar-separator {
  height: 1em;
  border-bottom: 1px solid $border-color-default;
}

.sidebar-extended {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
}

.map-filters,
.sidebar-dark {
  left: 40rem;
  margin-left: -2px;
  background: $shade-normal;
  border: none;
  z-index: 1001;

  .sidebar-header {
    background: $shade-dark;
    border-bottom: 1px solid $shade-normal;
  }

  .btn.sidebar-header-nav-btn {
    color: $white;
    border-color: $white;

    &:hover,
    &:focus {
      background: none;
      color: $white;
      border-color: $white;
    }
  }

  h5, .h5,
  p {
    color: #fff;
  }
}

.hidden {
  display: none;
  &.active {
    display: block;
  }
}

rf-scene-filter-pane {
  display: flex;
  flex-flow: column;
  height: 100%; // firefox overflowing fix
}

// Mini sidebar seen on project edit
.sidebar.mini {
  width: 6rem;
  background: $shade-dark;
  border-right: 1px solid $shade-dark;

  .list-group-item {
    border-color: $shade-normal;
    color: #fff;

    &:hover, &:focus {
      outline: none;
      background-color: $shade-normal;
      transition: .2s ease-in-out background-color;
    }

    &:after, &:before {
      content: '';
      opacity: 0;
      transition: opacity .2s ease-in-out;
      pointer-events: none;
      z-index: 10;
    }

    // Shows the title of the item
    &:hover:after,
    &:focus:after {
      content: attr(data-title);
      display: block;
      z-index: 240;
      background: $shade-dark;
      padding: .5rem 1rem;
      border-radius: 2px;
      font-size: 12px;
      position: absolute;
      left: 110%;
      white-space: nowrap;
      opacity: 1;
    }
    &:hover:before,
    &:focus:before {
      content: '';
      display: block;
      border: 4px solid transparent;
      border-right-color: $shade-dark;
      position: absolute;
      left: 110%;
      margin-left: -8px;
      opacity: 1;
    }
  }

  a.active {
    background-color: $brand-primary;

    &:hover, &:focus {
      background-color: $brand-primary;
    }

    /* prevent title from persisting
    after clicking tab */
    &:focus:before,
    &:focus:after {
      display: none;
    }
  }
}

.sidebar-settings {
  width: 28rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list-item-header {
  font-size: 1.6rem;
  font-weight: 700;
}

.sidebar-list-item
{
  font-size: 1.3rem;
  display: flex;
  white-space: nowrap;
  align-items: center;
  .content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.sidebar-list-item a {
  text-decoration: none;
  color: inherit;
  &:hover {
    color: $brand-primary;
    text-decoration: none;
  }
}

.dashboard .sidebar {
  padding: 2rem 0;
}
