/* ============================================================
   STATS & ACHIEVEMENTS  —  دستاوردهای شاخص فرتاک (نسخه پیشرفته و غنی)
   
   بک‌گراند کیهانی بنفش با ماسک محوشونده دوطرفه، شبکه کانستلیشن نودها،
   کارت‌های گلس‌مورفیسم ارغوانی با حاشیه نوری، براکت‌های تکنولوژی لوکس،
   تگ‌های خرد وضعیت، تایپوگرافی طلایی/شامپاینی و شمارنده موشن تعاملی.
   ============================================================ */

.stats {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: radial-gradient(circle at 50% 30%, #1c082e 0%, #0e0419 62%, #0c0c0c 100%);
  padding-block: clamp(5.5rem, 9vw, 8.5rem);
  z-index: var(--z-raised);

  /* ادغام و محو شدن مخملین لبه‌های بالا و پایین با بخش‌های مجاور */
  mask-image: linear-gradient(to bottom, transparent 0%, black clamp(40px, 6vw, 80px), black calc(100% - clamp(40px, 6vw, 80px)), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black clamp(40px, 6vw, 80px), black calc(100% - clamp(40px, 6vw, 80px)), transparent 100%);
}

/* هماهنگی با تم روشن در صورت جابجایی تم */
:root[data-theme='light'] .stats {
  background: radial-gradient(circle at 50% 30%, #2f124a 0%, #19082a 68%, #0f051b 100%);
}

/* ------------------------------------------------------------
   AMBIENT GLOWS & BACKGROUND GRID
   ------------------------------------------------------------ */

.stats__glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.42;
}

.stats__glow--primary {
  inline-size: clamp(26rem, 55vw, 65rem);
  block-size: clamp(22rem, 45vw, 48rem);
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.4) 0%, rgba(139, 92, 246, 0.2) 48%, transparent 75%);
}

.stats__glow--secondary {
  inline-size: clamp(18rem, 35vw, 36rem);
  block-size: clamp(18rem, 35vw, 36rem);
  bottom: -5%;
  right: 8%;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.26) 0%, rgba(147, 51, 234, 0.12) 50%, transparent 70%);
}

.stats__glow--tertiary {
  inline-size: clamp(16rem, 30vw, 32rem);
  block-size: clamp(16rem, 30vw, 32rem);
  top: 30%;
  left: 5%;
  background: radial-gradient(circle, rgba(245, 222, 156, 0.15) 0%, transparent 65%);
}

/* خطوط عمودی پین‌استرایپ نئونی ظریف */
.stats__grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to right,
    rgba(168, 85, 247, 0.045) 0px,
    rgba(168, 85, 247, 0.045) 1px,
    transparent 1px,
    transparent clamp(80px, 8vw, 130px)
  );
  opacity: 0.9;
  mask-image: radial-gradient(circle at 50% 50%, black 45%, transparent 92%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 45%, transparent 92%);
}

/* کانواس ذرات کیهانی و شبکه‌بندی نودها */
.stats__canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.92;
  mix-blend-mode: screen;
}

/* ------------------------------------------------------------
   SECTION HEADER (هماهنگی کامل با دیزاین سیستم فرتاک)
   ------------------------------------------------------------ */

.stats__container {
  position: relative;
  z-index: 2;
}

.stats__header {
  text-align: center;
  max-inline-size: 780px;
  margin-inline: auto;
  margin-block-end: clamp(2.5rem, 4.5vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* بج بالای تیتر همراه با نقطه تپنده وضعیت */
.stats__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.32);
  color: #E9D5FF;
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-block-end: clamp(0.85rem, 1.5vw, 1.25rem);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stats__badge-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: #A855F7;
  box-shadow: 0 0 10px #C084FC;
  animation: statsPulse 2.2s infinite ease-in-out;
}

@keyframes statsPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 14px #E879F9; }
}

.stats__title {
  margin-block-end: clamp(0.75rem, 1.2vw, 1.1rem);
  text-wrap: balance;
}

.stats__lead {
  font-size: clamp(0.92rem, 1.1vw, 1.12rem);
  line-height: 1.75;
  color: rgba(215, 226, 234, 0.72);
  margin: 0;
  max-inline-size: 62ch;
}

/* ------------------------------------------------------------
   STATS GRID & ENRICHED CARDS
   ------------------------------------------------------------ */

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: stretch;
}

.stats__col {
  display: flex;
  min-inline-size: 0;
}

/* کارت فوق‌العاده مدرن با جزئیات لوکس */
.stats__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  inline-size: 100%;
  padding: clamp(2.4rem, 3.8vw, 3.4rem) clamp(1.2rem, 1.8vw, 1.8rem);
  
  border-radius: clamp(22px, 2.4vw, 28px);
  background: linear-gradient(168deg, rgba(35, 14, 52, 0.75) 0%, rgba(18, 7, 28, 0.88) 100%);
  
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  
  border: 1px solid rgba(168, 85, 247, 0.24);
  
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.14) inset,
    0 20px 48px -12px rgba(0, 0, 0, 0.7),
    0 0 28px -4px rgba(147, 51, 234, 0.2);
  
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
  
  overflow: hidden;
  cursor: default;
}

