@import '../../../../../es/style/themes/default';

@table-prefix-cls: ~'@{c7n-pro-prefix}-table';
@table-border: @border-width-base @border-style-base @table-border-color;
@table-row-search-bg: @table-row-group-title-bg;

.@{table-prefix-cls} {
  &-query-bar {
    float: right;

    > * + * {
      margin-left: 0.16rem;
    }

    &-dirty-info {
      display: inline-block;
      height: @input-height-base;
      padding: 0 0.12rem;
      line-height: 2;
      vertical-align: middle;
      background-color: @background-color-light;
      border-radius: @border-radius-base;

      > * {
        vertical-align: middle;

        & + * {
          margin-left: 0.05rem;
        }
      }

      .@{iconfont-css-prefix} {
        color: @yellow-6;
      }
    }

    input {
      font-weight: 500;
    }
  }

  // advanced-query-bar

  &-advanced-query-bar {
    padding: 0.12rem 0;

    &-button {
      display: inline-block;
      vertical-align: middle;
    }

    &-options .@{table-prefix-cls}-filter-select {
      padding-right: 0 !important;
      padding-left: 1.2rem !important;
      border-top-style: dashed !important;
      cursor: default;

      &-prefix {
        width: 1.2rem;
        line-height: 1.5;
        text-align: left;
      }
    }

    &-options .@{table-prefix-cls}-filter-select-hidden {
      display: none;
    }
  }

  // dynamic-filter-bar

  &-dynamic-filter-bar {
    margin-bottom: 0.08rem;

    input::-webkit-input-placeholder {
      color: #6A6A6A;
    }

    input:-moz-placeholder {
      color: #6A6A6A;
    }

    input::-moz-placeholder {
      color: #6A6A6A;
    }

    input:-ms-input-placeholder {
      color: #6A6A6A;
    }

    .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
      color: #6A6A6A;
    }
  }

  &-dynamic-filter-single-wrapper {
    display: flex;
  }

  &-dynamic-filter-bar-single-action {
    display: flex;
    flex-shrink: 0;
    gap: 0.08rem;
    justify-content: flex-end;
    margin: 0.08rem 0 0;
    padding-right: 0.06rem;
    background: rgba(232, 232, 232, 0.20);

    i {
      margin-top: 0.06rem;
      font-size: 0.2rem;
    }

    .@{table-prefix-cls}-filter-buttons {
      margin-top: 0.02rem;
    }
  }

  &-dynamic-filter-bar-suffix {
    gap: 0.08rem;
    margin-left: 0.1rem;

    .@{table-prefix-cls}-columns-chooser {
      width: unset;
      border-left: none;

      &-dropdown-menu {
        min-width: 1.8rem;
      }
    }
  }

  &-dynamic-filter-bar-prefix {
    gap: 0.08rem;

    .@{table-prefix-cls}-columns-chooser {
      width: unset;
      border-left: none;

      &-dropdown-menu {
        min-width: 1.8rem;
      }
    }
  }

  &-dynamic-filter-toolbar {
    margin-left: auto;
  }

  &-dynamic-filter-buttons-toolbar {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    margin-bottom: 0.08rem;

    .@{table-prefix-cls}-summary-group-wrapper {
      margin: 0 auto 0 0;
    }
  }

  &-filter-menu {
    display: flex;
    align-items: center;

    .@{c7n-pro-prefix}-select {
      display: inline-block;
      max-width: 1.72rem;
      margin: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      border: none;
    }

    &-query {
      margin-right: 0.08rem;
    }

    &-expand, &-query {
      cursor: pointer;

      i {
        font-size: 0.16rem;
        background-color: #fafafa;
        border-radius: 0.02rem;
      }
    }
  }

  &-filter-content {
    position: relative;
    display: flex;
    flex-shrink: 0;
    margin-right: 0.16rem;
    padding-left: 0.08rem;
    cursor: pointer;

    &-disabled {
      .@{table-prefix-cls}-filter-label {
        color: @disabled-color;
        cursor: not-allowed;
      }
    }

    &:focus-within,
    &:hover {
      background-color: rgba(0, 0, 0, .05);
      border-radius: 0.02rem;

      .@{table-prefix-cls}-filter-item-close {
        display: inline-block !important;
      }
    }
  }

  &-filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0.08rem 0 0;
    padding: 0.01rem 0.06rem;
    background: rgba(232, 232, 232, 0.20);
    border-radius: 0.01rem;

    span, input {
      background-color: transparent;
    }
  }

  &-add-fields {
    display: flex;
    align-items: center;
    padding: 0 0.08rem;
    color: @text-color;
    cursor: pointer;

    &:hover {
      background-color: rgba(0, 0, 0, .05);
      border-radius: 0.02rem;
    }
  }

  &-filter-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 0.08rem;

    button:first-child {
      margin-left: 0.16rem;
    }
  }

  &-filter-status {
    width: 0.38rem;
    height: 0.16rem;
    margin: 0 0.12rem;
    padding: 0;
    color: @success-color;
    line-height: @line-height-base;
    text-align: center;
    background: rgba(32, 212, 137, 0.12);
    border: none;
    border-radius: 0.02rem;

    span {
      display: block;
      height: 100%;
      transform: scale(0.8);
    }
  }

  &-filterName-select {
    max-width: 1.72rem;
    margin-left: 0.12rem;
    border: none;
  }

  &-filter-menu-option {
    display: flex;

    &-content {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .@{c7n-prefix}-tag {
      height: 0.2rem;
      margin: 0 0.04rem;
    }

    &:hover &-icons {
      display: inline-flex;
      margin-left: auto;
    }

    &:hover &-selected {
      display: none;
    }

    &-icons {
      display: none;
      height: 0.2rem;
      color: @primary-color;
      font-size: 0.16rem;
    }

    &-selected {
      display: inline-flex;
      margin-left: auto;
      font-size: 0.16rem;
    }
  }

  &-filter-label {
    display: flex;
    align-items: center;
    margin-right: 0.02rem;
    padding-top: 0.005rem;
    color: #6A6A6A;
    font-size: @font-size-sm;

    i {
      margin-left: 0.02rem;
      color: rgba(0, 0, 0, 0.45);
      font-size: @btn-icon-size;
    }
  }

  &-filter-search {
    color: #A4A4A4;
    font-weight: @font-weight-base;
    font-size: @font-size-sm;

    i {
      font-size: @font-size-lg;
      line-height: .2rem;

      &:hover {
        color: @primary-color;
      }
    }

    &-divide {
      width: 0.01rem;
      height: 0.12rem;
      margin: 0 0.16rem;
      background-color: #DBE1F1;
    }
  }

  &-filter-item {
    display: flex;
    align-items: center;
    font-size: @font-size-sm;

    [class*="-after"] {
      background-color: transparent;
      border: none;
    }

    span:not(.@{c7n-pro-prefix}-select-suffix-button) {
      &:focus-within {
        input {
          min-width: 1.34rem !important;
        }
      }
    }

    .@{c7n-pro-prefix}-suffix-click {
      min-width: 1.34rem !important;
    }

    label {
      input::-webkit-input-placeholder { // 谷歌
        color: @disabled-color;
      }

      input:-moz-placeholder { //火狐
        color: @disabled-color;
      }

      input::-moz-placeholder {
        color: @disabled-color;
      }

      input:-ms-input-placeholder { //微软
        color: @disabled-color;
      }

      .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
        color: @disabled-color;
      }
    }

    i {
      font-size: @btn-icon-size;
      line-height: @line-height-base;
    }

    &-close {
      position: absolute;
      top: -0.07rem;
      right: -0.07rem;
      z-index: 2;
      display: none !important;
      color: rgba(32, 45, 64, .3);
      cursor: pointer;

      &:hover {
        color: #6A6A6A;
      }
    }

    .@{c7n-pro-prefix}-checkbox-inner {
      top: 0.08rem;
      width: 0.12rem;
      height: 0.12rem;

      &::after {
        width: 0.05rem;
        height: 0.1rem;
      }
    }

    .@{c7n-pro-prefix}-select, .@{c7n-pro-prefix}-input, .@{c7n-pro-prefix}-input-number, .@{c7n-pro-prefix}-calendar-picker {
      width: auto;
      min-width: unset;
      max-width: 4rem;
      margin: 0;
      padding: 0.02rem;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      border: none;

      &-multiple {
        & > label::before { // 谷歌
          content: "";
        }
      }

      &-required {
        background-color: transparent;

        & > label {
          align-items: center;
        }

        & > label::before { // 谷歌
          display: inline-block;
          width: .08rem;
          margin-left: .04rem;
          color: @label-required-color;
          font-family: SimSun, sans-serif;
          vertical-align: middle;
          content: "*";
        }
      }

      &-invalid {
        input::-webkit-input-placeholder { // 谷歌
          color: @error-color;
        }

        input:-moz-placeholder { //火狐
          color: @error-color;
        }

        input::-moz-placeholder {
          color: @error-color;
        }

        input:-ms-input-placeholder { //微软
          color: @error-color;
        }

        .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
          color: @error-color;
        }
      }
    }

    .@{c7n-pro-prefix}-select-multiple-block > div:not(:last-child) {
      max-width: calc(100% - 0.2rem);
    }

    .@{c7n-pro-prefix}-input-number-multiple-block > div:not(:last-child) {
      max-width: calc(100% - 0.2rem);
    }

    .@{c7n-pro-prefix}-select,
    .@{c7n-pro-prefix}-input,
    .@{c7n-pro-prefix}-input-number,
    .@{c7n-pro-prefix}-calendar-picker,
    .@{c7n-pro-prefix}-cascader {
      & > ul {
        flex-wrap: nowrap;
      }

      &-multiple-block-more {
        overflow: visible;
      }
    }
  }

  // professional-query-bar

  &-professional-query-bar {
    display: flex;
    padding: 0.06rem 0;

    .@{c7n-pro-prefix}-field-label, .@{c7n-pro-prefix}-field-wrapper {
      .@{c7n-pro-prefix}-checkbox-wrapper {
        height: @input-height-base;
      }
    }

    &-button {
      display: inline-flex;
      flex-grow: 1;
      flex-shrink: 0;
      align-items: flex-start;
      justify-content: flex-end;
      padding: 0.1rem 0 0.1rem 0.7rem;

      &-vertical {
        padding: 0.3rem 0 0.1rem 0.7rem;
      }

      span {
        vertical-align: baseline;
      }
    }
  }

  &-professional-toolbar {
    .@{table-prefix-cls}-toolbar {
      display: flex;
      flex-direction: row-reverse;
      justify-content: space-between;
      padding-bottom: 0.1rem;
      overflow: hidden;

      &-button-group {
        display: inline-flex;
        align-items: center;
      }

      .@{table-prefix-cls}-summary-group-wrapper {
        margin: 0;
      }
    }
  }

  // combo-bar

  &-combo-filter-bar {
    margin-bottom: 0.08rem;

    input::-webkit-input-placeholder {
      color: @input-placeholder-color;
    }

    input:-moz-placeholder {
      color: @input-placeholder-color;
    }

    input::-moz-placeholder {
      color: @input-placeholder-color;
    }

    input:-ms-input-placeholder {
      color: @input-placeholder-color;
    }

    .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
      color: @input-placeholder-color;
    }
  }

  &-combo-filter-single-wrapper {
    display: flex;
    padding: 0 0.12rem 0 0.16rem;

    .@{table-prefix-cls}-combo-filter-menu {
      display: inline-flex;
      align-items: stretch;
      margin: 0.08rem 0.24rem 0 0;
    }

    .@{table-prefix-cls}-combo-filterName-select {
      margin-left: 0;
    }

    .@{table-prefix-cls}-combo-filter-menu-action {
      display: flex;
      align-items: center;
    }
  }

  &-combo-filter-bar-single-action {
    display: flex;
    flex-shrink: 0;
    gap: 0.08rem;
    justify-content: flex-end;
    margin: 0.08rem 0 0;
    padding-right: 0.06rem;
    background: rgba(232, 232, 232, 0.20);

    i {
      margin-top: 0.06rem;
      font-size: 0.2rem;
    }

    .@{table-prefix-cls}-filter-buttons {
      margin-top: 0.02rem;
    }
  }

  &-combo-filter-bar-prefix {
    gap: 0.08rem;

    .@{table-prefix-cls}-columns-chooser {
      width: unset;
      border-left: none;

      &-dropdown-menu {
        min-width: 1.8rem;
      }
    }
  }

  &-combo-filter-toolbar {
    margin-left: auto;
  }

  &-combo-filter-action {
    margin-left: auto;
    &-button {
      border-radius: 0;
    }
  }

  &-combo-filter-bar-suffix {
    gap: 0.08rem;
    margin-left: auto;

    .@{table-prefix-cls}-columns-chooser {
      width: unset;
      border-left: none;

      &-dropdown-menu {
        min-width: 1.8rem;
      }
    }
  }

  &-combo-filter-toolbar + &-combo-filter-action,
  &-combo-filter-toolbar + &-combo-filter-bar-suffix,
  &-combo-filter-action + &-combo-filter-bar-suffix,
  &-combo-filter-toolbar + &-combo-filter-action + &-combo-filter-bar-suffix {
    margin-left: 0.08rem;
  }

  &-combo-filter-buttons-toolbar {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    margin-bottom: 0.08rem;

    .@{table-prefix-cls}-summary-group-wrapper {
      margin: 0 auto 0 0;
    }
  }

  &-combo-filter-menu {
    display: flex;
    align-items: center;
    height: @input-height-base;
    margin: 0.08rem 0.12rem 0 0.05rem;

    .@{c7n-pro-prefix}-select {
      display: inline-block;
      max-width: 1.72rem;
      margin: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      border: none;
    }

    &-divide {
      height: 0.01rem;
      margin-top: 0.08rem;
      background-color: @border-color-split;
    }
  }

  &-combo-filter-title {
    margin-right: 0.08rem;
    margin-left: 0.12rem;
    font-weight: 500;

    &-divide {
      color: @border-color-split;
    }
  }

  &-combo-filter-menu-button-singleLine-divide {
    width: 0.01rem;
    height: 0.18rem;
    margin: 0.08rem 0.08rem 0.06rem 0.08rem;
    background-color: @border-color-split;
  }

  &-combo-filter-menu-action {
    margin-left: 0.08rem;
  }

  &-combo-filter-content {
    position: relative;
    display: flex;
    flex-shrink: 0;
    margin-top: 0.04rem;
    margin-left: 0.08rem;
    cursor: pointer;

    &-disabled {
      .@{table-prefix-cls}-filter-label {
        color: rgba(0, 0, 0, .25);
        cursor: not-allowed;
      }
    }
  }

  &-combo-filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0.04rem 0 0;
    border-radius: 0.01rem;

    span, input {
      background-color: transparent;
    }
  }

  &-combo-add-fields {
    display: flex;
    align-items: center;
    height: @input-height-base;
    margin-top: 0.04rem;
    margin-left: 0.08rem;
    padding: 0 0.08rem;
    color: @primary-color;
    border-radius: @border-radius-base;
    cursor: pointer;

    &:hover {
      background-color: fade(@primary-color, 10%);
    }

    .@{iconfont-css-prefix} {
      margin-left: 0.08rem;
    }
  }

  &-combo-filter-advanced-item {
    display: flex;
    align-items: center;
    margin-top: 0.04rem;
  }

  &-combo-filter-advanced-divide {
    width: 0.01rem;
    height: 0.18rem;
    margin: 0.1rem 0.08rem 0.06rem 0.08rem;
    background-color: @border-color-split !important;
  }

  &-combo-filter-menu-button {
    display: flex;
    flex-shrink: 0;
    margin-top: 0.08rem;
  }

  &-combo-filter-buttons {
    display: flex;
    flex-shrink: 0;

    button:first-child {
      margin-left: 0.16rem;
    }
  }

  &-combo-filterName-select {
    max-width: 1.72rem;
    margin-left: 0.12rem;
    border: none;
    border-radius: @border-radius-base;

    input.@{c7n-pro-prefix}-select {
      height: @input-height-base - @input-padding-vertical-base * 2 - @border-width-base * 2;
    }

    &:hover {
      background-color: fade(@primary-color, 10%);
    }
  }

  &-combo-filter-title-divide + &-combo-filterName-select {
    margin-left: 0.08rem;
  }

  &-combo-filterName-select.@{c7n-pro-prefix}-select-focused {
    color: @primary-color;

    input.@{c7n-pro-prefix}-select {
      color: @primary-color;
    }
  }

  &-combo-filterName-select-content {
    .@{c7n-pro-prefix}-select-dropdown-menu {
      padding: 0;

      &-item-group {
        padding: 0;

        &-list > .@{c7n-pro-prefix}-select-dropdown-menu-item {
          margin: 0 0.08rem 0.04rem 0.08rem;
          padding-left: 0.14rem;
          border-radius: @border-radius-base;
        }

        &-list > .@{c7n-pro-prefix}-select-dropdown-menu-item-selected {
          color: @primary-color;
        }
      }

      &-item-group-title {
        height: 0.46rem;
        margin-bottom: 0.08rem;
        color: @text-color;
        font-weight: 500;
        font-size: 0.14rem;
        line-height: 0.46rem;
        border-bottom: 0.01rem solid @border-color-split;
      }
    }
  }

  &-combo-filter-menu-option {
    display: flex;

    &-content {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }

  &-combo-filter-search {
    margin-top: 0.08rem;
  }

  &-combo-filter-search-title {
    flex-shrink: 0;
    width: 0.42rem;
    height: @input-height-base;
    margin-top: 0.08rem;
    line-height: @input-height-base;
  }

  &-combo-filter-item {
    display: flex;
    align-items: center;

    &:focus-within {
      input {
        min-width: 0.24rem !important;
      }
    }

    label {
      input::-webkit-input-placeholder { // 谷歌
        color: fade(@text-color, 45%);
      }

      input:-moz-placeholder { //火狐
        color: fade(@text-color, 45%);
      }

      input::-moz-placeholder {
        color: fade(@text-color, 45%);
      }

      input:-ms-input-placeholder { //微软
        color: fade(@text-color, 45%);
      }

      .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
        color: fade(@text-color, 45%);
      }
    }

    i {
      font-size: 0.15rem;
      line-height: 0.2rem;
    }

    &-close {
      position: absolute;
      top: -0.05rem;
      right: -0.05rem;
      z-index: 2;
      display: inline-block !important;
      color: @text-color;
      font-size: 0.12rem;
      cursor: pointer;
      opacity: 0.25;

      &:hover {
        opacity: 0.5;
      }
    }

    .@{c7n-pro-prefix}-checkbox-inner {
      top: 0.08rem;
      width: 0.12rem;
      height: 0.12rem;

      &::after {
        width: 0.05rem;
        height: 0.1rem;
      }
    }

    input.@{c7n-pro-prefix}-select, input.@{c7n-pro-prefix}-input, input.@{c7n-pro-prefix}-input-number, input.@{c7n-pro-prefix}-calendar-picker {
      box-sizing: content-box;
      min-width: unset;
      max-width: 4rem;
      height: @input-height-base - @input-padding-vertical-base * 2 - @border-width-base * 2;
      margin: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;

      &-required {
        background-color: transparent;

        & > label {
          align-items: center;
        }

        & > label::before { // 谷歌
          display: inline-block;
          width: .08rem;
          margin-left: .04rem;
          color: @label-required-color;
          font-family: SimSun, sans-serif;
          vertical-align: middle;
          content: "*";
        }

        .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
          &::before {
            display: inline-block;
            width: .08rem;
            margin-left: .04rem;
            color: @label-required-color;
            font-family: SimSun, sans-serif;
            vertical-align: middle;
            content: "*";
          }
        }
      }

      &-multiple {
        & > label::before { // 谷歌
          content: "";
        }
      }

      &-invalid {
        input::-webkit-input-placeholder { // 谷歌
          color: @error-color;
        }

        input:-moz-placeholder { //火狐
          color: @error-color;
        }

        input::-moz-placeholder {
          color: @error-color;
        }

        input:-ms-input-placeholder { //微软
          color: @error-color;
        }

        .@{c7n-pro-prefix}-input-number-placeholder, .@{c7n-pro-prefix}-select-placeholder {
          color: @error-color;
        }
      }
    }

    span:not(.@{table-prefix-cls}-combo-filter-item-overlay) {
      input.@{c7n-pro-prefix}-select, input.@{c7n-pro-prefix}-input, input.@{c7n-pro-prefix}-input-number, input.@{c7n-pro-prefix}-calendar-picker {
        width: auto;
      }
    }

    .@{c7n-pro-prefix}-select,
    .@{c7n-pro-prefix}-input,
    .@{c7n-pro-prefix}-input-number,
    .@{c7n-pro-prefix}-calendar-picker,
    .@{c7n-pro-prefix}-cascader {
      & > ul {
        flex-wrap: nowrap;
      }

      &-multiple-block-more {
        overflow: visible;
      }
    }
  }

  &-thead-inline-search {
    padding-bottom: 0.01rem;
    background-color: @table-row-search-bg;
    border-bottom: @table-border;
  }

  &-thead-inline-search-last {
    box-shadow: -@border-width-base 0 0 @table-border-color;
  }

  &-inline-query {
    color: @primary-color;
    cursor: pointer;
  }

  &-fold {
    display: none;
  }
}
