@use "@tencentcloud/uikit-base-component-react/dist/styles/theme/util" as *;
@use "sass:color";

.forward {
  width: 400px;
  display: flex;
  flex-direction: column;
  height: 80vh;
  border-radius: 16px;

  @include responsive((
    "mobile": (
      width: 90vw,
    ),
    "desktop": (
      width: 400px,
    ),
  ));

  @include theme() {
    background-color: get(bg-color-operate);
    box-shadow: 0 10px 20px get(shadow-color);
  }
}

.forward-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 10%);

  &__close {
    @include theme() {
      color: get(text-color-secondary);
    }
  }

  &__title {
    font-size: 16px;
    font-weight: 500;

    @include theme() {
      color: get(text-color-primary);
    }
  }
}

.forward-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin: 12px 16px;

  &__icon {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;

    @include theme() {
      color: get(text-color-secondary);
    }
  }

  &__input {
    flex: 1;
    border: none;
    font-size: 14px;
    background: transparent;
    padding: 8px 16px 8px 36px;
    border-radius: 8px;

    @include theme() {
      color: get(text-color-primary);
      background-color: get(bg-color-input);

      &::placeholder {
        color: get(text-color-secondary);
      }
    }
  }
}

.forward-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 16px;

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 10%);
    border-radius: 3px;
  }
}

.forward-section-title {
  font-size: 12px;
  padding: 12px 0;

  @include theme() {
    color: get(text-color-secondary);
  }
}

.forward-list {
  display: flex;
  flex-direction: column;
  gap: 4px;

  &::-webkit-scrollbar {
    height: 4px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 10%);
    border-radius: 2px;
  }

  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 10%) transparent;
}

.forward-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;

  @include theme() {
    &:hover {
      background-color: get(dropdown-color-hover);
    }
  }

  &--selected {
    @include theme() {
      background-color: get(dropdown-color-active);
    }
  }

  &__info {
    flex: 1;
    min-width: 0;
  }

  &__name {
    font-size: 14px;
    font-weight: 500;

    @include theme() {
      color: get(text-color-primary);
    }
  }

  &__checkbox {
    @include theme() {
      color: get(text-color-link);
    }
  }
}

.forward-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  font-size: 14px;

  @include theme() {
    color: get(text-color-secondary);
  }
}

.forward-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 10%);

  &__selected-list {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    max-height: 80px;
    overflow: hidden auto;
    gap: 4px;
    font-size: 14px;

    &::-webkit-scrollbar {
      height: 4px;
    }

    &::-webkit-scrollbar-track {
      background: transparent;
    }

    &::-webkit-scrollbar-thumb {
      background-color: rgba(0, 0, 0, 10%);
      border-radius: 2px;
    }

    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 10%) transparent;

    @include theme() {
      color: get(text-color-secondary);
    }

    &--item {
      flex: 0 0 auto;
      padding: 2px 8px;
      border-radius: 4px;
      background-color: #0d6efd;
      color: #fff;
    }
  }

  &__button {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;

    @include theme(true) {
      background-color: get(button-color-primary-default);
      color: #fff;

      &:hover {
        background-color: get(button-color-primary-hover);
      }

      &:active {
        background-color: get(button-color-primary-active);
      }

      &:disabled {
        background-color: get(button-color-primary-disabled);
        color: get(text-color-disabled);
        cursor: not-allowed;
      }
    }
  }
}
