@import '~antd/lib/style/themes/default.less';
@import '~antd/lib/style/mixins/index.less';

@pro-table-search-prefix-cls: ~'@{ant-prefix}-pro-table-search';

@pro-table-form-prefix-cls: ~'@{ant-prefix}-pro-table-form';

.@{pro-table-search-prefix-cls} {
  margin-bottom: 16px;
  padding: 24px;
  padding-bottom: 0;
  background: @component-background;

  .clearfix;

  &.@{pro-table-form-prefix-cls} {
    margin: 0;
    padding: 0 16px;
    overflow: unset;
  }

  .@{ant-prefix}-form-item-label {
    min-width: 40px;
    text-align: right;
  }
  .@{ant-prefix}-row:not(.ant-form-item) {
    > .ant-col {
      padding: 4px 0;
    }
  }

  .@{ant-prefix}-form-item {
    display: flex;
  }

  .@{ant-prefix}-form-item-control {
    flex: 1;
  }

  &-option {
    .@{ant-prefix}-form-item-control-input {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      text-align: right;
    }
  }

  &-form-option {
    .@{ant-prefix}-form-item {
      margin: 0;
    }
    .@{ant-prefix}-form-item-label {
      opacity: 0;
    }
    .@{ant-prefix}-form-item-control-input {
      justify-content: flex-start;
    }
  }

  .errorIcon {
    cursor: pointer;
    color: @error-color;
    margin-right: 24px;

    i {
      margin-right: 4px;
    }
  }

  .errorPopover {
    :global {
      .@{ant-prefix}-popover-inner-content {
        padding: 0;
        max-height: 290px;
        overflow: auto;
        min-width: 256px;
      }
    }
  }

  .errorListItem {
    list-style: none;
    border-bottom: 1px solid @border-color-split;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      background: @primary-1;
    }

    &:last-child {
      border: 0;
    }

    .errorIcon {
      color: @error-color;
      float: left;
      margin-top: 4px;
      margin-right: 12px;
      padding-bottom: 22px;
    }

    .errorField {
      font-size: 12px;
      color: @text-color-secondary;
      margin-top: 2px;
    }
  }
}

@media (max-width: 575px) {
  .@{pro-table-search-prefix-cls} {
    .@{ant-prefix}-form-item {
      display: inline;
    }
    .@{ant-prefix}-legacy-form-item {
      display: inline;
    }
    .@{ant-prefix}-form-item-label {
      min-width: 80px;
      text-align: left;
    }
    .@{ant-prefix}-legacy-form-item-label {
      min-width: 80px;
      text-align: left;
    }
  }
}
