$table-font-size: 1rem;
$table-header-font-size: calc(1rem - 2px);

.cuesheetContainer {
  grid-area: table;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding-bottom: 640px; // allow focus to reach last elements
}

.cuesheet {
  font-size: $table-font-size;
  font-weight: 400;

  tr {
    display: flex;
  }

  th,
  td {
    margin: 1px;
    font-weight: inherit;
    font-size: inherit;
    text-align: left;
    position: relative;
    @include ellipsis-overflow;
  }

  th:focus,
  td:focus {
    outline: 2px solid $ui-white;
  }
}

.tableHeader,
.eventRow {
  .actionColumn {
    width: calc(2rem + 0.5rem); // sm button size (--chakra-sizes-8) + 2 * padding
    background-color: transparent;
  }

  .indexColumn {
    display: flex;
    align-items: center;
    justify-content: end;

    min-width: 3em; // allow for 3-digit numbers
    font-size: $table-header-font-size;
    background-color: $gray-1300; // will be overridden inline
  }
}

.tableHeader {
  position: sticky;
  top: 0px;
  z-index: 10;
  background-color: $ui-black;
  font-size: $table-header-font-size;
  color: $label-gray;
}

th {
  background-color: $gray-1300;
  padding-left: 0.25rem;

  &:hover {
    .resizer {
      width: 0.5rem;
    }
  }
}

.eventRow {
  vertical-align: top;

  &:hover {
    outline: 1px solid $blue-700;
    outline-offset: -1px;
  }

  td {
    background-color: $gray-1250;
    border-radius: 2px;
    padding: 0.25rem;
  }

  &.skip {
    text-decoration: line-through;
    opacity: $opacity-disabled !important; // fighting inline styles
  }
}

.blockRow {
  width: 100%;
  background-color: $gray-1350;
  font-size: 1rem;
  height: 2.5rem;

  td {
    align-self: flex-end;
    position: sticky;
    left: 1rem;
    padding: 0.25rem 0;
  }
}

.delayRow {
  width: 100%;
  color: $ontime-delay-text;

  td {
    position: sticky;
    left: 47.5%; // center of the screen, ish
    padding: 0.5rem 0;
    &:first-letter {
      text-transform: uppercase;
    }
  }
}

.check {
  font-size: 1.5rem;
  margin: 0 auto;
}

.delayedTime {
  color: $ontime-delay-text;
  font-size: calc(1rem - 2px);
}

.resizer {
  cursor: col-resize;
  opacity: $opacity-disabled;
  display: inline-block;
  width: 0;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  background-color: $action-blue;

  user-select: none;
  touch-action: none;

  &:hover {
    opacity: 1;
  }
}
