@import '../styles/themes/themes.less';

@transfer-item-hover-background-color: #e1ecff;

.@{bk-prefix}-transfer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;

  .@{bk-prefix}-transfer-icon {
    margin: 0 8px;
    font-size: 24px;
    color: @light-gray;
  }

  .transfer-button-group {
    margin: 0 8px;

    .transfer-button {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      color: @white-color;
      cursor: pointer;
      background-color: @primary-color;
      border: 1px solid @primary-color;
      border-radius: 2px;

      &:first-child {
        margin-bottom: 8px;
      }

      &.disabled {
        color: @light-gray;
        cursor: not-allowed;
        background-color: @whitesmoke-color;
        border-color: @disable-color;
      }

      span {
        font-size: 18px;
      }
    }
  }

  .source-list,
  .target-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 200px;
    height: 400px;
    overflow: hidden;
    background-color: @white-color;
    border: 1px solid @disable-color;
    border-radius: 2px;

    .slot-header,
    .header {
      height: 40px;
      padding: 0 16px;
      background-color: @whitesmoke-color;
      border-bottom: 1px solid @disable-color;
    }

    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 700;

      .select-all {
        font-size: 12px;
        font-weight: normal;
        color: @primary-color;
        cursor: pointer;

        &.disabled {
          color: @light-gray;
          cursor: not-allowed;
        }
      }

      .select-total-count {
        font-weight: normal;
        color: @gray-color;
      }
    }

    .transfer-search-input {
      width: calc(100% - 32px);
      height: 30px;
      margin: 8px 16px 0;
      border-width: 0 0 1px 0;
      border-bottom: 1px solid @disable-color;
      border-radius: 0;
      outline: none;

      &.is-focused {
        box-shadow: none;
      }

      .@{bk-prefix}-icon-search {
        font-size: 18px;
        line-height: 28px;
        color: @light-gray;
      }

      input {
        padding-left: 4px;
      }
    }

    .empty {
      display: flex;
      flex: 1;
      align-items: center;
      justify-content: center;
      padding-bottom: 30px;
      color: @light-gray;
      cursor: default;
    }

    .content {
      flex: 1;
      margin: 4px 0;
      overflow-y: auto;

      &.is-flex {
        display: flex;
        flex-direction: column;
      }

      li.custom-item,
      li .item-content,
      .checkbox-item {
        display: flex;
        align-items: center;
        height: 32px;
        padding: 0 16px;
        margin-bottom: 4px;
        margin-left: 0;
        cursor: pointer;

        &:hover:not(.is-disabled) {
          color: @primary-color;
          background-color: @transfer-item-hover-background-color;

          .icon-wrapper {
            visibility: visible;
          }
        }

        .content-text {
          flex: 1;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .icon-wrapper {
          visibility: hidden;

          .@{bk-prefix}-icon {
            display: flex;
            font-size: 30px;
          }

          .@{bk-prefix}-icon-delete {
            margin-right: 6px;
            font-size: 16px;
          }
        }

        &.is-disabled {
          color: @light-gray;
          cursor: not-allowed;
        }

        .bk-checkbox-input {
          flex: none;
        }

        .bk-checkbox-label {
          flex: 1;
          overflow: hidden;
        }
      }

      .checkbox-item {
        .item-content {
          display: flex;
          align-items: center;
        }
      }

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

      &::-webkit-scrollbar-thumb {
        height: 5px;
        background-color: #dcdee5;
        border-radius: 2px;
      }
    }
  }
}
