/* Simple CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Root variables for colors and fonts */
:root {
  --background-color: #f0f2f5;
  --text-color: #1c1e21;
  --primary-color: #0866ff;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Base body styles */
body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 14px;
}

header,
footer {
  background-color: var(--header-bg);
  padding: 0.25rem 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.hidden {
  display: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h1 {
  font-size: 1.25rem;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.test-counts {
  display: flex;
  gap: 0.75rem;
}

.test-counts span {
  font-size: 0.85rem;
  color: #606770;
}

.player-selector {
  display: flex;
  align-items: center;
}

.btn-group {
  display: flex;
}

.btn-group .btn {
  background-color: #e4e6eb;
  border: 1px solid #ccd0d5;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #4b4f56;
  transition: background-color 0.2s, border-color 0.2s;
  border-radius: 0;
}

.btn-group .btn:hover {
  background-color: #dcdfe3;
}

.btn-group .btn:not(:last-child) {
  border-right: none;
}

.btn-group .btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  z-index: 2;
  position: relative;
}


main {
  flex-grow: 1;
  padding: 0.5rem;
}

.report-box {
  background-color: var(--header-bg);
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
  border: 1px solid #ddd;
}

.report-box[open] summary {
  border-bottom: 1px solid #ddd;
}

summary {
  padding: 0.25rem 0.5rem;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none; /* Remove default arrow */
  display: flex;
  align-items: center;
}

.hls-report-summary > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  flex-grow: 1;
  padding-right: 10px;
}

.result-group {
  display: flex;
  gap: 5px;
  width: 270px; /* Fixed width for the group of results */
  flex-shrink: 0;
}

.result, .result-header {
  flex: 1;
  text-align: center;
  padding: 3px 6px;
}

.hls-report-header {
  font-weight: bold;
  background-color: #d1d5db;
}

.hls-report-header .hls-report-summary {
  padding: 0 1rem;
}

.test-name-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

#test-filter {
  width: 200px;
  padding: 4px 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
}

#run-all-tests-btn {
  padding: 4px 8px;
  font-size: 0.9rem;
}

.run-column-header {
  width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.run-column {
  width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.run-single-test-btn {
  padding: 2px 8px;
  font-size: 0.8rem;
}

.hls-report-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.result-group {
  display: flex;
  gap: 5px;
}

.result {
  padding: 3px 6px;
  border-radius: 0;
  font-weight: bold;
  font-size: 0.8em;
}

.result.pass { background-color: #28a745; }
.result.fail { background-color: #dc3545; }
.result.running {
  background-color: #ffc107;
  color: #333;
}
.result.not-run {
  background-color: #6c757d;
  color: white;
}

.report-body {
  padding: 10px;
  border-top: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-results {
  border: 1px solid #ccc;
  border-radius: 0;
  padding: 8px;
}

.player-results h4 {
  margin-top: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.player-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.player-result-header h4 {
  margin: 0;
  border: none;
  padding: 0;
}

.player-result-header div {
  display: flex;
  gap: 8px;
}

.open-in-new-tab-btn, .rerun-btn {
  padding: 2px 6px;
  font-size: 0.75em;
  cursor: pointer;
}



.report-body h4 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.report-body pre {
  background-color: #f8f9fa;
  border: 1px solid #eee;
  padding: 0.25rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.8rem;
}

.report-body canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
}

.tab-bar {
  display: flex;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border: none;
  background-color: transparent;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
}

.tab-btn.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: bold;
}

.tab-pane {
  display: none;
  padding-top: 0.5rem;
}

.tab-pane.active {
  display: block;
}
