// ----------------------------------------------
// SideBar Style
// ----------------------------------------------
.left-sidebar {
  width: $sidebar-width-full;
  border-right: 1px solid var(--bs-border-color);
  flex-shrink: 0;
  background: var(--bs-body-bg);
  z-index: 99;
  transition: 0.2s ease-in;
  position: fixed;
  left: 0;
  right: 0;
  height: 100%;

  .sidebartoggler {
    color: var(--bs-dark-text-emphasis);
  }

  .scroll-sidebar {
    overflow-y: auto;
    padding: $sidebar-spacing-x;
    height: calc(100vh - 175px);
    border-radius: $border-radius;

    .simplebar-track.simplebar-horizontal {
      visibility: hidden !important;
    }
  }
}

.simplebar-scrollbar:before {
  background: rgba(0, 0, 0, 0.5) !important;
}

.brand-logo {
  min-height: $headerHeight;
  padding: $sidebar-spacing-x;
}

// -----------------------------------
// Sidebar list
// -----------------------------------
.sidebar-nav {
  ul {
    .sidebar-item {
      .sidebar-link {
        display: flex;
        font-size: 14px;
        white-space: nowrap;
        align-items: center;
        line-height: 25px;
        position: relative;
        margin: 0px 0px 2px;
        padding: 10px;
        border-radius: 7px;
        gap: 15px;
        text-decoration: none;
        font-weight: $font-weight-normal;

        span:first-child {
          display: flex;
        }

        .ti {
          flex-shrink: 0;
          font-size: 21px;
        }

        &:hover {
          background: var(--bs-primary-bg-subtle);
          color: var(--bs-primary);

          &.has-arrow::after {
            border-color: var(--bs-primary);
          }
        }
      }

      .sidebar-link.active {
        &:hover {
          &.has-arrow::after {
            border-color: var(--bs-white);
          }
        }
      }

      .link-disabled {
        opacity: $link-disabled;
      }

      .first-level {
        .sidebar-item {
          transition: all 0.4s ease-in-out;
          border-bottom: 0;

          .sidebar-link {
            &:hover {
              background-color: transparent;
              color: var(--bs-primary);
            }
          }

          .sidebar-link.active {
            &.has-arrow::after {
              border-color: var(--bs-primary);
            }
          }

          &>.sidebar-link {
            padding: 8px 10px;
            border-radius: 7px;
            font-size: 14px;
            gap: 23px;

            .sidebar-icon {
              flex-shrink: 0;
              margin-left: 12px;
              margin-right: 35px;
              width: 14px;
              height: 14px;
            }
          }

          &:last-child {
            margin-bottom: 16px;
          }
        }

        .sidebar-link {
          .ti {
            font-size: 7px;
          }
        }
      }

      .first-level {
        .sidebar-item {
          .sidebar-link.active {
            background-color: transparent !important;
            color: var(--bs-primary) !important;
          }
        }
      }

      .two-level {
        .sidebar-item {
          .sidebar-link {
            padding: 8px 10px 8px 45px;
          }
        }
      }

      .three-level {
        .sidebar-item {
          .sidebar-link {
            padding: 8px 10px 8px 60px;
          }
        }
      }

      &.selected>.sidebar-link.active,
      &.selected>.sidebar-link,
      >.sidebar-link.active {
        background-color: var(--bs-primary);
        color: var(--bs-white);
      }
    }

    .sidebar-item.selected {
      .sidebar-link.has-arrow {
        &::after {
          border-color: var(--bs-white);
        }
      }
    }
  }

  .sidebar-list {
    .sidebar-list-item {
      padding: 8px 0;
    }
  }
}

.nav-small-cap {
  margin-top: 24px;
  color: var(--bs-link-color);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 0;
  line-height: 26px;
  text-transform: uppercase;

  .nav-small-cap-icon {
    display: none;
  }
}

.collapse.in {
  display: block;
}

// -----------------------------------
// Sidebar Type : Minisidebar
// -----------------------------------

// About LG Screen
@include media-breakpoint-up(xl) {
  [data-layout="vertical"] {
    [data-sidebartype="mini-sidebar"] {
      .left-sidebar {
        width: $sidebar-width-mini;

        &:hover {
          width: $sidebar-width-full;
          position: fixed;
          height: 100vh;

          .logo-part {
            width: auto;
            overflow: unset;
          }
        }

        .logo-part {
          width: 34px;
          overflow: hidden;
        }
      }
    }
  }
}

// Down LG Screen
@include media-breakpoint-down(xl) {
  .left-sidebar {
    width: $sidebar-width-full;
    position: fixed;
    left: -$sidebar-width-full;
    height: 100%;
  }

  #main-wrapper {
    &.show-sidebar {
      .left-sidebar {
        left: 0;
      }
    }
  }

  .topbar .navbar .navbar-collapse {
    border-top: 1px solid var(--bs-border-color);
  }

  .show-sidebar+.dark-transparent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
  }
}

@import "./sidebar-arrow";