/* Statistics Page Styles */

.stats-main {
  padding: var(--space-lg) var(--space-md);
  min-height: calc(100vh - 120px);
}

/* Overview Cards */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card h3 {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-big {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-primary);
  display: block;
}

/* Game Statistics Section */
.game-stats-section {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-light);
}

.game-stats-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.game-stat-card {
  background-color: var(--bg-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.game-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.game-stat-icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
}

.game-stat-card h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
}

.game-stat-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.game-stat-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
}

.game-stat-item span:first-child {
  color: var(--text-secondary);
}

.game-stat-item span:last-child {
  color: var(--color-primary);
  font-weight: 600;
}

.no-game-stats {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-xl);
}

/* Chart Container */
.chart-container {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-light);
}

.chart-container h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.chart-placeholder {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#progressChart {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* Mistyped Keys Section */
.mistyped-section {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-light);
}

.mistyped-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.mistyped-keys {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.mistyped-key {
  background-color: var(--color-error);
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.mistyped-count {
  background-color: var(--color-error);
  color: white;
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.no-mistyped {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-lg);
}

/* Achievements Section */
.achievements-section {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-light);
}

.achievements-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.achievement-badge {
  background-color: var(--bg-surface);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.achievement-badge.unlocked {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--color-success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.achievement-badge.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-sm);
  display: block;
}

.achievement-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.achievement-desc {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.4;
}

.no-achievements {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-lg);
  grid-column: 1 / -1;
}

/* Stats Actions */
.stats-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Progress Chart Styles */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-wpm { background-color: var(--color-primary); }
.legend-accuracy { background-color: var(--color-success); }

/* Empty state */
.empty-stats {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-muted);
}

.empty-stats h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.empty-stats p {
  margin-bottom: var(--space-xl);
}

/* Review specific styles */
.review-form-container {
  background-color: var(--bg-primary);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border-light);
}

.review-note {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.review-form {
  max-width: none;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}

.star {
  font-size: var(--font-size-xl);
  color: var(--color-gray-300);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.star:hover,
.star.filled {
  color: var(--color-accent);
  transform: scale(1.1);
}

.star.filled {
  color: #fbbf24;
}

/* Reviews List */
.reviews-container {
  max-width: 800px;
  margin: 0 auto;
}

.reviews-list {
  display: grid;
  gap: var(--space-md);
}

.review-item {
  background-color: var(--bg-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.review-author {
  font-weight: 600;
  color: var(--text-primary);
}

.review-rating {
  color: #fbbf24;
}

.review-date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.review-comment {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.no-reviews {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-xl);
}

/* Success message */
.success-message {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: var(--space-lg);
  font-weight: 500;
}