/* Copyright (c) 2025 Antmicro <www.antmicro.com> */

/* SPDX-License-Identifier: Apache-2.0 */

/* All views: initial background and text color */

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap");

:root {
  --bg-primary: #09090b;
  --bg-secondary: #27272a;
  --bg-tetriary: #18181b;
  --text-primary: #fafafa;
  --text-muted: #a1a1aa;
  --border-primary: #27272a;
  --border-hover: #3f3f46;
  --accent-primary: #00d0c9;
  --accent-border: #00d0c999;
  --accent-background: #042f2e;
  --danger-primary: #ef4444;
  --danger-background: #450a0a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  position: relative;
  font-weight: normal;
}

body {
  color: var(--text-primary);
  background-color: var(--bg-primary);
  padding: 0;
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.5;
}

h3 {
  font-size: 2rem;
  text-align: left;
  padding-bottom: 1rem;
}

/* All views: standard link format*/
a:link {
  color: var(--accent-primary);
  text-decoration: none;
  font-family: "Inter", sans-serif;
}

/* All views: standard link - visited format */
a:visited {
  color: var(--accent-primary);
  text-decoration: none;
  font-family: "Inter", sans-serif;
}

/* All views: standard link - activated format */
a:active {
  color: var(--accent-primary);
  text-decoration: none;
  font-family: "Inter", sans-serif;
}

center {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
  border-radius: 8px;
}

.table-wrapper table {
  border: 1px solid var(--border-primary);
  margin-bottom: 0;
}

th {
  border: none;
  background-color: var(--bg-tetriary);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
}

td {
  color: var(--text-primary);
  align-items: center;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td > b {
  font-weight: bold;
}

/* Enable border on all centered tables aside from the info table */
body > center > table:not(.info-table) td:not(.coverBarOutline) {
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body > center > table:not(.info-table) tr:not(.covDescHeader):hover {
  background-color: rgba(255, 255, 255, 0.02);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 800px;
  background-color: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0;
}

/* Background for the title navbar */
table.title-header-shadow {
  border: 1px solid var(--border-primary);
  background-color: transparent;
  color: var(--text-primary);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

/* Table with logo & title */
table.title-header {
  color: var(--text-primary);
  text-align: left;
  align-items: center;
  background-color: transparent;
}

/* Title on the top navbar */
td.title {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: left;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Info table (Test metadata) */
table.info-table {
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

td.headerInfo {
  text-align: right;
  padding-right: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td.headerInfoValue {
  text-align: left;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
}

td.headerCovSummary {
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td.headerCovSummary.rowLeft {
  text-align: right;
}

td.headerCovSummary.colTop {
  text-align: center;
}

td.headerCovSummaryEntry {
  border-radius: 4px;
  text-align: center;
  color: var(--text-primary);
  background-color: var(--bg-tetriary);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-primary);
}

tr.covDescHeader {
  color: var(--text-primary);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  background-color: var(--bg-tetriary);
}

td.headerCovDesc {
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td.headerCovSubDesc {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.875rem;
}

/* All views: color of horizontal ruler */
td.ruler > img {
  height: 1px;
  width: 100%;
  background-color: var(--border-primary);
  aspect-ratio: 1 / 1;
}

/* Cleanup required */

/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0):
Newly added code is not tested" */
td.tlaUNC {
  text-align: right;
  background-color: #ff6230;
}

td.tlaBgUNC {
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0):
Newly added code is not tested" */
span.tlaUNC {
  text-align: left;
  background-color: #ff6230;
}

span.tlaBgUNC {
  background-color: #ff6230;
}

a.tlaBgUNC {
  background-color: #ff6230;
  color: #000000;
}

td.headerCovTableHeadUNC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0):
Unchanged code is no longer tested" */
td.tlaLBC {
  text-align: right;
  background-color: #ff6230;
}

td.tlaBgLBC {
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0):
Unchanged code is no longer tested" */
span.tlaLBC {
  text-align: left;
  background-color: #ff6230;
}

span.tlaBgLBC {
  background-color: #ff6230;
}

a.tlaBgLBC {
  background-color: #ff6230;
  color: #000000;
}

td.headerCovTableHeadLBC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0):
Previously unused code is untested" */
td.tlaUIC {
  text-align: right;
  background-color: #ff6230;
}

td.tlaBgUIC {
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0):
Previously unused code is untested" */
span.tlaUIC {
  text-align: left;
  background-color: #ff6230;
}

span.tlaBgUIC {
  background-color: #ff6230;
}

a.tlaBgUIC {
  background-color: #ff6230;
  color: #000000;
}

td.headerCovTableHeadUIC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0):
Unchanged code was untested before, is untested now" */
td.tlaUBC {
  text-align: right;
  background-color: #ff6230;
}

td.tlaBgUBC {
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0):
Unchanged code was untested before, is untested now" */
span.tlaUBC {
  text-align: left;
  background-color: #ff6230;
}

span.tlaBgUBC {
  background-color: #ff6230;
}

a.tlaBgUBC {
  background-color: #ff6230;
  color: #000000;
}

td.headerCovTableHeadUBC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ff6230;
}

/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1):
Unchanged code is tested now" */
td.tlaGBC {
  text-align: right;
  background-color: #8b8d8e;
}

td.tlaBgGBC {
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1):
Unchanged code is tested now" */
span.tlaGBC {
  text-align: left;
  background-color: #8b8d8e;
}

span.tlaBgGBC {
  background-color: #8b8d8e;
}

a.tlaBgGBC {
  background-color: #8b8d8e;
  color: #000000;
}

td.headerCovTableHeadGBC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1):
Previously unused code is tested now" */
td.tlaGIC {
  text-align: right;
  background-color: #8b8d8e;
}

