@import url("../../../assets/css/variables.css");

.i6table {
  overflow-x: auto;
  padding: 2px;
}

.i6table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95em;
  color: var(--text-color);
  background-color: var(--white-color);
  border-radius: 6px;
  box-shadow: 0 6px 20px var(--table-box-shadow-color);
  overflow: hidden;
}

.i6table thead tr {
  background-color: var(--table-header-background-color);
  color: var(--white-color);
  text-align: left;
}

.i6table th,
.i6table td {
  padding: 18px 22px;
  border-bottom: 1px solid var(--grey-lightest-color);
  text-align: left;
}

.i6table th {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.5px;
}

.i6table tbody tr {
  transition: background-color 0.25s ease-in-out;
}

.i6table tbody tr:last-of-type td {
  border-bottom: none;
}

.i6table tbody tr:hover {
  background-color: var(--background-color-light-2);
}

.i6table tbody tr.active-row {
  font-weight: 600;
  color: var(--table-row-active-text-color);
  background-color: var(--table-row-active-background-color);
}

.i6table tfoot td {
  padding: 0rem 1.4rem 1rem;
  text-align: left;
  font-weight: 500;
}

.i6table tbody tr[data-status="ERROR"],
.i6table tbody tr[data-status="ERROR"]:hover {
  background-color: var(--table-error-background-color);
}

.i6table tbody tr[data-status="QUEUED"],
.i6table tbody tr[data-status="QUEUED"]:hover {
  background-color: var(--table-queued-background-color);
}

.i6table tbody tr[data-status="STEP"],
.i6table tbody tr[data-status="STEP"]:hover {
  background-color: var(--table-step-background-color);
}

.i6table tbody tr[data-status="SUCCESS"],
.i6table tbody tr[data-status="SUCCESS"]:hover {
  background-color: var(--table-success-background-color);
}

@media (max-width: 768px) {
  .i6table table,
  .i6table thead,
  .i6table tbody,
  .i6table tfoot,
  .i6table tr,
  .i6table th,
  .i6table td {
    display: block;
    width: 100%;
  }

  .i6table thead {
    display: none;
  }

  .i6table table {
    font-size: 0.88em;
  }

  .i6table tbody tr,
  .i6table tfoot tr {
    margin-bottom: 12px;
    border: 1px solid var(--grey-lightest-color);
    border-radius: 8px;
    overflow: hidden;
  }

  .i6table tbody tr:last-of-type {
    margin-bottom: 0;
  }

  .i6table th,
  .i6table td {
    /* higher-specificity per-view rules (e.g. .signalreports-parent .i6table td) would otherwise override this */
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    border-bottom: 1px solid var(--grey-lightest-color);
  }

  .i6table tbody tr td:last-child,
  .i6table tbody tr:last-of-type td {
    border-bottom: none;
  }

  .i6table td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7em;
    letter-spacing: 0.5px;
    color: var(--text-color-medium);
    text-align: left;
  }

  .i6table td:not([data-label]) {
    text-align: left;
  }
}
