/* Player page specific styles */
.player-header {
  display: flex;
  align-items: center;
  gap: 24px;
  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);
}

.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
}

.player-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-stats {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-circles {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 18px;
}

.activity-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transition: opacity 0.2s ease;
}

.activity-circle.filled {
  background: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.activity-circle.empty {
  background: var(--border-hover);
  border: 2px solid var(--text-secondary);
  opacity: 0.6;
}

.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);
}

.race-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.race-list-title {
  font-size: 18px;
  font-weight: 600;
}

.race-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.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;
}

td:first-child {
  text-align: center;
}

tbody tr:hover {
  background: var(--bg-tertiary) !important;
}

.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);
}

.track-name {
  font-weight: 500;
}

.track-class {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.date-cell {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.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);
}

/* Pagination styles */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}

.pagination-controls button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-controls span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Rating & Reputation Chart */
.chart-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

#ratingChartContainer {
  min-width: 700px;
}

.chart-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.chart-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-value {
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s ease-out;
  background: linear-gradient(90deg, var(--accent-primary), #f87171);
}

.progress-fill.reputation {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.chart-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .player-header {
    flex-direction: column;
    text-align: center;
  }

  .player-stats {
    justify-content: center;
  }
  
  .chart-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}