/* هاله پالس ملایم داخل کارت */
.stats__card-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
  opacity: 0.6;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.stats__card:hover .stats__card-aura {
  opacity: 1;
  background: radial-gradient(circle at 50% 25%, rgba(216, 180, 254, 0.2) 0%, transparent 70%);
}

/* تگ خرد وضعیت در بالای کارت */
.stats__card-tag {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stats__card-tag svg {
  inline-size: 8px;
  block-size: 8px;
}

.stats__card-tag--users {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #E9D5FF;
}

.stats__card-tag--partners {
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #5EEAD4;
}

.stats__card-tag--exp {
  background: rgba(251, 146, 60, 0.15);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: #FDBA74;
}

.stats__card-tag--warranty {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #FDE047;
}

.stats__card:hover .stats__card-tag {
  opacity: 1;
  transform: translateY(-1px);
}

/* براکت‌های تکنولوژی نوری در گوشه‌های کارت */
.stats__card-bracket {
  position: absolute;
  inline-size: 14px;
  block-size: 14px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.35;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.stats__card-bracket--tl {
  top: 12px;
  inset-inline-start: 12px;
  border-top: 1.5px solid #C084FC;
  border-inline-start: 1.5px solid #C084FC;
  border-top-left-radius: 6px;
}

.stats__card-bracket--br {
  bottom: 12px;
  inset-inline-end: 12px;
  border-bottom: 1.5px solid #C084FC;
  border-inline-end: 1.5px solid #C084FC;
  border-bottom-right-radius: 6px;
}

.stats__card:hover .stats__card-bracket {
  opacity: 0.85;
  border-color: #FCE8B8;
}

/* بازتاب نور اسپکولار ماوس روی شیشه کارت */
.stats__card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 200px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(235, 200, 255, 0.18) 0%,
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.stats__card:hover .stats__card-shine {
  opacity: 1;
}

.stats__card:hover {
  border-color: rgba(216, 180, 254, 0.52);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.3) inset,
    0 25px 60px -8px rgba(0, 0, 0, 0.85),
    0 0 38px 2px rgba(168, 85, 247, 0.38);
}

/* محفظه آیکون سه‌بعدی لوکس */
.stats__icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: clamp(48px, 4.4vw, 58px);
  block-size: clamp(48px, 4.4vw, 58px);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.22) 0%, rgba(90, 22, 140, 0.38) 100%);
  border: 1px solid rgba(216, 180, 254, 0.32);
  color: #FCE8B8;
  margin-block-start: 0.5rem;
  margin-block-end: clamp(1.2rem, 2vw, 1.7rem);
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: transform 0.4s var(--ease-out), border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

.stats__icon svg {
  inline-size: clamp(24px, 2.4vw, 30px);
  block-size: clamp(24px, 2.4vw, 30px);
  filter: drop-shadow(0 2px 8px rgba(245, 222, 156, 0.35));
}

.stats__card:hover .stats__icon {
  transform: translateY(-4px) scale(1.08);
  border-color: rgba(245, 222, 156, 0.65);
  color: #FFF2D1;
  box-shadow: 0 8px 25px rgba(245, 222, 156, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* ------------------------------------------------------------
   NUMERAL TYPOGRAPHY (لوکس و شاخص)
   ------------------------------------------------------------ */

.stats__num-wrap {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-block-end: clamp(0.75rem, 1.2vw, 1.15rem);
  line-height: 1;
}

.stats__num {
  font-family: 'Vazirmatn', var(--font-base), sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  letter-spacing: -0.015em;
  
  color: #FCE8B8;
  background: linear-gradient(180deg, #FFFDF8 0%, #FCE8B8 52%, #E6C575 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  filter: drop-shadow(0 2px 14px rgba(245, 222, 156, 0.35));
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
}

/* علامت به علاوه (+) کوچک کنار ارقام */
.stats__num-plus {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 700;
  color: #E6C575;
  filter: drop-shadow(0 2px 10px rgba(245, 222, 156, 0.3));
  margin-inline-start: 2px;
}

@supports not (-webkit-background-clip: text) {
  .stats__num {
    color: #FCE8B8;
  }
}

/* ------------------------------------------------------------
   LABEL / SUBTITLE TYPOGRAPHY
   ------------------------------------------------------------ */

.stats__label {
  position: relative;
  z-index: 2;
  font-size: clamp(0.88rem, 1.05vw, 1.05rem);
  font-weight: 500;
  line-height: 1.68;
  color: rgba(225, 215, 240, 0.85);
  margin: 0;
  max-inline-size: 24ch;
  transition: color var(--dur-base) var(--ease);
}

.stats__card:hover .stats__label {
  color: #FFFFFF;
}

/* ------------------------------------------------------------
   RESPONSIVE ADAPTATIONS
   ------------------------------------------------------------ */

@media (max-width: 1080px) {
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .stats__label {
    max-inline-size: 28ch;
  }
}

@media (max-width: 580px) {
  .stats {
    padding-block: clamp(4rem, 11vw, 5.5rem);
  }

  .stats__header {
    margin-block-end: 2.2rem;
  }

  .stats__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats__card {
    padding: 2.4rem 1.5rem;
  }

  .stats__num {
    font-size: 2.6rem;
  }

  .stats__label {
    max-inline-size: 32ch;
  }
}
