/* ============================================
   PASO MEDYA — ANIMATIONS CSS
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-15deg) scale(0.8); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

/* Typing cursor */
@keyframes blink-cursor {
  0%, 50% { border-right-color: var(--accent); }
  51%, 100% { border-right-color: transparent; }
}

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(59,130,246,0.2); }
  50% { box-shadow: 0 0 40px rgba(59,130,246,0.5); }
}

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

/* Spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Count up (used with JS) */
@keyframes countUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Ring pulse */
@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

/* Shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.6s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.6s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.5s ease forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-glow-pulse { animation: glowPulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 2s linear infinite; }

/* Duration modifiers */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* Delay modifiers */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ============================================
   HERO ANIMATIONS
   ============================================ */

.hero-title-animate {
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-desc-animate {
  animation: fadeInUp 0.8s ease 0.5s both;
}

.hero-actions-animate {
  animation: fadeInUp 0.8s ease 0.7s both;
}

.hero-stats-animate {
  animation: fadeInUp 0.8s ease 0.9s both;
}

/* Animated gradient hero title */
.hero-gradient-animate {
  background: linear-gradient(270deg, #3b82f6, #8b5cf6, #06b6d4, #3b82f6);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

/* ============================================
   PARTICLE BACKGROUND
   ============================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ============================================
   CARD EFFECTS
   ============================================ */

/* 3D Tilt effect wrapper */
.tilt-wrap {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card {
  transition: transform 0.3s ease;
  will-change: transform;
}

/* Hover glow border */
.hover-border-glow {
  position: relative;
}

.hover-border-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--gradient-border);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

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

/* Magnetic button effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* Shimmer skeleton */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.03) 25%, 
    rgba(255,255,255,0.08) 50%, 
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
}

/* ============================================
   SCROLL TRIGGERED REVEALS
   ============================================ */

/* Base hidden state */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal="up"] { transform: translateY(50px); }
[data-reveal="down"] { transform: translateY(-50px); }
[data-reveal="left"] { transform: translateX(-50px); }
[data-reveal="right"] { transform: translateX(50px); }
[data-reveal="scale"] { transform: scale(0.85); }
[data-reveal="fade"] { transform: none; }

/* Revealed state */
[data-reveal].revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger children */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 0.1s; }
[data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 0.2s; }
[data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 0.3s; }
[data-reveal-stagger].revealed > *:nth-child(5) { transition-delay: 0.4s; }
[data-reveal-stagger].revealed > *:nth-child(6) { transition-delay: 0.5s; }
[data-reveal-stagger].revealed > *:nth-child(7) { transition-delay: 0.6s; }
[data-reveal-stagger].revealed > *:nth-child(8) { transition-delay: 0.7s; }
[data-reveal-stagger].revealed > *:nth-child(9) { transition-delay: 0.8s; }
[data-reveal-stagger].revealed > *:nth-child(10) { transition-delay: 0.9s; }

/* ============================================
   PAGE TRANSITION OVERLAY
   ============================================ */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: var(--z-loading);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.page-transition.enter {
  animation: pageEnter 0.4s ease forwards;
}

.page-transition.exit {
  animation: pageExit 0.4s ease 0.1s forwards;
}

@keyframes pageEnter {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes pageExit {
  from { transform: scaleX(1); transform-origin: right; }
  to { transform: scaleX(0); transform-origin: right; }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter-wrap {
  overflow: hidden;
}

.counter {
  display: inline-block;
  animation: countUp 0.6s ease forwards;
}

/* ============================================
   RING ANIMATION (for CTA sections)
   ============================================ */
.ring-animate {
  position: relative;
}

.ring-animate::before,
.ring-animate::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(59, 130, 246, 0.4);
  animation: ringPulse 2s ease-out infinite;
}

.ring-animate::after {
  animation-delay: 1s;
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  animation: 
    typing 3s steps(30) 1s forwards,
    blink-cursor 0.75s step-end infinite;
  width: 0;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

/* ============================================
   GRADIENT BORDER ANIMATION
   ============================================ */
.gradient-border-animate {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.gradient-border-animate::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple), var(--accent-cyan), var(--accent));
  background-size: 300% 300%;
  animation: gradientShift 3s linear infinite;
  z-index: -1;
}

/* ============================================
   WAVE ANIMATION (Dividers)
   ============================================ */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ============================================
   MOBILE: DISABLE EXPENSIVE ANIMATIONS
   ============================================ */
@media (max-width: 768px) {
  .hero-blob { display: none; }
  .animate-float { animation: none; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
    transition-delay: 0s !important;
  }
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
