/* ── Stats Grid ─────────────────────────────────────────────────────────── */
#stats-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  width: 100% !important;
}

.stat-item {
  flex: 0 0 calc(20% - 1rem);
  min-width: 170px;
  display: flex;
  /* staggered entrance via --i set on each card */
  animation: statRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms);
}

@keyframes statRise {
  from { opacity: 0; transform: translateY(36px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Card shell ──────────────────────────────────────────────────────────── */
.stat-item .item {
  --clr:     #2196F3;
  --clr-rgb: 33, 150, 243;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  border: none;
  /* spring bounce on hover */
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease;
  position: relative;
}

.stat-item .item:hover {
  transform: translateY(-14px) scale(1.02);
  box-shadow: 0 28px 56px rgba(var(--clr-rgb), 0.30);
}

/* ── Coloured top section ─────────────────────────────────────────────── */
.stat-card-top {
  background: var(--clr);
  padding: 16px 0 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* inner highlight shimmer */
.stat-card-top::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.22) 0%, transparent 55%);
  pointer-events: none;
}

/* curved white wave cutout */
.stat-card-top::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: -20%;
  width: 140%;
  height: 36px;
  background: #fff;
  border-radius: 50%;
}

/* ── Icon circle ─────────────────────────────────────────────────────────── */
.stat-icon-wrap {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease;
  /* subtle ring pulse on page load */
  animation: iconPulse 2.4s ease-out both;
  animation-delay: calc(var(--i, 0) * 110ms + 500ms);
}

@keyframes iconPulse {
  0%   { box-shadow: 0 0 0 0   rgba(255,255,255,0.5); }
  60%  { box-shadow: 0 0 0 14px rgba(255,255,255,0);   }
  100% { box-shadow: 0 0 0 0   rgba(255,255,255,0);    }
}

.stat-item .item:hover .stat-icon-wrap {
  transform: scale(1.12) rotate(-4deg);
  background: rgba(255, 255, 255, 0.35);
}

/* ── Card body ──────────────────────────────────────────────────────────── */
.stat-card-body {
  flex: 1;
  padding: 2px 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-item .count-outer {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--clr);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 0;
}

.stat-item .count-text {
  color: var(--clr);
}

.stat-item .count-plus {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--clr);
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}

.stat-item .counter-title {
  font-size: 0.70rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 5px;
  line-height: 1.3;
}

/* expanding accent underline */
.stat-accent-line {
  height: 2px;
  background: var(--clr);
  border-radius: 99px;
  width: 24px;
  margin-top: 8px;
  opacity: 0.45;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}

.stat-item .item:hover .stat-accent-line {
  width: 64px;
  opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-item { flex: 0 0 calc(33.333% - 1rem); }
}

@media (max-width: 768px) {
  .stat-item {
    flex: 0 0 calc(50% - 1rem);
    min-width: 148px;
  }
  .stat-card-top { padding: 12px 0 30px; }
  .stat-icon-wrap { width: 54px; height: 54px; }
  .stat-icon-wrap img { height: 32px !important; width: 32px !important; }
  .stat-item .count-outer { font-size: 2rem; letter-spacing: -1px; }
}

@media (max-width: 576px) {
  .stat-item { flex: 0 0 100%; max-width: 100%; }
  .stat-item .item { max-width: 82%; margin: 0 auto; }
  .stat-item .count-outer { font-size: 1.8rem; }
}