td.tlaBgGIC {
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1):
Previously unused code is tested now" */
span.tlaGIC {
  text-align: left;
  background-color: #8b8d8e;
}

span.tlaBgGIC {
  background-color: #8b8d8e;
}

a.tlaBgGIC {
  background-color: #8b8d8e;
  color: #000000;
}

td.headerCovTableHeadGIC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1):
Newly added code is tested" */
td.tlaGNC {
  text-align: right;
  background-color: #8b8d8e;
}

td.tlaBgGNC {
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1):
Newly added code is tested" */
span.tlaGNC {
  text-align: left;
  background-color: #8b8d8e;
}

span.tlaBgGNC {
  background-color: #8b8d8e;
}

a.tlaBgGNC {
  background-color: #8b8d8e;
  color: #000000;
}

td.headerCovTableHeadGNC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1):
Unchanged code was tested before and is still tested" */
td.tlaCBC {
  text-align: right;
  background-color: #8b8d8e;
}

td.tlaBgCBC {
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1):
Unchanged code was tested before and is still tested" */
span.tlaCBC {
  text-align: left;
  background-color: #8b8d8e;
}

span.tlaBgCBC {
  background-color: #8b8d8e;
}

a.tlaBgCBC {
  background-color: #8b8d8e;
  color: #000000;
}

td.headerCovTableHeadCBC {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #8b8d8e;
}

/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #):
Previously untested code is unused now" */
td.tlaEUB {
  text-align: right;
  background-color: #ffffff;
}

td.tlaBgEUB {
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #):
Previously untested code is unused now" */
span.tlaEUB {
  text-align: left;
  background-color: #ffffff;
}

span.tlaBgEUB {
  background-color: #ffffff;
}

a.tlaBgEUB {
  background-color: #ffffff;
  color: #000000;
}

td.headerCovTableHeadEUB {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #):
Previously tested code is unused now" */
td.tlaECB {
  text-align: right;
  background-color: #ffffff;
}

td.tlaBgECB {
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #):
Previously tested code is unused now" */
span.tlaECB {
  text-align: left;
  background-color: #ffffff;
}

span.tlaBgECB {
  background-color: #ffffff;
}

a.tlaBgECB {
  background-color: #ffffff;
  color: #000000;
}

td.headerCovTableHeadECB {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -):
Previously untested code has been deleted" */
td.tlaDUB {
  text-align: right;
  background-color: #ffffff;
}

td.tlaBgDUB {
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -):
Previously untested code has been deleted" */
span.tlaDUB {
  text-align: left;
  background-color: #ffffff;
}

span.tlaBgDUB {
  background-color: #ffffff;
}

a.tlaBgDUB {
  background-color: #ffffff;
  color: #000000;
}

td.headerCovTableHeadDUB {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -):
Previously untested code has been deleted" */
td.tlaDCB {
  text-align: right;
  background-color: #ffffff;
}

td.tlaBgDCB {
  background-color: #ffffff;
}

/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -):
Previously untested code has been deleted" */
span.tlaDCB {
  text-align: left;
  background-color: #ffffff;
}

span.tlaBgDCB {
  background-color: #ffffff;
}

a.tlaBgDCB {
  background-color: #ffffff;
  color: #000000;
}

td.headerCovTableHeadDCB {
  text-align: center;
  padding-right: 6px;
  padding-left: 6px;
  padding-bottom: 0px;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
  background-color: #ffffff;
}

/* Source code view: format for date/owner bin that is not hit */
span.missBins {
  background-color: #ff0000;
  /* red */
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  center {
    padding: 1rem;
  }

  table {
    min-width: 600px;
  }

  th,
  td {
    padding: 0.625rem 0.875rem;
  }
}

@media (max-width: 768px) {
  center {
    padding: 0.75rem;
  }

  table {
    min-width: 480px;
  }

  th {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  td.title {
    font-size: 1.25rem;
    gap: 0.25rem;
  }

  /* Info table adjustments */
  table.info-table {
    padding: 0.75rem;
    font-size: 0.8125rem;
  }

  td.headerInfo {
    padding-right: 0.75rem;
    font-size: 0.75rem;
  }

  td.headerInfoValue {
    font-size: 0.8125rem;
  }

  /* Coverage summary adjustments */
  td.headerCovSummary {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  td.headerCovSummaryEntry {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }

  /* Header descriptions */
  td.headerCovDesc {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  td.headerCovSubDesc {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  center {
    padding: 0.5rem;
  }

  table {
    min-width: 400px;
  }

  th {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  td {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  td.title {
    font-size: 1.125rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* Title header adjustments */
  table.title-header-shadow {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
  }

  /* Info table mobile */
  table.info-table {
    padding: 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 1rem;
  }

  td.headerInfo {
    padding-right: 0.5rem;
    font-size: 0.75rem;
  }

  td.headerInfoValue {
    font-size: 0.75rem;
  }

  /* Coverage summary mobile */
  td.headerCovSummary {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  td.headerCovSummaryEntry {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  /* Header descriptions mobile */
  td.headerCovDesc {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }

  td.headerCovSubDesc {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  /* Coverage table headers mobile */
  td.headerCovTableHeadUNC,
  td.headerCovTableHeadLBC,
  td.headerCovTableHeadUIC,
  td.headerCovTableHeadUBC,
  td.headerCovTableHeadGBC,
  td.headerCovTableHeadGIC,
  td.headerCovTableHeadGNC,
  td.headerCovTableHeadCBC,
  td.headerCovTableHeadEUB,
  td.headerCovTableHeadECB,
  td.headerCovTableHeadDUB,
  td.headerCovTableHeadDCB {
    padding: 0.25rem 0.375rem;
  }
}
