/* Laser Engraving Stats Animation */

[data-laser-engrave] {
  position: relative;
  isolation: isolate;
}

.laser-canvas {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.laser-overlay {
  width: 100%;
  height: 100%;
  opacity: 0;
}

.stat-item--laser {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-number-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.stat-number-path {
  opacity: 0;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

.stat-value--engraved {
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: scale(0.95);
  text-shadow: 
    0 0 20px rgba(56, 189, 248, 0.8),
    0 0 40px rgba(99, 102, 241, 0.6),
    0 0 60px rgba(56, 189, 248, 0.4);
}

.stat-value--engraved.is-engraved {
  opacity: 1;
  transform: scale(1);
  text-shadow: 
    0 0 10px rgba(56, 189, 248, 0.4),
    0 0 20px rgba(99, 102, 241, 0.2);
  transition: text-shadow 0.3s ease;
}

/* Laser beam effect */
.laser-beam {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(56, 189, 248, 0.9), 
    rgba(99, 102, 241, 0.9), 
    transparent
  );
  filter: blur(1px);
  opacity: 0;
  z-index: 20;
  pointer-events: none;
}

.laser-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #38bdf8, #6366f1);
  border-radius: 50%;
  opacity: 0;
  z-index: 21;
  pointer-events: none;
  box-shadow: 0 0 10px #38bdf8, 0 0 20px #6366f1;
}

/* Laser smoke/ember effect */
.laser-ember {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(248, 113, 113, 0.8);
  border-radius: 50%;
  opacity: 0;
  z-index: 19;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

/* Enhanced glow during engraving */
.stat-item--laser.engraving .stat-value--engraved {
  animation: engrave-glow 0.1s ease-in-out infinite alternate;
}

@keyframes engrave-glow {
  from {
    text-shadow: 
      0 0 20px rgba(56, 189, 248, 0.9),
      0 0 40px rgba(99, 102, 241, 0.7),
      0 0 60px rgba(56, 189, 248, 0.5);
  }
  to {
    text-shadow: 
      0 0 30px rgba(56, 189, 248, 1),
      0 0 60px rgba(99, 102, 241, 0.8),
      0 0 90px rgba(56, 189, 248, 0.6);
  }
}

/* Scanline effect for added tech feel */
.laser-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(56, 189, 248, 0.3), 
    rgba(99, 102, 241, 0.3), 
    transparent
  );
  opacity: 0;
  z-index: 15;
  pointer-events: none;
}

/* Base layer for the stats container */
.stats-bar[data-laser-engrave]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, 
    rgba(99, 102, 241, 0.15), 
    transparent 70%
  );
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.stats-bar[data-laser-engrave].engraving::before {
  opacity: 1;
}
