@import url(../var.less);
@import url(./input.less);
@import url(./scrollbar.less);
@import url(./popper.less);
@import url(./select-dropdown.less);
@import url(./option-group.less);
@import url(./option.less);

@select-prefix: ~"@{prefix}select";

.@{select-prefix}{
  display: inline-block;
  position: relative;
 
  .@{select-prefix}__tags
    >span {
      display: contents;
    }

  // &:hover {
  //   .w-input__inner {
  //     border-color: @select-border-color-hover;
  //   }
  // }

  .w-input__inner {
    cursor: pointer;
    padding-right: 35px;

    &:focus {
      border-color: @select-input-focus-border-color;
    }
  }

  .w-input {
    & .w-select__caret {
      color: @select-input-color;
      font-size: @select-input-font-size;
      transition: transform .3s;
      transform: rotateZ(180deg);
      cursor: pointer;

      &.is-reverse {
        transform: rotateZ(0deg);
      }

      &.is-show-close {
        font-size: @select-font-size;
        text-align: center;
        transform: rotateZ(180deg);
        border-radius: @border-radius-circle;
        color: @select-input-color;
        transition: @color-transition-base;

        &:hover {
          color: @select-close-hover-color;
        }
      }
    }
  }

  > .w-input {
    display: block;
  }

  &__input {
    border: none;
    outline: none;
    padding: 0;
    margin-left: 15px;
    color: @select-multiple-input-color;
    font-size: @select-font-size;
    appearance: none;
    height: 28px;
    background-color: transparent;
  }

  &__close {
    cursor: pointer;
    position: absolute;
    top: 8px;
    z-index: @z-index-top;
    right: 25px;
    color: @select-input-color;
    line-height: 18px;
    font-size: @select-input-font-size;

    &:hover {
      color: @select-close-hover-color;
    }
  }

  &__tags {
    position: absolute;
    line-height: normal;
    white-space: normal;
    z-index: @z-index-normal;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .w-tag__close {
    margin-top: -2px;
  }

  &__tags-text {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .w-tag {
    box-sizing: border-box;
    border-color: transparent;
    margin: 2px 0 2px 6px;
    background-color: @select-tag-background-color;
    display: flex;
    max-width: 100%;
    align-items: center;

    &__close.w-icon-close {
      background-color: @placeholder-text-color;
      top: 0;
      color: @color-white;
      flex-shrink: 0;

      &:hover {
        background-color: @secondary-text-color;
      }

      &::before {
        display: block;
        transform: translate(0, .5px);
      }
    }
  }

  &--is-no-border {
    .w-input__inner {
      border: transparent;
    }
  }
}


