/* =========================================================
   ConvertFlow Pro — Animations
   ========================================================= */

/* ── Keyframes ── */
@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.8); }
  to { opacity: 1; transform: scale(1); }
}

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

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

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

@keyframes floatReverse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50% { box-shadow: 0 0 40px rgba(124,58,237,0.6); }
}

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

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes morphBlob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50% { border-radius: 50% 60% 30% 60% / 40% 30% 60% 50%; }
  75% { border-radius: 60% 40% 60% 30% / 60% 40% 30% 60%; }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes wave {
  0% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.5); }
  100% { transform: scaleY(0.5); }
}

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

@keyframes blink {
  50% { border-color: transparent; }
}

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

@keyframes particleFly {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100vh) translateX(50px) rotate(360deg); opacity: 0; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes progressPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(124,58,237,0.4); }
  50% { box-shadow: 0 0 25px rgba(124,58,237,0.8), 0 0 50px rgba(6,182,212,0.3); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@keyframes rotateGlobe {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes checkmark {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

@keyframes glitch {
  0%, 100% { clip-path: inset(0 0 100% 0); }
  10% { clip-path: inset(20% 0 60% 0); }
  30% { clip-path: inset(50% 0 30% 0); }
  50% { clip-path: inset(10% 0 80% 0); }
  70% { clip-path: inset(70% 0 10% 0); }
  90% { clip-path: inset(40% 0 40% 0); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ── Utility Animation Classes ── */
.animate-fadeIn { animation: fadeIn 0.6s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.7s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.7s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.7s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.7s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.5s ease forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-floatReverse { animation: floatReverse 4s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-pulseGlow { animation: pulseGlow 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce { animation: bounce 1.5s ease-in-out infinite; }
.animate-gradientShift { animation: gradientShift 4s ease infinite; background-size: 200% 200%; }

/* Delay classes */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* Hidden before animate */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Hero Blob ── */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.25) 0%, transparent 70%);
  top: -200px; left: -100px;
  animation: morphBlob 10s ease-in-out infinite;
}

.hero-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.2) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation: morphBlob 12s ease-in-out infinite reverse;
}

.hero-blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  top: 40%; left: 50%;
  animation: float 8s ease-in-out infinite;
}

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

/* ── Shimmer Loading ── */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

/* ── Hover Lift ── */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

/* ── Glow Effects ── */
.glow-primary { box-shadow: 0 0 30px rgba(124,58,237,0.4); }
.glow-cyan { box-shadow: 0 0 30px rgba(6,182,212,0.4); }
.glow-gold { box-shadow: 0 0 30px rgba(245,158,11,0.4); }

/* ── Typing Animation ── */
.typing-text {
  overflow: hidden;
  border-right: 2px solid var(--primary);
  white-space: nowrap;
  animation: typing 3s steps(30) 1s forwards, blink 0.75s step-end infinite;
  width: 0;
}

/* ── Page Loader ── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.page-loader.hidden { opacity: 0; pointer-events: none; }

.loader-ring {
  width: 60px; height: 60px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-right-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Format Tag Animation ── */
.format-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: var(--transition);
  cursor: default;
}

.format-tag:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}

/* ── Conversion Arrow ── */
.convert-arrow {
  width: 44px; height: 44px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  cursor: pointer;
}

.convert-arrow:hover { transform: rotate(180deg); }

/* ── Check Mark ── */
.check-icon {
  width: 24px; height: 24px;
  background: rgba(16,185,129,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34D399;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── Step Indicator ── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(50% + 20px);
  top: 50%;
  width: calc(100% - 40px);
  height: 1px;
  background: var(--border-color);
}

.step.active::after { background: var(--primary); }

.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.step.active .step-num {
  background: var(--grad-primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.step.done .step-num {
  background: rgba(16,185,129,0.15);
  border-color: var(--neon-green);
  color: #34D399;
}

/* ── Tooltip ── */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,12,40,0.98);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition-fast);
  z-index: 50;
}

.tooltip:hover::after { opacity: 1; }

/* ── Skeleton Loader ── */
.skeleton {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  animation: shimmer 1.5s linear infinite;
  background-size: 200% 100%;
}
