/**
 * Community Statistics Styles
 * Styles for GitHub statistics display on the homepage
 */

/* Community stats container */
.community-stats {
  margin: 32px 0;
  padding: 24px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
}

.community-stats h2 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--md-primary-fg-color);
}

/* Loading Skeleton */
.stats-loading {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--md-default-fg-color--lightest) 25%,
    var(--md-default-fg-color--lighter) 50%,
    var(--md-default-fg-color--lightest) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 20px;
  width: 100%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 20px;
  background: var(--md-code-bg-color);
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 2em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--md-accent-fg-color);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--md-default-fg-color--light);
  font-size: 0.9em;
}

/* Contributors section */
.contributors-section {
  margin-top: 32px;
}

.contributors-section h3 {
  margin-bottom: 16px;
  font-size: 1.2em;
}

.contributors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.contributor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  border: 2px solid var(--md-default-fg-color--lightest);
}

.contributor-avatar:hover {
  transform: scale(1.15);
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.contributors-count {
  margin-top: 12px;
  font-size: 0.9em;
  color: var(--md-default-fg-color--light);
}

/* Activity section */
.activity-section {
  margin-top: 32px;
  padding: 20px;
  background: var(--md-code-bg-color);
  border-radius: 8px;
}

.activity-section h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2em;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: 1.5em;
  color: var(--md-primary-fg-color);
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 0.85em;
  color: var(--md-default-fg-color--light);
}

/* Call to action */
.community-cta {
  margin-top: 32px;
  padding: 24px;
  background: linear-gradient(135deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
  border-radius: 12px;
  text-align: center;
  color: white;
}

.community-cta h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: white;
}

.community-cta p {
  margin-bottom: 20px;
  opacity: 0.95;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: var(--md-primary-fg-color);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .community-stats {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 2em;
  }
  
  .contributor-avatar {
    width: 40px;
    height: 40px;
  }
  
  .contributors-list {
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  .community-stats {
    padding: 16px;
    margin: 16px 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-icon {
    font-size: 1.5em;
  }
  
  .stat-value {
    font-size: 1.75em;
  }
  
  .contributor-avatar {
    width: 36px;
    height: 36px;
  }
  
  .activity-section {
    padding: 16px;
  }
  
  .community-cta {
    padding: 20px;
  }
}

/* Dark Mode Adjustments */
[data-md-color-scheme="slate"] .community-stats {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-md-color-scheme="slate"] .stat-card,
[data-md-color-scheme="slate"] .activity-section {
  background: rgba(255, 255, 255, 0.03);
}

[data-md-color-scheme="slate"] .stat-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Print styles */
@media print {
  .community-cta {
    display: none !important;
  }
  
  .community-stats {
    break-inside: avoid;
  }
}
