$sidebar-background: #01194e;
$sidebar-text-color: #fff;
$sidebar-width: 220px;
$sidebar-menu-item-color: #cbd1dd;
$sidebar-popover-submenu-bg: rgb(1, 20, 62);

.sidebar {
  background: $sidebar-background;
  width: $sidebar-width;
  color: $sidebar-text-color;
  position: fixed;
  height: 100%;
  z-index: $sidebar-zindex;

  .ScrollbarsCustom-Track {
    &.ScrollbarsCustom-TrackY,
    &.ScrollbarsCustom-TrackX{
      background: rgba(0, 0, 0, 0);
    }
  }
  .ScrollbarsCustom-Thumb{
    &.ScrollbarsCustom-ThumbX,
    &.ScrollbarsCustom-ThumbY {
      background: rgba(0, 0, 0, 0);
    }      
  }

  &:hover {
    .ScrollbarsCustom-Thumb{
      &.ScrollbarsCustom-ThumbX,
      &.ScrollbarsCustom-ThumbY {
        background: rgba(255, 255, 255, 0.25);
      }      
    }
  }
  &__head{
    padding: 16px 12px;
   
    &-logo{
      margin-top: 4px;

      svg{
        opacity: 0.45;
      }
    }
  }

  &__scroll-wrapper{
    height: 100%;
  }

  &-menu {
    background: transparent;
    padding: 0;
    min-width: $sidebar-width;
    border-radius: 0;
    padding-bottom: 2rem;

    .#{$ns}-menu-item {
      color: $sidebar-menu-item-color;
      border-radius: 0;
      padding: 10px 16px;
      font-size: 15px;
      font-weight: 400;

      &:hover,
      &.bp3-active {
        background: #012470;
        color: $sidebar-menu-item-color;
      }
      &:focus,
      &:active {
        background: #01143e;
      }

      > .#{$ns}-icon {
        color: #767b9b;
        margin-right: 16px;
        margin-top: 0;
      }
      > .#{$ns}-icon-caret-right {
        margin-right: -4px;
        margin-top: 3px;
        color: #42547b;
      }
    }

    .#{$ns}-submenu {
      .#{$ns}-collapse {
        border-left: 2px solid rgba(255, 255, 255, 0.15);

        &-body {
          background-color: rgb(11, 34, 85);
          padding-bottom: 6px;
          padding-top: 6px;
        }

        .#{$ns}-menu-item {
          padding: 7px 16px 7px 18px;
          font-size: 15px;
          color: #8a95b6;

          &:hover,
          &.bp3-active {
            background: transparent;
            color: #c5cbe3;
          }
        }
      }
      .#{$ns}-popover {
        padding: 0;

        &-content {
          box-shadow: 0 0 0;
        }
      }
    }
    .#{$ns}-popover-target.#{$ns}-popover-open .#{$ns}-menu-item {
      color: $sidebar-menu-item-color;
    }
    .#{$ns}-menu-divider {
      border-top-color: #152a55;
      color: #6b708c;
      margin: 4px 0;
    }
    .#{$ns}-menu-spacer{
      margin: 4px 0;
      height: 1px;
    }

  }

  &--mini-sidebar{
    white-space: nowrap;
    width: 50px;


    // Hide text of bigcapital logo.
    .sidebar__head-logo{

      .bp3-icon-bigcapital{
        path:not(.path-1):not(.path-2) {
          opacity: 0;
        }
      }
    }

    // Hide text of menu items and right caret icon.
    .bp3-collapse,
    .bp3-icon-caret-right,
    .bp3-menu-item .bp3-text-overflow-ellipsis{
      display: none;
    }

    .sidebar__menu{

      .bp3-menu{
        > li:not(.bp3-submenu):not(.bp3-menu-divider):not(.has-icon){

          .bp3-menu-item{
            &:before{
              content: "";
              height: 18px;
              width: 18px;
              background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' data-icon='ellipsis-h' width='18' height='18' fill='%235c7080' viewBox='0 0 512 512'%3E%3Cdesc%3Eellipsis-h%3C/desc%3E%3Cpath d='M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z' class='path-1' fill-rule='evenodd'%3E%3C/path%3E%3C/svg%3E");
            }
          }
        }
      }
    }

    .sidebar__scroll-wrapper{
      background: $sidebar-background;
      transition: min-width 0.15s ease-in-out;
      min-width: 50px;

      &:hover{
        min-width: $sidebar-width;

        .sidebar__head-logo{

          .bp3-icon-bigcapital{
            path:not(.path-1):not(.path-2) {
              opacity: 1;
            }
          }
        }

        .bp3-collapse,
        .bp3-icon-caret-right,
        .bp3-menu-item .bp3-text-overflow-ellipsis{
          display: block;
        }
        .sidebar__menu .bp3-menu > li:not(.bp3-submenu):not(.bp3-menu-divider) .bp3-menu-item{
          
          &:before{
            display: none;
          }
        }
      }      
    }
  }
}
