/* ==============================================
   STATS FX SECTION — PREMIUM
   Desktop-only (>= 992px), GPU-geoptimaliseerd
   Gebruikt CSS-vars van hoofdstylesheet
   ============================================== */

/* ——— SECTIE BASIS ——— */
.stats-fx-section {
  display: none; /* verborgen op mobile */
  position: relative;
  padding: 7rem 0 6rem;
  overflow: hidden;
  isolation: isolate;
  /* Achtergrond: sluit aan bij --bg-deep */
  background: #04070f;
}

@media (min-width: 992px) {
  .stats-fx-section {
    display: block;
  }
}

/* ——— ACHTERGROND DECORATIES ——— */
.stats-fx-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Subtiel perspectief-raster */
.stats-fx-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 126, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 126, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent);
}

/* Lichtstralen van boven */
.stats-fx-beam {
  position: absolute;
  top: -20%;
  width: 1px;
  height: 65%;
  background: linear-gradient(180deg, rgba(61, 126, 255, 0) 0%, rgba(61, 126, 255, 0.35) 40%, rgba(0, 212, 170, 0.15) 70%, transparent 100%);
  transform-origin: top center;
}
.stats-fx-beam--1 {
  left: 28%;
  transform: rotate(-8deg) scaleX(80);
  opacity: 0.6;
}
.stats-fx-beam--2 {
  right: 26%;
  transform: rotate(8deg) scaleX(80);
  opacity: 0.45;
}

/* Grain overlay — atmosfeer zonder JS */
.stats-fx-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
}

/* ——— HEADER ——— */
.stats-fx-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 4rem;
  max-width: 640px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.stats-fx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display, 'Syne', 'DM Mono', monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2, #00d4aa);
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.2);
  padding: 0.35rem 1.1rem 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.6rem;
}

.stats-fx-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2, #00d4aa);
  box-shadow: 0 0 8px var(--accent-2, #00d4aa);
  flex-shrink: 0;
  animation: statsDotPulse 2.4s ease-in-out infinite;
}

@keyframes statsDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.stats-fx-title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  background: linear-gradient(150deg, #ffffff 30%, rgba(126, 168, 255, 0.9) 70%, rgba(0, 212, 170, 0.8) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-fx-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted, #6b7fa3);
  margin: 0;
}

/* ——— GRID ——— */
.stats-fx-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  /* Geen overflow hidden — glow-effecten mogen uitlopen */
}

/* ——— KAART ——— */
.stats-fx-card {
  position: relative;
  border-radius: 28px;
  cursor: default;
  /* GPU-hint; geen will-change op alle kaarten tegelijk */
}

/* Hover: GPU promoten per kaart op hover */
.stats-fx-card:hover {
  will-change: transform;
}

/* Glow per kaart — apart element voor GPU-compositing */
.stats-fx-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: 29px;
  background: linear-gradient(135deg, rgba(61, 126, 255, 0.0) 0%, rgba(61, 126, 255, 0.0) 100%);
  transition: background 0.5s ease, box-shadow 0.5s ease;
  z-index: 0;
  pointer-events: none;
}

.stats-fx-card:hover .stats-fx-card-glow {
  background: linear-gradient(135deg, rgba(61, 126, 255, 0.12) 0%, rgba(0, 212, 170, 0.08) 100%);
  box-shadow: 0 0 40px rgba(61, 126, 255, 0.15), 0 0 80px rgba(61, 126, 255, 0.05);
}

/* Binnenste container: border, achtergrond, padding */
.stats-fx-card-inner {
  position: relative;
  z-index: 1;
  background: rgba(8, 14, 30, 0.72);
  border: 1px solid rgba(61, 126, 255, 0.18);
  border-radius: 28px;
  padding: 2.2rem 2rem 1.8rem;
  height: 100%;
  box-sizing: border-box;
  transition: border-color 0.35s ease, background 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  /* Glassmorphism: alleen op desktop met goed GPU */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Subtiele top-highlight */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 20px 40px rgba(0,0,0,0.35);
  overflow: hidden;
}

/* Decoratieve toprand animatie */
.stats-fx-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, #3d7eff), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-fx-card:hover .stats-fx-card-inner::before {
  transform: scaleX(1);
}

.stats-fx-card:hover .stats-fx-card-inner {
  border-color: rgba(61, 126, 255, 0.45);
  background: rgba(8, 14, 30, 0.88);
  transform: translateY(-6px);
}

