/* ===================================
   Stat Insights Section - Animated Counters
   =================================== */

/* Container */
.stat-insights {
  position: relative;
  overflow: hidden;
}

/* Heading */
.stat-insights__heading {
  text-align: center;
  margin: 0 auto var(--space-lg);
  max-width: 1040px;
}

@media (min-width: 1024px) {
  .stat-insights__heading {
    margin-bottom: var(--space-2xl);
  }
}

/* Grid Layout */
.stat-insights__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .stat-insights__grid {
    gap: var(--space-xl);
  }
}

/* Individual Stat Item */
.stat-insights__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
}

@media (min-width: 768px) {
  .stat-insights__item {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .stat-insights__item {
    gap: var(--space-2xl);
  }
}

/* Number Container (Left Side) */
.stat-insights__number-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .stat-insights__number-container {
    justify-content: flex-end;
    padding-right: var(--space-md);
  }
}

/* Number Wrapper */
.stat-insights__number-wrapper {
  position: relative;
  z-index: 2;
}

/* Stat Value (The Animated Number) */
.stat-value {
  display: inline-flex;
  align-items: baseline;
  line-height: 0.85;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* Ensure bold weight is applied */
.stat-value.font-bold {
  font-weight: 700 !important;
}

.stat-value.font-semibold {
  font-weight: 600 !important;
}

/* Override font sizes for bigger impact */
.stat-value.text-7xl { font-size: 5rem; }
.stat-value.text-8xl { font-size: 6rem; }
.stat-value.text-9xl { font-size: 7rem; }

@media (min-width: 768px) {
  .stat-value.text-7xl { font-size: 6rem; }
  .stat-value.text-8xl { font-size: 8rem; }
  .stat-value.text-9xl { font-size: 9rem; }
  .stat-value.lg\:text-9xl { font-size: 9rem; }
}

@media (min-width: 1024px) {
  .stat-value.lg\:text-9xl { font-size: 10rem; }
}

@media (min-width: 1280px) {
  .stat-value.lg\:text-9xl { font-size: 12rem; }
}

/* Stat Number */
.stat-number {
  display: inline-block;
}

/* Stat Suffix (text after number like "years" or "%") */
.stat-suffix {
  font-size: 0.35em;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.05em;
  vertical-align: baseline;
  letter-spacing: 0.02em;
}

/* Decoration Image Container */
.stat-insights__decoration {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

/* Position decorations based on the stat item */
.stat-insights__item:nth-child(1) .stat-insights__decoration {
  right: -10%;
  top: 15%;
  width: 180px;
  height: auto;
}

.stat-insights__item:nth-child(2) .stat-insights__decoration {
  right: 10%;
  bottom: 5%;
  width: 230px;
  height: auto;
}

.stat-insights__item:nth-child(3) .stat-insights__decoration {
  right: 0;
  top: 30%;
  width: 200px;
  height: auto;
}

@media (min-width: 768px) {
  .stat-insights__item:nth-child(1) .stat-insights__decoration {
    right: 5%;
    top: 20%;
  }
  
  .stat-insights__item:nth-child(2) .stat-insights__decoration {
    right: 15%;
    bottom: 10%;
  }
  
  .stat-insights__item:nth-child(3) .stat-insights__decoration {
    right: 5%;
    top: 35%;
  }
}

@media (min-width: 1024px) {
  .stat-insights__item:nth-child(1) .stat-insights__decoration {
    right: 8%;
    top: 21%;
    width: 180px;
  }
  
  .stat-insights__item:nth-child(2) .stat-insights__decoration {
    right: 18%;
    bottom: 12%;
    width: 230px;
  }
  
  .stat-insights__item:nth-child(3) .stat-insights__decoration {
    right: 10%;
    top: 37%;
    width: 204px;
  }
}

/* Decoration Image */
.stat-insights__decoration-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* Description (Right Side) */
.stat-insights__description {
  display: flex;
  align-items: center;
  padding-left: 0;
}

@media (min-width: 768px) {
  .stat-insights__description {
    padding-left: var(--space-md);
    border-left: 2px solid var(--clr-neutral-light);
  }
}

.stat-insights__description p {
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Disclaimer */
.stat-insights__disclaimer {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .stat-insights__disclaimer {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
  }
}

.stat-insights__disclaimer p {
  margin: 0;
  opacity: 0.8;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .stat-insights__number-container {
    justify-content: center;
  }
  
  .stat-insights__description {
    text-align: center;
    justify-content: center;
  }
  
  /* Adjust decoration positions for mobile */
  .stat-insights__decoration {
    opacity: 0.6;
  }
  
  .stat-insights__item:nth-child(1) .stat-insights__decoration {
    right: 0;
    top: 10%;
    width: 120px;
  }
  
  .stat-insights__item:nth-child(2) .stat-insights__decoration {
    right: 10%;
    bottom: 0;
    width: 160px;
  }
  
  .stat-insights__item:nth-child(3) .stat-insights__decoration {
    right: 5%;
    top: 25%;
    width: 140px;
  }
}

/* Animation States */
.stat-value {
  will-change: contents;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .stat-value {
    will-change: auto;
  }
}

/* Focus States for Accessibility */
.stat-insights__item:focus-within {
  outline: 2px solid var(--clr-info);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

/* Print Styles */
@media print {
  .stat-insights__decoration {
    display: none;
  }
}

