/* Race page specific styles */
.race-header {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.race-info {
  flex: 1;
}

.race-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.race-details {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 12px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: help;
  transition: var(--transition);
  vertical-align: middle;
  line-height: 1;
}

.info-button:hover {
  background: var(--accent-primary);
  color: white;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--accent-primary);
}

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}

.position-gold {
  background: rgba(255, 215, 0, 0.15);
  color: #fbbf24;
}

.position-silver {
  background: rgba(192, 192, 192, 0.15);
  color: #e5e7eb;
}

.position-bronze {
  background: rgba(205, 127, 50, 0.15);
  color: #f59e0b;
}

.position-normal {
  background: var(--bg-primary);
  color: var(--text-muted);
}

.driver-name {
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.driver-name:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* Qualifying table column sizing */
#qualifyingContainer table {
  table-layout: auto;
}

#qualifyingContainer td,
#qualifyingContainer th {
  width: auto !important;
}

tbody tr:hover {
  background: var(--bg-tertiary);
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  text-align: center;
}

.loading-spinner::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.error-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.error-message h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .race-details {
    justify-content: center;
  }
}