.button {
  --magnetic-strength: 0.5;
  --spring-stiffness: 0.1;
  --spring-damping: 0.8;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.1s ease-out, box-shadow 0.2s ease, background-color 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.button:active {
  --spring-stiffness: 0.2;
}

/* VARIANTS */
.solid {
  background: var(--accent, #00ff00);
  color: #000;
}

.outline {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  backdrop-filter: blur(10px);
}

/* MAGNETIC EFFECT */
.button.magnetic {
  transition: transform 0.1s ease-out;
}

/* GLOW EFFECT */
.button.glow {
  box-shadow: 0 0 20px var(--accent, #00ff00);
}

.button.glow:hover {
  box-shadow: 0 0 30px var(--accent, #00ff00), 0 0 60px var(--accent, #00ff00);
}

/* PULSING */
.button.pulsing {
  animation: magnetic-pulse 2s ease-in-out infinite;
}

@keyframes magnetic-pulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--accent, #00ff00);
  }
  50% {
    box-shadow: 0 0 40px var(--accent, #00ff00), 0 0 60px var(--accent, #00ff00);
  }
}

/* FIELD LINES - DECORATIVE */
.fieldLines {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button:hover .fieldLines {
  opacity: 0.3;
}

.fieldLine {
  position: absolute;
  border: 1px solid var(--accent, #00ff00);
  border-radius: 50%;
  animation: field-pulse 2s ease-in-out infinite;
}

.fieldLine:nth-child(1) {
  inset: 0;
  animation-delay: 0s;
}

.fieldLine:nth-child(2) {
  inset: 5px;
  animation-delay: 0.3s;
}

.fieldLine:nth-child(3) {
  inset: 10px;
  animation-delay: 0.6s;
}

@keyframes field-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
}

/* PARTICLES */
.particles {
  position: absolute;
  inset: -10px;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent, #00ff00);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button:hover .particle {
  opacity: 1;
  animation: particle-float 1s ease-in-out infinite;
}

.particle:nth-child(1) { top: 0; left: 50%; animation-delay: 0s; }
.particle:nth-child(2) { top: 50%; right: 0; animation-delay: 0.2s; }
.particle:nth-child(3) { bottom: 0; left: 50%; animation-delay: 0.4s; }
.particle:nth-child(4) { top: 50%; left: 0; animation-delay: 0.6s; }

@keyframes particle-float {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(5px, -5px);
  }
  50% {
    transform: translate(0, -10px);
  }
  75% {
    transform: translate(-5px, -5px);
  }
}

/* RIPPLE EFFECT ON CLICK */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* STRENGTH LEVELS */
.strength-weak {
  --magnetic-strength: 0.2;
}

.strength-medium {
  --magnetic-strength: 0.5;
}

.strength-strong {
  --magnetic-strength: 0.8;
}

.strength-intense {
  --magnetic-strength: 1;
}

.strength-intense.magnetic {
  transition: transform 0.05s ease-out;
}

/* SIZE VARIANTS */
.small {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.small .fieldLines {
  inset: -15px;
}

.large {
  padding: 1.5rem 3rem;
  font-size: 1rem;
}

.large .fieldLines {
  inset: -25px;
}

/* COLOR VARIANTS */
.neon {
  --accent: #ff00ff;
}

.cyber {
  --accent: #00ffff;
}

.fire {
  --accent: #ff4400;
}

.toxic {
  --accent: #00ff00;
}

.warning {
  --accent: #ffaa00;
}

/* TEXT EFFECTS */
.button.glitchText {
  position: relative;
}

.button.glitchText::before,
.button.glitchText::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.button.glitchText::before {
  color: var(--accent, #00ff00);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-2px, -2px);
  opacity: 0;
  transition: opacity 0.2s;
}

.button.glitchText::after {
  color: var(--accent-alt, #ff00ff);
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(2px, 2px);
  opacity: 0;
  transition: opacity 0.2s;
}

.button.glitchText:hover::before,
.button.glitchText:hover::after {
  opacity: 0.8;
  animation: text-glitch 0.3s infinite;
}

@keyframes text-glitch {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, -2px); }
}

/* DISABLED STATE */
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* CONTENT */
.content {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
