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

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

.@{apollo-table-prefix-cls} {
  &-filter-wrapper {
    padding: 16px 16px 0 16px;
  }

  &-setting-wrapper {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
  }

  &-filter-radio .@{ant-prefix}-radio-wrapper {
    display: block;
    margin-right: 0;
    padding: 3px 0;
  }

  &-filter-checkbox .@{ant-prefix}-checkbox-group-item {
    display: block;
    margin: 0;
    padding: 3px 0;
  }

  &-wrapper {
    padding: 16px;

    .@{ant-prefix}-table {
      &-title {
        padding: 0 0 16px 0;
      }

      // scroll y 和 有 title 时，批量操作栏定位问题
      &-content,
      &-header {
        table {
          position: relative;
        }
      }
    }
  }

  &-radio {
    .@{ant-prefix}-radio-wrapper {
      display: block;
      margin-right: 0;
      padding: 3px 0;
    }
  }

  &-sort-title {
    color: #6d7175;
  }

  &-pagination-wrapper {
    margin: 0 0 16px 0;
    text-align: center;
  }

  &-selection-hide-tr {
    visibility: hidden;
  }

  &-selection-bar {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    width: 100%;
    height: 55px;
    background: @table-header-bg;
    border-bottom: 1px solid @table-border-color;
    border-radius: 2px 2px 0 0;
    visibility: visible;

    th {
      display: flex;
      align-items: center;
      padding: 0 !important;
      background: none !important;
      border-bottom: 0 !important;
    }

    .@{ant-prefix}-table-selection {
      margin-left: 10px;
    }

    &-select-all {
      display: flex;
      align-items: center;
      margin-left: 16px;
    }

    &-item-number {
      padding: 6px 0;
      font-weight: 500;

      &-small {
        height: 28px;
        padding: 2px 0;
      }
    }

    &-item-wrapper {
      display: flex;

      .@{apollo-table-prefix-cls}-selection-bar-item {
        > .@{apollo-table-prefix-cls}-selection-bar-item-btn {
          margin-right: -1px;
          border-radius: 0;

          &:hover,
          &:focus {
            z-index: 1;
          }
        }

        &:first-child > .@{apollo-table-prefix-cls}-selection-bar-item-btn {
          border-top-left-radius: @border-radius-base;
          border-bottom-left-radius: @border-radius-base;
        }

        &:last-child > .@{apollo-table-prefix-cls}-selection-bar-item-btn {
          border-top-right-radius: @border-radius-base;
          border-bottom-right-radius: @border-radius-base;
        }
      }
    }
  }

  &-selected-views-tabs {
    & > .@{ant-prefix}-tabs-nav::before,
    .@{ant-prefix}-tabs-top > div > .@{ant-prefix}-tabs-nav::before {
      border-bottom: 0;
    }

    &.@{ant-prefix}-tabs-top > .@{ant-prefix}-tabs-nav {
      margin: 0;
      padding: 0 16px;
    }
  }

  &-selected-views-tags {
    .@{ant-prefix}-tag {
      margin: 0;
      margin-bottom: 4px;
    }

    .@{ant-prefix}-tag:not(:last-child) {
      margin-right: 8px;
    }
  }

  &-selected-views-button-wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    margin-top: 15px;
  }
}

.@{ant-prefix}-table-small {
  .@{apollo-table-prefix-cls}-selection-bar {
    height: 39px;

    .@{ant-prefix}-table-selection {
      margin-left: 16px;
    }
  }
}

.@{ant-prefix}-table-middle {
  .@{apollo-table-prefix-cls}-selection-bar {
    height: 47px;
  }
}
