// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0

@import 'variables';
@import 'typography';
@import 'animations';

$table-header-height: 33px;
$table-header-border-width: 2px;

$shimmer-block-height: 16px;
$shimmer-block-width: 40%;

.ams-table {
  width: 100%;
  max-width: 100%;
  margin-bottom: $spacer-3;
  box-sizing: border-box;
}

.ams-table-header {
  @extend %text-caption-w2;

  color: $text-secondary;
  border-bottom: $table-header-border-width solid $gray15;
}

.ams-table-heading-cell {
  height: $table-header-height;
  text-transform: uppercase;

  &:first-child {
    padding-left: $spacer-3;
  }

  &:last-child {
    padding-right: $spacer-3;
  }
}

.ams-table-cell {
  &:first-child {
    padding-left: $spacer-3;
  }

  &:last-child {
    padding-right: $spacer-3;
  }
}

.ams-table-expanded-row {
  display: none;

  &.is-expanded {
    display: table-row;
  }
}

.ams-table-expanding-button {
  border: 0;
  background-color: white;

  svg {
    vertical-align: bottom;
  }
}

// Loading State
.ams-table-heading-loading-cell {
  padding: $spacer-1;
}

.ams-table-body-loading-cell {
  padding: 0 $spacer-1;

  .shimmer-resource-loader {
    margin-top: -1px;
  }
}

.ams-table-shimmer-block {
  @extend %is-shimmer-animated;

  height: $shimmer-block-height;
  width: $shimmer-block-width;
}

// Empty State
.ams-empty-message-cell {
  @extend %text-body-w3;

  color: $text-primary;
  text-align: center;
}
