@import url('../CloudTheme.css');

@mixin flex-column {
  display: flex;
  flex-direction: column;
}

@mixin active-color {
  color: $blue-blue1;

  svg,
  .listItemText > p {
    color: $blue-blue1;
  }
}

ul.navList {
  @include flex-column;
  padding: 0;
  gap: 4px;
}
.noExpandList {
  width: fit-content;
}

.childrenContainer {
  margin-top: 8px;
}

.subList {
  @include flex-column;
  gap: 4px;
  width: calc(100% - 12px - 20px);

  .listItemText {
    color: $black-black2;
  }

  div.listItem {
    &.active {
      .listItemText > p {
        font-weight: 400;
      }
    }
  }
}

.subItems {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

div.listItem {
  padding: 7px 10px;
  gap: 12px;
  border-radius: 6px;

  &.hasChildren {
    position: relative;
  }

  &[data-level='1'] {
    padding-left: 12px;
  }

  &.noExpand {
    width: fit-content;
    min-width: fit-content;
    max-width: fit-content;
  }

  &.active {
    @include active-color;
    background-color: $blue-blue3;

    .listItemText > p,
    .listItemText > span {
      font-weight: 600;
      color: inherit;
    }
  }

  &:hover {
    background-color: $blue-blue3;
  }

  &.activeParent,
  &:active {
    @include active-color;
  }

  &.activeParent {
    .arrowIcon {
      color: $black-black1;
    }
    .listItemText > p,
    .listItemText > span {
      color: inherit;
      font-weight: 500;
    }
  }

  &.activeChild {
    .listItemText > p,
    .listItemText > span {
      color: $blue-blue1;
      font-weight: 400;
    }
  }

  .listItemText {
    margin: 0;
  }

  .icon {
    min-width: fit-content;
  }
}

.navItemWrapper {
  position: relative;
}

ul.subMenu {
  position: absolute;
  bottom: 0;
  left: calc(100% + 4px);
  transition: visibility 0.1s linear;
  z-index: 100;

  background-color: #fff;

  @include flex-column;
  gap: 4px;

  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid $stroke-stroke1;
  box-shadow: $shadow-dark;

  &.hide {
    visibility: hidden;
  }

  .subMenuItem {
    min-height: 36px;
    padding: 0 16px;

    font-size: 14px;
    line-height: 135%;
    color: $black-black1;
    font-weight: 400;
    z-index: 100;

    &.active {
      @include active-color;
      background-color: $blue-blue4;
    }

    &:hover {
      background-color: $black-black5;
    }
  }
}
