@search-prefix-cls: ~'@{css-prefix}search';
@input-prefix-cls: ~'@{css-prefix}input';
@input-group-prefix-cls: ~'@{css-prefix}input-group';

.@{search-prefix-cls} {
  &-icon{
    font-size: 16px;
    cursor: pointer;
    &:hover {
      color: @color-brand-primary;
    }
  }
  &-border{
    display: flex;
    align-items: center; /* 垂直居中 */
    border: 1px solid @color-scrollbar;
    border-radius: 4px;
    width: 100%;
    transition: border-color 0.3s ease;
    &:hover {
      border: 1px solid @color-brand-primary;
    }
    &:focus-within{
      border: 1px solid @color-brand-primary;
    }
    .@{search-prefix-cls}-vertical{
      position: relative;
      &:not(:last-child){
        &::after{
          content: "";
          position: absolute;
          right: 0;
          top: 7px;
          bottom: 7px;
          width: 1px;
          background-color: @color-scrollbar; /* 竖线颜色 */
        }
      }
    }
    .@{search-prefix-cls}-front{
      padding: 8px 10px;
      white-space: nowrap; /* 防止文字换行 */
    }
    .haloe-select-selection{
      border: none;
    }
  }

  &-filter{
    .haloe-select-selection{
      border: none;
    }
  }

  &-simple{
    .haloe-search-border{
      border-top: none;
      border-left: none;
      border-right: none;
      border-radius: 0px;
    }
  }

  &-disabled{
    cursor: not-allowed;
    color: @radio-disabled-text-color;
    background-color: @font-50;
    .@{search-prefix-cls}-border{
      &:hover{
        border: 1px solid @color-scrollbar;
      }
      &:focus-within{
        border: 1px solid @color-scrollbar;
      }
    }
  }

  .haloe-icon-close-circle-filled:before {
    color: @search-icon-close-circle;
  }
  .haloe-input-search:before {
    width: 0;
  }
  .@{input-prefix-cls} {
    border-color: @color-scrollbar !important;
    &-no-border {
      border: none;
      border-radius: 4px !important;
    }
    &-prefix i {
      color: @color-complementary-5;
    }

    &-search {
      z-index: 1;
      padding: 0 10px !important;
      background: @color-functional-white !important;
      color: @color-complementary-5 !important;
      border-color: @color-scrollbar !important;

      &:hover {
        color: @color-brand-primary !important;
        border: 1px solid @color-brand-primary !important;
      }
    }
    // &-group-prepend {
    //   border: 1px solid @color-border-disable !important;
    // }
    // &-group-prepend:hover {
    //   border-color: @color-brand-primary !important;
    //   // border-right: 1px solid red !important;
    // }
    &:hover {
      border-color: @color-brand-primary !important;
    }
  }

  .@{input-group-prefix-cls} {
    &-wrapper > *:last-child.@{input-prefix-cls}-wrapper .@{input-prefix-cls} {
      border-top-right-radius: 0 !important;
      border-bottom-right-radius: 0 !important;
    }

    &-wrapper
      > *:first-child.@{input-prefix-cls}-group-with-prepend
      .@{input-prefix-cls} {
      border-top-left-radius: 0 !important;
      border-bottom-left-radius: 0 !important;
    }
  }

  &-disabled {
    .haloe-icon-search:before {
      color: @search-icon-disabled-prefix !important;
    }
    .haloe-select-selected-value {
      color: @search-icon-disabled-prefix !important;
    }
    .haloe-select-selection,
    .haloe-select-selection:hover {
      border-color: @color-border-disable !important;
      border-right: 0 !important;
    }
    .@{input-prefix-cls} {
      border-color: @color-complementary-7 !important;
      &-search,
      &-search:hover {
        cursor: @cursor-disabled;
        background: @color-complementary-8 !important;
        color: @search-icon-disabled-prefix !important;
        border-color: @color-border-disable !important;
      }
    }
  }
  .haloe-input-wrapper-disabled .haloe-input:not(.haloe-input-no-border) {
    border: 1px solid @color-border-disable !important;
  }
}
