@import 'src/mixins/index';

@keyframes load {
  0% {
    background-position: 0 0;
  }
  to {
    background-position: -200% 0;
  }
}

.scrollContainer {
  overflow-x: auto;
  overflow-y: hidden;
}

.table {
  width: 100%;
  min-width: 680px;
  color: chaser-color('Dark Neutral 1');
}

.table.noMargin {
  margin-bottom: 0;
}

.header {
  background-color: chaser-color('Light Neutral 2');
  white-space: nowrap;
  font-size: 14px;
  color: chaser-color('Dark Neutral 1');
}

.header {
  th {
    padding: 0 12px;
    border: 0px;
    text-align: left;
    font-weight: normal;
    color: chaser-color('Mid Neutral 1');
    height: 40px;

    > * {
      vertical-align: middle;
    }
  }

  th:first-child {
    padding-left: 20px;
    border-radius: 6px 0 0 6px;
  }

  th:last-child {
    padding-right: 20px;
    border-radius: 0 6px 6px 0;
  }
}

.row {
  position: relative;
  font-size: 14px;

  &.canExpand {
    cursor: pointer;
    &:hover {
      box-shadow: 0px 2px 5px rgba(90, 97, 105, 0.15);
    }
    @include focusVisibleOutline(4);
  }

  &.expanded {
    background-color: chaser-color('Light Blue 3');
  }

  td {
    padding: 12px;
    height: 60px;
    border-top: none;
    border-bottom: 1px solid chaser-color('Mid Neutral 3');
    vertical-align: middle;

    &.right {
      text-align: right;
    }

    &.center {
      text-align: center;
    }
  }

  td:first-child {
    padding-left: 20px;
  }

  td:last-child {
    padding-right: 20px;
  }
}

.table:not(.borderBottom) .row:last-of-type td {
  border-bottom: none;
}

.noData {
  color: chaser-color('Mid Neutral 1');
  font-size: 13px;
  padding: 32px 20px;
  line-height: 1.5;
  text-align: center;
}

.table.borderBottom :global(.react-bs-table-no-data) {
  border-bottom: 1px solid chaser-color('Mid Neutral 3');
}

.expand {
  width: 100%;
  border-bottom: 1px solid chaser-color('Mid Neutral 3');
}

.expandRow:global(.enter) .expand {
  max-height: 0;
  overflow: hidden;
}
.expandRow:global(.enter-active) .expand {
  max-height: 1000px;
  transition: max-height 2s linear;
}
.expandRow:global(.exit) .expand {
  max-height: 1000px;
}
.expandRow:global(.exit-active) .expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 0.95, 0, 0.95);
}

.placeholder {
  display: inline-block;
  vertical-align: bottom;
  width: 80%;
  height: 18px;
  animation: load 1.5s ease infinite;
  background: linear-gradient(
    90deg,
    chaser-color('Light Neutral 2'),
    chaser-color('Light Neutral 3'),
    chaser-color('Light Neutral 2')
  );
  background-size: 200%;
}
