@import '../../style/index.less';

@searchhead-prefix-cls: ~'@{xui-prefix}__search-head';
@searchhead-prefix-cls--popup: ~'@{searchhead-prefix-cls}--popup';
@searchhead-prefix-cls--show: ~'@{searchhead-prefix-cls}--show';
@searchhead-prefix-cls--col: ~'@{searchhead-prefix-cls}--col';
@searchhead-prefix-cls--btn: ~'@{searchhead-prefix-cls}--btn';
@searchhead-prefix-cls--position: ~'@{searchhead-prefix-cls}--position';

.@{searchhead-prefix-cls--position} {
  position: relative;

  .ant-input-affix-wrapper {
    transition: none;
  }

  .@{searchhead-prefix-cls} {
    margin-bottom: 12px;
    overflow: hidden;
    background-color: #fff;

    &--iconfont {
      float: left;
      width: @input-height-base;
      height: @input-height-base;
      margin-right: 20px;
      color: #999;
      line-height: @input-height-base;
      text-align: center;
      border: 1px solid #dcdfe6;
      border-radius: 4px;
      cursor: pointer;
      &:hover {
        color: @primary-color;
        border-color: @primary-color;
      }
    }

    &--col {
      display: flex;
      align-items: center;
      float: left;

      &--title {
        padding-right: 6px;
        white-space: nowrap;
        text-align: right;
      }

      &--content {
        display: flex;
        align-items: center;
        width: 220px;
        margin-right: 20px;

        &--segmentation {
          flex: 0 0 6px;
          height: 1px;
          margin: 0 5px;
          background-color: #333;
        }

        .ant-select-selector {
          width: 100%;
        }
      }

      &--isSearch {
        border-color: @primary-color;

        .ant-select-selector {
          border-color: @primary-color;
        }
      }
    }

    &--btn {
      display: flex;
      align-items: center;

      button {
        height: 30px;
        line-height: 1;
        &:first-child {
          margin-right: 10px;
        }
      }
    }
  }

  .@{searchhead-prefix-cls--popup} {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: none;
    padding: 16px;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);

    .@{searchhead-prefix-cls--col} {
      margin-bottom: 16px;

      &--title {
        width: 100px;
      }

      &--content {
        margin-right: 0;
        .ant-select-selector {
          width: 100%;
        }
      }
    }

    .@{searchhead-prefix-cls--btn} {
      justify-content: center;
      width: 100%;

      button {
        &:first-child {
          margin-right: 10px;
        }
      }
    }
  }

  .@{searchhead-prefix-cls--show} {
    display: block;
  }
}
