@import '../../select/style/var.less';
@import './table.less';
@import './filter-item.less';

.@{pxx-table-prefix-cls}-wrapper {
  width: 100%;
  height: 100%;

  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-title,
  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-footer,
  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-tbody>tr>td,
  .@{table-prefix-cls}.@{table-prefix-cls}-small tfoot>tr>th,
  .@{table-prefix-cls}.@{table-prefix-cls}-small tfoot>tr>td {
    padding: 10px 12px;
  }

  .@{table-prefix-cls}-small .@{table-prefix-cls}-thead {
    >tr>th {
      background-color: rgb(246, 247, 248);
    }

    >tr:first-child>th {
      border-top: 1px solid rgba(25, 38, 75, .12);
    }

    >tr:last-child>th {
      border-bottom: 1px solid rgba(25, 38, 75, .12);
    }

    >tr>th.@{table-prefix-cls}-column-has-sorters:hover {
      background-color: rgb(242, 243, 244);
    }

    .@{table-prefix-cls}-cell {
      border-bottom-width: 0;
      padding: 10px 12px 6px 12px;
    }

    .@{table-prefix-cls}-row-expand-icon-cell,
    .@{table-prefix-cls}-selection-column {
      border-bottom: 1px solid rgba(25, 38, 75, .12);
      padding: 0 !important;
    }

    .@{table-prefix-cls}-selection-column {
      position: relative;

      >.@{table-prefix-cls}-selection {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translate(-50%, 0);
      }

      .@{ant-prefix}-checkbox-indeterminate .@{ant-prefix}-checkbox-inner:after {
        border-radius: 3px;
      }
    }


    .@{pxx-table-prefix-cls}-search-right {
      padding: 0 10px 12px 10px;
    }

    .@{table-prefix-cls}-column-sorters {
      padding: 10px 12px 6px 12px;
    }

    th.@{table-prefix-cls}-column-has-sorters {
      padding: 0;
    }

    .@{pxx-table-prefix-cls}-search {
      padding: 0 10px 12px 10px;
      font-weight: normal;
    }
  }

  .@{table-prefix-cls}-small .@{table-prefix-cls}-selection-column {
    width: 30px;
    min-width: 30px;
  }

  .@{table-prefix-cls} .@{table-prefix-cls}-selection-col {
    width: 30px;
  }

  .@{table-prefix-cls}-tbody>tr>td {
    border-bottom: 1px solid rgba(25, 38, 75, .12);
  }

  .@{table-prefix-cls}-tbody>tr.@{table-prefix-cls}-row-selected>td {
    background: rgb(236, 241, 254);
  }

  .@{table-prefix-cls}-tbody>tr.@{table-prefix-cls}-row:hover>td {
    background: #F1F2F4;
  }

}

.@{pxx-table-prefix-cls}-small-wrapper {

  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-title,
  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-footer,
  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-tbody>tr>td,
  .@{table-prefix-cls}.@{table-prefix-cls}-small tfoot>tr>th,
  .@{table-prefix-cls}.@{table-prefix-cls}-small tfoot>tr>td {
    padding: 6px 12px;
  }

  .@{table-prefix-cls}-small .@{table-prefix-cls}-thead .@{table-prefix-cls}-cell {
    padding: 6px 12px 6px 12px;
  }

  .@{table-prefix-cls}-small .@{table-prefix-cls}-thead .@{table-prefix-cls}-selection-column>.@{table-prefix-cls}-selection {
    top: 6px;
  }

  .@{table-prefix-cls}.@{table-prefix-cls}-small .@{table-prefix-cls}-thead .@{table-prefix-cls}-column-sorters {
    padding: 6px 12px 6px 12px;
  }
}

// .@{pxx-table-prefix-cls}-wrapper-has-filter {
//   .@{table-prefix-cls}-small .@{table-prefix-cls}-thead {

//     .@{pxx-table-prefix-cls}-search,
//     .@{pxx-table-prefix-cls}-search-right {
//       // border-bottom-width: 2px;
//       border-bottom: 1px solid rgba(25, 38, 75, .12);
//     }
//   }
// }

.@{pxx-table-prefix-cls} {
  width: 100%;
  height: 100%;

  .@{pxx-table-prefix-cls}-actions {
    display: flex;
    align-items: center;
    min-width: 56px;

    .@{pxx-prefix}-button>.anticon+span,
    .@{pxx-prefix}-button>span+.anticon {
      margin-left: 4px;
    }

    .@{pxx-table-prefix-cls}-actions-major {
      // flex: 1;

      >* {
        margin: 0 7px;
        padding: 0;
        text-align: left;

        &:nth-of-type(1) {
          margin-left: 0;
        }

        &:nth-last-of-type(1) {
          margin-right: 0;
        }
      }
    }

    // .@{pxx-table-prefix-cls}-actions-major-2>* {
    //   .width(2);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-3>* {
    //   .width(3);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-4>* {
    //   .width(4);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-5>* {
    //   .width(5);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-6>* {
    //   .width(6);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-7>* {
    //   .width(7);
    // }

    // .@{pxx-table-prefix-cls}-actions-major-8>* {
    //   .width(8);
    // }

    .@{pxx-table-prefix-cls}-actions-more {
      margin-left: 7px;
    }
  }

  .@{table-pagination-prefix-cls}.mini .@{table-pagination-prefix-cls}-prev {
    margin-right: 8px;
  }

  .@{table-pagination-prefix-cls},
  .@{table-pagination-prefix-cls}.mini {
    position: relative;
    padding: @table-pagination-padding-vertical @table-pagination-padding-horizontal;

    &-total-text {
      position: absolute;
      left: @table-pagination-padding-horizontal;
      color: @pagination-total-color;
      line-height: @pagination-total-line-height;
    }

    .@{table-pagination-prefix-cls}-disabled {
      .@{table-pagination-prefix-cls}-item-link {
        color: darken(@table-pagination-item-bg, 20%) !important;
        background-color: darken(@table-pagination-item-bg, 1%) !important;
      }
    }

    .@{table-pagination-prefix-cls}-item-link {
      background-color: @table-pagination-item-bg;
      border: none;

      &:hover {
        color: @pagination-item-color-active;
        background-color: @table-pagination-item-bg-active;
      }
    }

    .@{table-pagination-prefix-cls}-item {
      border: none;

      &.@{table-pagination-prefix-cls}-item-active {
        background-color: @table-pagination-item-bg-active;

        a {
          color: @pagination-item-color-active;
        }
      }

      &:hover {
        background-color: @table-pagination-item-bg-active;

        a {
          color: @pagination-item-color-active;
        }
      }
    }

    .@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input) .@{ant-prefix}-select-selector {
      border-radius: @table-pagination-border-radius;
    }
  }

  .@{table-prefix-cls}-filter-trigger {
    color: rgba(0, 0, 0, 0.45) !important;
    font-size: 16px !important;
  }
}

.@{pxx-table-prefix-cls}-filter-empty-item {
  height: 32px;
  border: 1px solid rgba(26, 43, 78, 0.12);
  border-radius: 6px;
  cursor: not-allowed;
}


.@{table-prefix-cls}-filter-dropdown {
  border-radius: @table-filter-dropdown-radius-base  !important;
}
