@prefix-cls: ~'@{namespace}-basic-table';

// fix table unnecessary scrollbar
.@{prefix-cls} {
  .hide-scrollbar-y {
    .ant-spin-nested-loading {
      .ant-spin-container {
        .ant-table {
          .ant-table-content {
            .ant-table-scroll {
              .ant-table-hide-scrollbar {
                overflow-y: auto !important;
              }

              .ant-table-body {
                overflow-y: auto !important;
              }
            }

            .ant-table-fixed-right {
              .ant-table-body-outer {
                .ant-table-body-inner {
                  overflow-y: auto !important;
                }
              }
            }

            .ant-table-fixed-left {
              .ant-table-body-outer {
                .ant-table-body-inner {
                  overflow-y: auto !important;
                }
              }
            }
          }
        }
      }
    }
  }

  .hide-scrollbar-x {
    .ant-spin-nested-loading {
      .ant-spin-container {
        .ant-table {
          .ant-table-content {
            .ant-table-scroll {
              .ant-table-hide-scrollbar {
                //overflow-x: auto !important;
              }

              .ant-table-body {
                overflow: auto !important;
              }
            }

            .ant-table-fixed-right {
              .ant-table-body-outer {
                .ant-table-body-inner {
                  overflow-x: auto !important;
                }
              }
            }

            .ant-table-fixed-left {
              .ant-table-body-outer {
                .ant-table-body-inner {
                  overflow-x: auto !important;
                }
              }
            }
          }
        }

        .ant-table-cell-scrollbar {
          display: none;
        }
      }
    }
  }
}

.ant-table.ant-table-middle {
  .ant-table-header {
    border-top-right-radius: 16px;
    // .ant-table-thead tr th:nth-last-child(2) {
    //   border-top-right-radius: 16px;

    //   & > div {
    //     border-right: 0 !important;
    //   }
    // }
  }

  .ant-table-thead {
    & > tr {
      & > th {
        padding: 0 !important;
        color: #333;
        border-bottom: 1px solid #ddd;
        background: #f7fbff;

        &:nth-last-child(2).ant-table-column-has-sorters {
          padding-right: 10px !important;
        }

        &:first-child {
          border-top-left-radius: 16px !important;
        }

        &:last-child {
          border-top-right-radius: 16px !important;

          & > div {
            border-right: 0 !important;
          }
        }
      }

      th::before {
        display: none;
      }
    }

    .ant-table-selection {
      display: block;
      height: 20px;
      margin: 15px 0;
      border-right: 1px solid #ddd;
    }
  }

  .ant-table-row-expand-icon {
    border-color: #ddd;
  }

  .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
    padding: 10px 8px 0;
    margin: 0 !important;
    max-height: 300px;
    height: auto;

    .ant-table-container {
      height: 100%;
    }
  }

  .ant-table-expanded-row-fixed {
    width: auto !important;
  }
}

.ant-table .ant-table-container::after {
  width: 1px;
  background: #f0f2f5;
}
