@import 'mixins/mixins';
@import 'mixins/utils';
@import 'common/var';
@import 'input';
@import 'button';
@import 'checkbox';
@import 'checkbox-group';

@include b(transfer) {
  font-size: $--font-size-base;
  display: flex;

  @include e(buttons) {
    display: flex;
    vertical-align: middle;
    flex-direction: column;
    padding: 0 30px;
    justify-content: center;
  }
  .secBtton {
    margin-left: 0 !important;
  }
  @include e(button) {
    display: block;
    margin: 0 auto;
    padding: 7px !important;
    border-radius: 50%;
    color: $--color-white;
    background-color: $--color-primary;
    font-size: 0;

    @include when(with-texts) {
      border-radius: $--border-radius-base;
    }

    @include when(disabled) {
      border: 1px $--button-disabled-border-color solid !important;
      background-color: $--background-color-base;
      color: $--color-text-placeholder;

      &:hover {
        border: $--border-base;
        background-color: $--background-color-base;
        color: $--color-text-placeholder;
      }
    }

    &:first-child {
      margin-bottom: 16px;
    }

    &:nth-child(2) {
      margin: 0;
    }

    i,
    span {
      font-size: 16px;
    }

    & [class*='el-icon-'] + span {
      margin-left: 0;
    }
  }
}

@include b(transfer-panel) {
  border: 1px solid $--transfer-border-color;
  border-radius: $--transfer-border-radius;
  overflow: hidden;
  background: $--color-white;
  display: inline-block;
  vertical-align: middle;
  width: $--transfer-panel-width;
  max-height: 100%;
  box-sizing: border-box;
  position: relative;

  @include e(body) {
    height: $--transfer-panel-body-height;

    @include when(with-footer) {
      padding-bottom: $--transfer-panel-footer-height;
    }
  }

  @include e(list) {
    margin: 0;
    padding: 6px 0;
    list-style: none;
    height: $--transfer-panel-body-height;
    overflow: auto;
    box-sizing: border-box;
    &::-webkit-scrollbar {
      width: 4px;
    }
    &::-webkit-scrollbar-thumb {
      background: rgba(208, 214, 245, 0.32);
      border-radius: 2px;

    }

    @include when(filterable) {
      height: #{$--transfer-panel-body-height - $--transfer-filter-height - 20px};
      padding-top: 0;
    }
  }

  @include e(item) {
    height: 32px;
    line-height: 32px;
    padding-left: 20px;
    display: flex !important;
    align-items: center;
    margin-bottom: 8px;

    & + .yk-transfer-panel__item {
      margin-left: 0;
    }

    &.yk-checkbox {
      color: $--color-text-regular;
    }
    &.yk-checkbox:last-of-type {
      margin-right: 30px;
    }

    &:hover {
      color: $--color-primary;
      background: rgba(46, 99, 253, 0.04);
      .yk-checkbox__input {
        color: $--color-primary;
      }
    }

    &.yk-checkbox .yk-checkbox__label {
      width: 100%;
      @include utils-ellipsis;
      display: block;
      box-sizing: border-box;
      padding-left: 16px;

      font-size: 14px;
      font-weight: 400;
      color: #2c2836;
      line-height: 22px;
      &:hover {
        color: $--color-primary;
      }
    }

    .yk-checkbox__input {
      position: absolute;
      top: 9px;
    }
  }

  @include e(filter) {
    text-align: center;
    margin: 8px;
    box-sizing: border-box;
    display: block;
    width: auto;

    .yk_icon_search {
      color: rgba($color: $--color-text-regular, $alpha: 0.56);
    }
    .yk_icon_close {
      color: rgba($color: $--color-text-regular, $alpha: 0.22);
      cursor: pointer;
    }
  }

  .yk-transfer-panel__header {
    height: $--transfer-panel-header-height;
    line-height: $--transfer-panel-header-height;
    background: #ffffff;
    margin: 0;
    padding-left: 20px;
    border-bottom: 1px solid $--transfer-border-color;
    box-sizing: border-box;
    color: $--color-black;

    .yk-checkbox {
      display: block;
      line-height: 40px;

      .yk-checkbox__label {
        font-weight: normal;
        font-size: 13px;
        font-weight: 600;
        color: #2c2836;
        span {
          position: absolute;
          right: 15px;
          color: $--color-text-secondary;
          font-size: 12px;
          font-weight: normal;
        }
      }
    }
  }

  .yk-transfer-panel__footer {
    height: $--transfer-panel-footer-height;
    background: $--color-white;
    margin: 0;
    padding: 0;
    border-top: 1px solid $--transfer-border-color;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: $--index-normal;
    @include utils-vertical-center;

    .yk-checkbox {
      padding-left: 20px;
      color: $--color-text-regular;
    }
  }

  .yk-transfer-panel__empty {
    margin: 0;
    height: $--transfer-item-height;
    line-height: $--transfer-item-height;
    padding: 6px 15px 0;
    color: $--color-text-secondary;
    text-align: center;
  }

  .yk-checkbox__label {
    margin-left: 8px;
  }

  .yk-checkbox__inner {
    height: 16px;
    width: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 3px;
    &::after {
      // height: 6px;
      width: 3px;
      left: 5px;
    }
  }
}
