/*
 * STATS SECTION STYLES
 * Sezione statistiche con effetto blocco 3D e card intagliate
 */

/* =========================================
   1. LAYOUT SEZIONE & CONTAINER 3D
   ========================================= */

.stats-section {
  position: relative;
  width: 100%;
  padding: 8rem 1.5rem;
  background-color: var(--color-bg-beige);
  z-index: 20;
  overflow: visible; /* Permette l'effetto 3D fuori dai bordi */
  perspective: 1000px;
}

@media (min-width: 768px) {
  .stats-section {
    padding: 12rem 1rem;
  }
}

/* Blocco 3D Principale ("The Monolith") */
.stats-3d-container {
  position: relative;
  width: 100%;
  max-width: 1200px; /* max-w-7xl approx */
  margin: 0 auto;

  background-color: var(--stats-bg-dark);
  border-radius: 3rem;

  /* Effetto 3D Fisico */
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 16px solid var(--stats-border-dark);
  box-shadow: var(--shadow-3d-block);

  /* Setup Animazione JS */
  transform-origin: center top;
  will-change: transform;
}

/* =========================================
   2. SFONDO E TEXTURE
   ========================================= */

.stats-bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3rem;
  pointer-events: none;
  z-index: 0;
}

.wood-texture-dark {
  position: absolute;
  inset: 0;
  background-image: url("../img/wood-pattern.png");
  opacity: 0.1;
  mix-blend-mode: multiply;
}

.topo-lines-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.2;
  mix-blend-mode: overlay;
}

/* Effetti Luce (Sheen) */
.sheen-top {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
}
.sheen-center {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(166, 138, 100, 0.05), transparent 50%);
}

/* =========================================
   3. CONTENUTO PRINCIPALE
   ========================================= */

.stats-content {
  position: relative;
  z-index: 10;
  padding: 5rem 1.5rem;
}

@media (min-width: 768px) {
  .stats-content {
    padding: 4rem 2rem;
  }
}
@media (min-width: 1024px) {
  .stats-content {
    padding: 4rem 4rem;
  }
}

/* Header Sezione */
.stats-header {
  text-align: center;
  margin-bottom: 5rem;
}

.stats-tag {
  display: block;
  color: var(--stats-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.stats-title {
  font-family: var(--font-primary);
  color: var(--stats-text-light);
  font-size: 2rem;
  line-height: 2;
  letter-spacing: -0.15em;
  margin: 0;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.stats-desc {
  font-family: var(--font-secondary);
  color: var(--stats-text-gold);
  font-size: 1.125rem;
  opacity: 0.8;
  max-width: 36rem;
  margin: 1rem auto 0;
}

@media (min-width: 768px) {
  .stats-title {
    font-size: 3.5rem;
    line-height: 1.6;
  }
}

/* =========================================
   4. GRIGLIA & CARDS
   ========================================= */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}
@media (min-width: 1024px) {
  .stats-grid {
    gap: 2rem;
  }
}

/* Wrapper Card (per animazione entrata) */
.stat-card {
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}

.stat-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

/* Stile Interno Card (Effetto Intagliato) */
.stat-card-inner {
  position: relative;
  background-color: #1e1814;
  border-radius: 2rem;
  overflow: hidden;
  padding: 2.5rem 2rem;
  min-height: 300px;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;

  box-shadow: var(--shadow-carved);
  border-bottom: 4px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .stat-card-inner {
    padding: 1.5rem 1rem;
    max-width: 308px;
  }
}

.stat-card-inner:hover {
  transform: translateY(-5px);
}

.stat-card-texture {
  position: absolute;
  inset: 0;
  background-image: url("../img/wood-pattern.png");
  opacity: 0.05;
  pointer-events: none;
}

/* Elementi Interni Card */
.stat-icon {
  color: var(--stats-text-muted);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
  /* margin-bottom: 1rem; */
}

.stat-counter-wrapper {
  width: 100%;
  margin-bottom: 1.5rem;
}

.stat-number-box {
  display: flex;
  justify-content: center;
  align-items: baseline;
  font-family: var(--font-primary);
  line-height: 0.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.counter-value {
  font-size: 2.7rem;
  font-weight: 500;
  color: var(--stats-text-light);
  letter-spacing: -0.15em;
  line-height: 2;
  /* transform: translateX(-0.4rem); */
}

.counter-suffix {
  font-size: 2.5rem;
  color: var(--stats-accent);
  margin-left: 0.25rem;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

@media (min-width: 768px) {
  .counter-value {
    font-size: 3rem;
  }
  .counter-suffix {
    font-size: 3rem;
  }
}

.stat-divider {
  width: 5rem;
  height: 1px;
  background-color: #5e4b3e;
  margin: 0.5rem auto 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 1);
  opacity: 0.5;
}

/* Testi Card */
.stat-label {
  font-family: var(--font-primary);
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--stats-text-gold);
  letter-spacing: -0.1em;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .stat-label {
    font-size: 1rem;
  }
}

.stat-info {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: var(--stats-text-muted);
  line-height: 1.5;
  max-width: 14rem;
  margin: 0 auto;
}

/* =========================================
   5. DECORAZIONI (BULLONI)
   ========================================= */

.stat-bolt {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: #1a1411;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.bolt-slot {
  width: 0.75rem;
  height: 2px;
  background-color: #3e342b;
}

/* Posizionamento Bulloni */
.stat-bolt.top-left {
  top: 2rem;
  left: 2rem;
}
.stat-bolt.top-right {
  top: 2rem;
  right: 2rem;
}
.stat-bolt.bottom-left {
  bottom: 2rem;
  left: 2rem;
}
.stat-bolt.bottom-right {
  bottom: 2rem;
  right: 2rem;
}

/* Rotazioni Slot */
.rotate-45 {
  transform: rotate(45deg);
}
.rotate-minus-45 {
  transform: rotate(-45deg);
}
.rotate-12 {
  transform: rotate(12deg);
}
.rotate-90 {
  transform: rotate(90deg);
}
