/*
====================================================================
BattleScore
File: /testing/web/assets/testing.css

Purpose:
  Styling for the BattleScore test runner UI.

Notes:
  - Dev-only utility UI
  - Optimised for clarity over brand polish

Change Log:
  2026-04-20 - Initial version.
====================================================================
*/

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #f4f7fb;
  color: #1f2937;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

.page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
}

.subhead {
  color: #6b7280;
  font-size: 14px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  grid-template-rows: auto auto auto;
  gap: 16px;
}

.manifest-panel {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.runs-panel {
  grid-column: 2;
  grid-row: 1;
}

.detail-panel {
  grid-column: 2;
  grid-row: 2;
}

.output-panel {
  grid-column: 2;
  grid-row: 3;
}

.panel {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(10, 25, 41, 0.04);
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5ebf3;
  background: #f9fbfd;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 16px;
}

.btn {
  border: 1px solid #cfd8e3;
  background: #ffffff;
  color: #1f2937;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.btn:hover {
  background: #f3f6fa;
}

.btn.primary {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

.btn.primary:hover {
  background: #1b46c2;
}

.btn.secondary {
  background: #ffffff;
}

.btn.danger {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

.btn.danger:hover {
  background: #a31818;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.muted {
  color: #6b7280;
}

.manifest-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tree-folder,
.tree-file {
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.tree-folder-header,
.tree-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tree-folder-name,
.tree-file-name {
  font-weight: 700;
  word-break: break-word;
}

.tree-folder-actions,
.tree-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tree-folder-children {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid #e5ebf3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.run-summary {
  margin-bottom: 12px;
}

.recent-runs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.run-card {
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
  cursor: pointer;
}

.run-card:hover {
  background: #f9fbfd;
}

.run-card.selected {
  border-color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #1d4ed8;
}

.run-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.run-card-title {
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.PASS {
  background: #dcfce7;
  color: #166534;
}

.status-pill.FAIL {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.RUNNING {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.ERROR {
  background: #fef3c7;
  color: #92400e;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.meta-card {
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.meta-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 16px;
  font-weight: 700;
}

.group-card {
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f9fbfd;
  border-bottom: 1px solid #e5ebf3;
}

.group-card-body {
  padding: 12px;
}

.test-row {
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #ffffff;
}

.test-row:last-child {
  margin-bottom: 0;
}

.test-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.test-name {
  font-weight: 700;
}

.test-meta {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 8px;
}

.test-block {
  margin-top: 8px;
}

.test-block-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
}

.code-block {
  background: #111827;
  color: #f9fafb;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.execution-output {
  margin: 0;
  background: #111827;
  color: #f9fafb;
  border-radius: 10px;
  padding: 12px;
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.inline-note {
  color: #6b7280;
  font-size: 12px;
  margin-top: 6px;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .manifest-panel,
  .runs-panel,
  .detail-panel,
  .output-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}