/* DeviceView brand tokens - see /DeviceView_Test_System_Plan.md and the
   branding guidelines doc this was built from for the source values. */
:root {
  --color-bg: #f2ede4;
  --color-panel: #ffffff;
  --color-sidebar: #ece7de;
  --color-border: rgba(0, 0, 0, 0.09);
  --color-text: #1a1435;
  --color-muted: #6b6a78;
  --color-primary: #f97316;
  --color-primary-dark: #ea6c0a;
  --color-primary-pressed: #d9620a;
  --color-primary-tint: rgba(249, 115, 22, 0.12);
  --color-pass: #1a9e5c;
  --color-fail: #d1453b;
  --color-pending: #b6bcc7;
  --radius-card: 12px;
  --radius-btn: 9px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}

.topbar-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.4px;
  color: var(--color-text);
}

#app {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

h1, h2, h3 {
  margin-top: 0;
  font-weight: 800;
  letter-spacing: -0.4px;
}

h1 { font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.8px; }

section { margin-bottom: 40px; }

.panel {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}

/* Suites */

.suite-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.suite-card-header h3 { margin-bottom: 4px; }

.suite-run-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Collapsible test case tree */

details.tree-type, details.tree-platform {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  padding: 4px 16px;
}

details.tree-type summary, details.tree-platform summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}

details.tree-type summary::-webkit-details-marker,
details.tree-platform summary::-webkit-details-marker { display: none; }

details.tree-type summary::before,
details.tree-platform summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}

details[open].tree-type > summary::before,
details[open].tree-platform > summary::before {
  transform: rotate(90deg);
}

.tree-type-body { padding: 4px 0 12px 12px; }
.tree-platform-body { padding: 4px 0 12px 0; }

.test-case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  margin-bottom: 8px;
  background: var(--color-panel);
}

.test-case-row .tc-title {
  font-weight: 500;
}

.tc-id {
  color: var(--color-muted);
  font-size: 12px;
  margin-right: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-coming-soon {
  background: var(--color-sidebar);
  color: var(--color-muted);
}

button.primary {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

button.primary:hover { background: var(--color-primary-dark); }
button.primary:active { background: var(--color-primary-pressed); }

button.secondary {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

button.secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 14px;
}

input[type="text"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-family: inherit;
  background: var(--color-panel);
  color: var(--color-text);
}

textarea { min-height: 80px; }

.run-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.run-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--color-sidebar);
}

.run-main {
  flex: 1;
}

.progress-line {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-size: 13px;
}

.queue-item:hover { background: rgba(0,0,0,0.04); }

.queue-item.current { background: var(--color-primary-tint); }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.pending { background: var(--color-pending); }
.status-dot.pass { background: var(--color-pass); }
.status-dot.fail { background: var(--color-fail); }

.steps-list, .preconditions-list {
  padding-left: 20px;
}

.result-toggle {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.result-toggle label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin: 0;
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  cursor: pointer;
}

.result-toggle input { margin: 0; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.status-banner {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  font-size: 13px;
}

.status-banner.info { background: var(--color-sidebar); color: var(--color-text); }
.status-banner.success { background: #e5f7ee; color: var(--color-pass); }
.status-banner.error { background: #fbeceb; color: var(--color-fail); }

.summary-box {
  text-align: center;
  padding: 40px 20px;
}

.muted { color: var(--color-muted); font-size: 13px; }
