/* ============================================
   CreativeIA - Animations & Effets
   ============================================ */

/* --- Glow Neon Pulse --- */
@keyframes neonPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2),
                0 0 20px rgba(0, 212, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4),
                0 0 40px rgba(0, 212, 255, 0.2),
                0 0 60px rgba(139, 92, 246, 0.1);
  }
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5),
                 0 0 40px rgba(0, 212, 255, 0.2);
  }
}

/* --- Gradient Border Animation --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple), var(--neon-pink), var(--neon-blue));
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
  opacity: 1;
}

/* --- Float Animation --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* --- Typing Effect --- */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 100% { border-color: var(--neon-blue); }
  50% { border-color: transparent; }
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--neon-blue);
  animation: typing 3s steps(40) 0.5s forwards, blink 0.8s step-end infinite;
  width: 0;
}

/* --- Fade In Up (scroll reveal) --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Fade In Scale --- */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Slide In Left --- */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Slide In Right --- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Counter Roll Up --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Card Hover Glow Intensify --- */
.card-glow:hover {
  animation: neonPulse 2s ease-in-out infinite;
}

/* --- Hero Gradient Background --- */
@keyframes heroGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-gradient-bg {
  background: linear-gradient(135deg,
    var(--bg-primary) 0%,
    rgba(139, 92, 246, 0.05) 25%,
    var(--bg-primary) 50%,
    rgba(0, 212, 255, 0.05) 75%,
    var(--bg-primary) 100%
  );
  background-size: 400% 400%;
  animation: heroGradient 10s ease infinite;
}

/* --- Rotating Ring (decorative) --- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ring-spin {
  animation: spin 20s linear infinite;
}

/* --- Scan Line Effect --- */
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.scanline-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.08), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 2;
}

/* --- Stagger Children Animation --- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { animation: fadeInUp 0.5s 0.1s forwards; }
.stagger-children.visible > *:nth-child(2) { animation: fadeInUp 0.5s 0.2s forwards; }
.stagger-children.visible > *:nth-child(3) { animation: fadeInUp 0.5s 0.3s forwards; }
.stagger-children.visible > *:nth-child(4) { animation: fadeInUp 0.5s 0.4s forwards; }
.stagger-children.visible > *:nth-child(5) { animation: fadeInUp 0.5s 0.5s forwards; }
.stagger-children.visible > *:nth-child(6) { animation: fadeInUp 0.5s 0.6s forwards; }

/* --- Icon Hover Rotate --- */
.icon-hover-rotate:hover .card-icon {
  transform: rotateY(180deg);
  transition: transform 0.5s ease;
}

/* --- Button Shimmer --- */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: none;
}

.btn-primary:hover::after {
  animation: shimmer 0.8s ease;
}

/* --- Link Underline Grow --- */
.link-grow {
  position: relative;
}

.link-grow::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--neon-blue);
  transition: width 0.3s ease, left 0.3s ease;
}

.link-grow:hover::after {
  width: 100%;
  left: 0;
}

/* --- Grid Lines Glow --- */
@keyframes gridGlow {
  0%, 100% {
    opacity: 0.03;
  }
  50% {
    opacity: 0.06;
  }
}

.hero-grid {
  animation: gridGlow 4s ease-in-out infinite;
}

/* --- Success Checkmark --- */
@keyframes checkmark {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark 0.6s ease-in-out forwards;
}

.checkmark-check {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkmark 0.3s 0.3s ease-in-out forwards;
}