/* — Featured kaart (uptime) — */
.stats-fx-card--featured .stats-fx-card-inner {
  background: rgba(8, 14, 30, 0.82);
  border-color: rgba(0, 212, 170, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(0, 212, 170, 0.1),
    0 0 60px rgba(0, 212, 170, 0.06),
    0 20px 40px rgba(0,0,0,0.4);
}

.stats-fx-card--featured .stats-fx-card-inner::before {
  background: linear-gradient(90deg, transparent, var(--accent-2, #00d4aa), transparent);
}

.stats-fx-card--featured:hover .stats-fx-card-inner {
  border-color: rgba(0, 212, 170, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(0, 212, 170, 0.15),
    0 0 80px rgba(0, 212, 170, 0.12),
    0 24px 60px rgba(0,0,0,0.5);
}

.stats-fx-card--featured .stats-fx-card-glow:hover {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.12) 0%, rgba(61, 126, 255, 0.06) 100%);
}

/* ——— ICOON ——— */
.stats-fx-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(61, 126, 255, 0.1);
  border: 1px solid rgba(61, 126, 255, 0.15);
  margin-bottom: 1.4rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.stats-fx-card--featured .stats-fx-icon-wrap {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.2);
}

.stats-fx-card:hover .stats-fx-icon-wrap {
  background: rgba(61, 126, 255, 0.18);
  border-color: rgba(61, 126, 255, 0.35);
}

.stats-fx-card--featured:hover .stats-fx-icon-wrap {
  background: rgba(0, 212, 170, 0.18);
  border-color: rgba(0, 212, 170, 0.4);
}

.stats-fx-icon {
  width: 20px;
  height: 20px;
  color: var(--accent, #3d7eff);
  transition: color 0.3s ease;
}

.stats-fx-card--featured .stats-fx-icon {
  color: var(--accent-2, #00d4aa);
}

/* ——— GETAL ——— */
.stats-fx-counter-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.1em;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stats-fx-number {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(2.4rem, 3.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, rgba(126, 168, 255, 0.9) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Counter animatie: tabular nums voorkomt springen */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  transition: filter 0.3s ease;
}

.stats-fx-card--featured .stats-fx-number {
  background: linear-gradient(135deg, #ffffff 0%, rgba(0, 212, 170, 0.9) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.stats-fx-card:hover .stats-fx-number {
  filter: brightness(1.15);
}

.stats-fx-suffix {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent, #3d7eff);
  -webkit-text-fill-color: var(--accent, #3d7eff);
  margin-left: 0.05em;
  opacity: 0.8;
}

.stats-fx-card--featured .stats-fx-suffix {
  color: var(--accent-2, #00d4aa);
  -webkit-text-fill-color: var(--accent-2, #00d4aa);
}

/* ——— LABEL ——— */
.stats-fx-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7fa3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* ——— TREND BADGE ——— */
.stats-fx-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent, #3d7eff);
  background: rgba(61, 126, 255, 0.1);
  border: 1px solid rgba(61, 126, 255, 0.18);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.stats-fx-trend svg {
  width: 12px;
  height: 8px;
  stroke: var(--accent, #3d7eff);
}

.stats-fx-trend--green {
  color: var(--accent-2, #00d4aa);
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.2);
}
.stats-fx-trend--green svg { stroke: var(--accent-2, #00d4aa); }

.stats-fx-trend--gold {
  color: #f5c842;
  background: rgba(245, 200, 66, 0.1);
  border-color: rgba(245, 200, 66, 0.2);
}
.stats-fx-trend--gold svg { stroke: #f5c842; }

/* ——— PROGRESS BAR ——— */
.stats-fx-bar {
  height: 3px;
  border-radius: 100px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  margin-top: auto;
}

.stats-fx-bar-fill {
  height: 100%;
  width: 0%; /* geanimeerd via JS */
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent, #3d7eff), rgba(0, 212, 170, 0.7));
  transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-fx-bar-fill--gold {
  background: linear-gradient(90deg, #f5c842, rgba(245, 200, 66, 0.5));
}

/* ——— UPTIME STATUS DOTS ——— */
.stats-fx-status-dots {
  display: flex;
  gap: 5px;
  margin-top: 1rem;
}

.stats-fx-status-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2, #00d4aa);
  opacity: 0;
  /* Staggered fade-in via CSS custom properties (set by JS) */
  animation: statsDotsIn 0.4s ease forwards;
  animation-delay: var(--dot-delay, 0s);
}

/* Animatie wordt getriggerd zodra kaart in beeld komt */
.stats-fx-card.stats-fx--animated .stats-fx-status-dots span {
  /* delay al ingesteld via inline style in JS */
}

@keyframes statsDotsIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ——— VOETNOOT ——— */
.stats-fx-footnote {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 3.5rem;
  font-size: 0.78rem;
  color: rgba(107, 127, 163, 0.6);
  text-align: center;
  padding-inline: 1.5rem;
}

.stats-fx-footnote-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.4);
  flex-shrink: 0;
}

/* ——— SECTION BORDERS ——— */
.stats-fx-section::before,
.stats-fx-section::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(61,126,255,0.3) 30%, rgba(0,212,170,0.2) 70%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}
.stats-fx-section::before { top: 0; }
.stats-fx-section::after  { bottom: 0; }

/* ——— INGANG ANIMATIES ——— */

/* Kaart: slide-up vanuit onder */
.stats-fx-card {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-fx-card.stats-fx--in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger via CSS variabele (set in JS) */
.stats-fx-card { transition-delay: var(--card-delay, 0s); }

/* Header slide-in */
.stats-fx-header {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.stats-fx-section.stats-fx--header-in .stats-fx-header {
  opacity: 1;
  transform: translateY(0);
}

/* ——— RESPONSIEF (>= 992px, geen mobile) ——— */
@media (min-width: 992px) and (max-width: 1240px) {
  .stats-fx-grid {
    gap: 1rem;
    padding-inline: 1.5rem;
  }
  .stats-fx-card-inner {
    padding: 1.8rem 1.5rem 1.5rem;
  }
  .stats-fx-number {
    font-size: 2.6rem;
  }
  .stats-fx-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }
}