@import '../../style/themes/index';
@import '../../style/mixins/index';
@import '../../input/style/mixin';

@yee-input-prefix-cls: ~'@{yee-prefix}-input';
@yee-select-prefix-cls: ~'@{yee-prefix}-select';
@yee-autocomplete-prefix-cls: ~'@{yee-select-prefix-cls}-auto-complete';

.@{yee-autocomplete-prefix-cls} {
  .yee-reset-component;

  &.@{yee-select-prefix-cls} {
    .@{yee-select-prefix-cls} {
      &-selection {
        border: 0;
        box-shadow: none;
        &__rendered {
          height: 100%;
          margin-right: 0;
          margin-left: 0;
          line-height: @yee-input-height-base;
        }
        &__placeholder {
          margin-right: (@yee-input-padding-horizontal-base + 1px);
          margin-left: (@yee-input-padding-horizontal-base + 1px);
        }

        &--single {
          height: auto;
        }
      }
    }

    // Fix https://github.com/ant-design/ant-design/issues/7800
    .@{yee-select-prefix-cls}-search--inline {
      position: static;
      float: left;
    }

    &-allow-clear {
      .@{yee-select-prefix-cls}-selection:hover .@{yee-select-prefix-cls}-selection__rendered {
        margin-right: 0 !important;
      }
    }

    .@{yee-input-prefix-cls} {
      height: @yee-input-height-base;
      line-height: @yee-line-height-base;
      background: transparent;
      border-width: @yee-border-width-base;
      &:focus,
      &:hover {
        .yee-hover;
      }
      &[disabled] {
        .yee-disabled;
      }
    }

    &-lg {
      .@{yee-select-prefix-cls}-selection__rendered {
        line-height: @yee-input-height-lg;
      }
      .@{yee-input-prefix-cls} {
        height: @yee-input-height-lg;
        padding-top: @yee-input-padding-vertical-lg;
        padding-bottom: @yee-input-padding-vertical-lg;
      }
    }

    &-sm {
      .@{yee-select-prefix-cls}-selection__rendered {
        line-height: @yee-input-height-sm;
      }
      .@{yee-input-prefix-cls} {
        height: @yee-input-height-sm;
        padding-top: @yee-input-padding-vertical-sm;
        padding-bottom: @yee-input-padding-vertical-sm;
      }
    }
  }
}

// https://github.com/ant-design/ant-design/issues/14156
.@{yee-input-prefix-cls}-group > .@{yee-autocomplete-prefix-cls} {
  .@{yee-select-prefix-cls}-search__field.@{yee-input-prefix-cls}-affix-wrapper {
    display: inline;
    float: none;
  }
}
