/* Efectos especiales y animaciones avanzadas */

/* Efecto de glitch para textos */
.glitch-text {
  position: relative;
  animation: glitch 2s infinite;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 #00fff9, -0.05em -0.025em 0 #ff00c1,
    -0.025em 0.05em 0 #fffc00;
  }
  14% {
    text-shadow: 0.05em 0 0 #00fff9, -0.05em -0.025em 0 #ff00c1,
    -0.025em 0.05em 0 #fffc00;
  }
  15% {
    text-shadow: -0.05em -0.025em 0 #00fff9, 0.025em 0.025em 0 #ff00c1,
    -0.05em -0.05em 0 #fffc00;
  }
  49% {
    text-shadow: -0.05em -0.025em 0 #00fff9, 0.025em 0.025em 0 #ff00c1,
    -0.05em -0.05em 0 #fffc00;
  }
  50% {
    text-shadow: 0.025em 0.05em 0 #00fff9, 0.05em 0 0 #ff00c1,
    0 -0.05em 0 #fffc00;
  }
  99% {
    text-shadow: 0.025em 0.05em 0 #00fff9, 0.05em 0 0 #ff00c1,
    0 -0.05em 0 #fffc00;
  }
  100% {
    text-shadow: -0.025em 0 0 #00fff9, -0.025em -0.025em 0 #ff00c1,
    -0.025em -0.05em 0 #fffc00;
  }
}

@keyframes glitch-anim {
  0% {
    clip: rect(31px, 9999px, 94px, 0);
  }
  5% {
    clip: rect(70px, 9999px, 71px, 0);
  }
  10% {
    clip: rect(29px, 9999px, 83px, 0);
  }
  15% {
    clip: rect(16px, 9999px, 91px, 0);
  }
  20% {
    clip: rect(5px, 9999px, 70px, 0);
  }
  25% {
    clip: rect(88px, 9999px, 61px, 0);
  }
  30% {
    clip: rect(89px, 9999px, 25px, 0);
  }
  35% {
    clip: rect(63px, 9999px, 89px, 0);
  }
  40% {
    clip: rect(32px, 9999px, 43px, 0);
  }
  45% {
    clip: rect(93px, 9999px, 59px, 0);
  }
  50% {
    clip: rect(26px, 9999px, 67px, 0);
  }
  55% {
    clip: rect(24px, 9999px, 34px, 0);
  }
  60% {
    clip: rect(23px, 9999px, 31px, 0);
  }
  65% {
    clip: rect(74px, 9999px, 93px, 0);
  }
  70% {
    clip: rect(46px, 9999px, 85px, 0);
  }
  75% {
    clip: rect(75px, 9999px, 47px, 0);
  }
  80% {
    clip: rect(57px, 9999px, 73px, 0);
  }
  85% {
    clip: rect(56px, 9999px, 78px, 0);
  }
  90% {
    clip: rect(10px, 9999px, 85px, 0);
  }
  95% {
    clip: rect(42px, 9999px, 95px, 0);
  }
  100% {
    clip: rect(59px, 9999px, 2px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 65px, 0);
  }
  5% {
    clip: rect(52px, 9999px, 77px, 0);
  }
  10% {
    clip: rect(28px, 9999px, 59px, 0);
  }
  15% {
    clip: rect(18px, 9999px, 14px, 0);
  }
  20% {
    clip: rect(66px, 9999px, 53px, 0);
  }
  25% {
    clip: rect(33px, 9999px, 9px, 0);
  }
  30% {
    clip: rect(87px, 9999px, 84px, 0);
  }
  35% {
    clip: rect(85px, 9999px, 95px, 0);
  }
  40% {
    clip: rect(65px, 9999px, 34px, 0);
  }
  45% {
    clip: rect(70px, 9999px, 7px, 0);
  }
  50% {
    clip: rect(15px, 9999px, 53px, 0);
  }
  55% {
    clip: rect(52px, 9999px, 32px, 0);
  }
  60% {
    clip: rect(91px, 9999px, 100px, 0);
  }
  65% {
    clip: rect(3px, 9999px, 29px, 0);
  }
  70% {
    clip: rect(90px, 9999px, 83px, 0);
  }
  75% {
    clip: rect(94px, 9999px, 6px, 0);
  }
  80% {
    clip: rect(26px, 9999px, 75px, 0);
  }
  85% {
    clip: rect(85px, 9999px, 65px, 0);
  }
  90% {
    clip: rect(84px, 9999px, 32px, 0);
  }
  95% {
    clip: rect(46px, 9999px, 50px, 0);
  }
  100% {
    clip: rect(60px, 9999px, 91px, 0);
  }
}

/* Efecto de texto con enfoque */
.text-focus-in {
  animation: text-focus-in 1s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

@keyframes text-focus-in {
  0% {
    filter: blur(12px);
    opacity: 0;
  }
  100% {
    filter: blur(0px);
    opacity: 1;
  }
}

/* Botón con efecto neón */
.neon-button {
  position: relative;
  overflow: hidden;
  transition: 0.5s;
}

.neon-button:hover {
  color: #fff;
  background: var(--secondary);
  box-shadow: var(--neon-shadow);
  transition-delay: 0.5s;
}

.neon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--secondary);
  border-left: 2px solid var(--secondary);
  transition: 0.5s;
  transition-delay: 0.5s;
}

.neon-button:hover::before {
  width: 100%;
  height: 100%;
  transition-delay: 0s;
}

.neon-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--secondary);
  border-right: 2px solid var(--secondary);
  transition: 0.5s;
  transition-delay: 0.5s;
}

.neon-button:hover::after {
  width: 100%;
  height: 100%;
  transition-delay: 0s;
}

/* Efecto de botón magnético */
.magnetic-button {
  position: relative;
  transition: all 0.2s ease-in-out;
  will-change: transform;
}

/* Botón morfo */
.morph-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  transition: all 0.3s ease;
}

.morph-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.morph-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.morph-button:hover::before {
  left: 100%;
}

/* Efecto de inclinación 3D para tarjetas de portafolio */
.tilt-effect {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.hover3d {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.hover3d:hover {
  transform: translateZ(20px) rotateX(10deg) rotateY(10deg);
}

/* Animación de flecha rebotando */
.bounce-arrow {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Efecto de luz brillante */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: rotate(30deg);
  transition: all 0.6s ease;
}

.shine-effect:hover::before {
  transform: rotate(30deg) translate(80%, 0%);
}