/* =============================================================================
   STATS.CSS — Animated Counter Stats Bar
   Ilahia Polytechnic College
============================================================================= */

.stats-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  padding: var(--space-16) 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  position: relative;
}

.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: rgba(255,255,255,0.15);
}

.stat-item__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-4);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-item__icon svg {
  width: 26px;
  height: 26px;
  fill: var(--color-accent-light);
}

.stat-item__number {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: var(--space-2);
  animation: counterSpin 0.4s ease;
}

.stat-item__number .counter {
  display: inline-block;
}

.stat-item__number .suffix {
  font-size: var(--fs-3xl);
  color: var(--color-accent-light);
}

.stat-item__label {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.75);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
}

.stat-item__sub {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.5);
  margin-top: var(--space-1);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2)::before {
    /* Keep separator between col 1 and 2 */
  }

  .stat-item:nth-child(3)::before {
    display: none;
  }

  .stat-item:nth-child(4)::before {
    /* Keep separator between col 3 and 4 */
  }

  /* Add row separator */
  .stat-item:nth-child(3),
  .stat-item:nth-child(4) {
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .stat-item__number { font-size: var(--fs-3xl); }
}

@media (max-width: 479px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-item__number { font-size: var(--fs-2xl); }
}
