/* Statistiken - Mobile-First Styles */

/* Info Cards Grid */
.stats-page .info-card {
  background: linear-gradient(145deg, var(--color-bg-card), var(--color-bg));
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.stats-page .info-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.stats-page .info-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stats-page .info-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chart Cards */
.stats-page .chart-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
  margin-bottom: var(--space-md);
}

.stats-page .chart-card:hover {
  box-shadow: var(--shadow-md);
}

.stats-page .chart-card h4 {
  margin-bottom: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.stats-page .chart-card canvas {
  min-height: 200px;
  max-height: 350px;
  height: 100%;
  width: 100%;
}

/* Tables */
.stats-page .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.stats-page .table th,
.stats-page .table td {
  padding: var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.stats-page .table th {
  font-weight: 600;
  background: var(--color-bg);
}

.stats-page .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

html.dark .stats-page .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Responsive table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-md);
}

/* Alert */
.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

/* Nachnamen Cloud */
.nachnamen-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.nachname {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-sm);
  background: var(--color-bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
  cursor: pointer;
  margin: var(--space-xs);
  white-space: nowrap;
}

.nachname:hover {
  transform: scale(1.05);
  background: rgba(59, 130, 246, 0.1);
}

.top-nachname {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-text);
  font-weight: 600;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.nachname-zahl {
  opacity: 0.6;
  font-weight: 400;
  font-size: 0.9em;
  margin-top: 0.2em;
}

/* Chart container for large charts */
.chart-container {
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#chartKindergruppen {
  width: 100%;
  min-width: 600px;
  max-width: none;
  height: 400px;
}

/* Desktop adjustments */
@media (min-width: 768px) {
  .stats-page .info-value {
    font-size: 2rem;
  }

  .stats-page .chart-card canvas {
    min-height: 280px;
    max-height: 450px;
  }

  #chartKindergruppen {
    min-width: 900px;
    height: 500px;
  }
}

@media (min-width: 1024px) {
  .stats-page .info-value {
    font-size: 2.2rem;
  }

  #chartKindergruppen {
    min-width: 1100px;
    height: 550px;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nachname {
  animation: fadeIn 0.4s ease-in-out;
}
