/* Data Viewer & QA Tool styles */

/* Navigation links */
.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Viewer navigation */
.viewer-nav {
  margin-bottom: 20px;
}

.nav-selectors {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.selector-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selector-group label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.selector-group select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  min-width: 220px;
}

.selector-group select:disabled {
  opacity: 0.5;
}

/* Session badges */
.session-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.session-badge {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.session-badge:hover {
  border-color: var(--accent);
  color: var(--text);
}

.session-badge.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Data availability bar */
.data-availability {
  margin-bottom: 16px;
}

.avail-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.avail-item {
  font-size: 12px;
  font-weight: 500;
}

.avail-yes { color: var(--green); }
.avail-no { color: var(--text-muted); opacity: 0.5; }

/* Data type tabs */
.data-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}

.data-tab {
  padding: 6px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.data-tab:hover { color: var(--text); background: var(--surface-hover); }
.data-tab.active { color: var(--text); background: var(--accent); }

/* Session context bar */
.session-context {
  margin-bottom: 16px;
}

.ctx-bar {
  font-size: 14px;
  color: var(--text-muted);
}

.ctx-year { color: var(--accent); font-weight: 600; }
.ctx-meeting { color: var(--text); font-weight: 500; }
.ctx-session { color: var(--green); font-weight: 600; }
.ctx-sep { margin: 0 8px; color: var(--border); }

/* FIA-style data table */
.fia-table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.fia-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}

.fia-table th,
.fia-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.fia-table th {
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.fia-table tr:last-child td { border-bottom: none; }

.fia-table tr:hover {
  background: var(--surface-hover);
}

/* Column styles */
.col-pos { text-align: center; font-weight: 700; width: 50px; }
.col-no { text-align: center; width: 50px; color: var(--text-muted); }
.col-grid { text-align: center; }
.col-laps { text-align: center; }
.col-time { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.col-fl { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

.driver-code {
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}

/* Fastest lap awarded */
.fl-awarded {
  color: #a855f7;
  font-weight: 600;
}

/* Status badges */
.status-finished { color: var(--green); }
.status-retired { color: var(--red); }
.status-dsq { color: var(--amber); font-weight: 600; }

/* Compound dot */
.compound-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Race control categories */
.rcm-cat {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.rcm-safety { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.rcm-penalty { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.rcm-msg { white-space: normal; max-width: 500px; }

/* Pit lap highlight */
.pit-lap { background: rgba(245, 158, 11, 0.05); }

/* Positions table */
.positions-table th,
.positions-table td {
  text-align: center;
  padding: 4px 6px;
  font-size: 11px;
  min-width: 32px;
}

.positions-table .sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  text-align: left;
  font-weight: 600;
  padding: 4px 10px;
}

.positions-table thead .sticky-col {
  background: var(--surface-hover);
}

/* Lap driver selector */
.lap-driver-select {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lap-driver-select label {
  color: var(--text-muted);
  font-size: 13px;
}

.lap-driver-select select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.lap-count {
  color: var(--text-muted);
  font-size: 12px;
}

/* QA Tool */
.qa-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 600px;
}

.qa-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.qa-panel-header {
  padding: 10px 16px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qa-panel-body {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.qa-panel-body iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
}

.qa-panel-body .fia-table-wrapper {
  border: none;
  border-radius: 0;
}

/* QA controls */
.qa-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.qa-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.qa-btn:hover { border-color: var(--accent); }

.qa-btn-verify {
  border-color: var(--green);
  color: var(--green);
}
.qa-btn-verify:hover {
  background: var(--green);
  color: #fff;
}

.qa-btn-flag {
  border-color: var(--red);
  color: var(--red);
}
.qa-btn-flag:hover {
  background: var(--red);
  color: #fff;
}

.qa-btn-random {
  border-color: var(--amber);
  color: var(--amber);
}
.qa-btn-random:hover {
  background: var(--amber);
  color: #fff;
}

.qa-status {
  font-size: 12px;
  color: var(--text-muted);
}

/* PDF placeholder */
.pdf-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}

.pdf-placeholder p {
  max-width: 300px;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
  .qa-layout {
    grid-template-columns: 1fr;
  }
  .nav-selectors {
    flex-direction: column;
  }
}
