@import '../../styles/basis.less';
@import '../../input/style/index.less';
@import '../../tag/style/index.less';

.yk-input-tag {
  position: relative;
  margin: 0;
  padding: 0;
  width: 100%;
  list-style: none;

  &__tag_input_placeholder {
    position: absolute;
    z-index: -1000;
    display: inline;
    color: transparent;
  }

  .yk-input {
    display: inline;
    text-align: left;
    &__inner {
      display: block;
    }

    &__widget {
      max-width: 100%;
    }

    .yk-icon:last-child {
      margin-right: 0px !important;
    }
    &--xl {
      .yk-tag {
        margin: 4px 4px 0px 0;
        min-height: 38px;
      }
      .yk-tag__content {
        font-size: @size-m;
      }
    }
    &--l {
      .yk-tag {
        margin: 3px 4px 1px 0;
        min-height: 28px;
      }
      .yk-tag__content {
        font-size: @size-s;
      }
    }
    &--m {
      .yk-tag {
        margin: 3px 4px 1px 0;
        min-height: 24px;
      }
      .yk-tag__content {
        font-size: @size-s;
      }
    }
    &--s {
      .yk-tag {
        margin: 2px 4px 1px 0;
        min-height: 18px;
      }
      .yk-tag__content {
        font-size: @size-ss;
      }
    }
  }

  &__tag-list {
    display: inline;
  }

  .yk-tag {
    transition: background-color 0.2s ease-in-out;

    &__content {
      white-space: pre-wrap;
      word-break: break-word;
    }
    &__close {
      margin-left: 4px !important;
      padding: 1px;
    }
  }
  .yk-tag--m {
    padding: 0 8px;
  }

  &__blur {
    .yk-tag {
      background-color: @bg-color-l;
    }
  }

  &__hover {
    .yk-input-tag__close-icon {
      display: block;
    }
  }

  &__disabled {
    cursor: not-allowed;

    .yk-input-tag__close-icon {
      cursor: not-allowed !important;
      opacity: 0.8;

      &:hover {
        color: @font-color-s;
        background: transparent;
      }
    }
  }

  &__has-tag {
    .yk-input__inner {
      padding: 0 @space-ss;
    }

    .yk-input__widget {
      padding-right: 0;
      padding-left: @space-ss;
    }
  }

  &__show-suffix {
    .yk-input__inner {
      padding-right: 35px;
    }
  }

  &__close-icon {
    display: none;
    overflow: hidden;
    margin-right: @space-ss;
    padding: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    text-align: center;
    color: @font-color-s;
    background: none;
    transition: all @animatb;
    cursor: pointer;

    &:hover {
      color: @font-color-l;
      background-color: @gray-1;
    }
    .icon-cross-outline {
      margin: 0 !important;
      width: 16px;
      height: 16px;
    }
  }

  &__suffix {
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    align-items: center;
    transform: translateY(-50%);
    flex-direction: row;
  }
}
