/* ═══════════════════════════════════════════════════════
   RESIZEKIT — ANIMATIONS & EFFECTS STYLESHEET
   Full animations: scroll-reveal, counters, particles,
   hover fx, micro-interactions, background effects
═══════════════════════════════════════════════════════ */

/* ─── KEYFRAME LIBRARY ─── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeRight {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes floatA {
  0%,100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-18px) rotate(3deg); }
  66%      { transform: translateY(-8px) rotate(-2deg); }
}
@keyframes floatB {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-22px) rotate(-4deg); }
}
@keyframes floatC {
  0%,100% { transform: translateY(0) rotate(0deg); }
  40%     { transform: translateY(-12px) rotate(5deg); }
  80%     { transform: translateY(-20px) rotate(-3deg); }
}
@keyframes spin360 {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(2.5);  opacity: 0; }
}
@keyframes shimmerFlow {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes bounceDot {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 20px rgba(99,102,241,.3); }
  50%     { box-shadow: 0 0 60px rgba(99,102,241,.7), 0 0 100px rgba(168,85,247,.3); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes particleDrift {
  0%   { transform: translateY(0)   translateX(0)   scale(1);   opacity: .8; }
  50%  { transform: translateY(-80px) translateX(30px) scale(1.2); opacity: .4; }
  100% { transform: translateY(0)   translateX(0)   scale(1);   opacity: .8; }
}
@keyframes morphBorder {
  0%,100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes blinkCursor {
  0%,100% { border-right-color: transparent; }
  50%     { border-right-color: #a5b4fc; }
}
@keyframes numberCount {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes wiggle {
  0%,100% { transform: rotate(0deg); }
  20%     { transform: rotate(-8deg); }
  40%     { transform: rotate(8deg); }
  60%     { transform: rotate(-4deg); }
  80%     { transform: rotate(4deg); }
}
@keyframes ripple {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(3.5);  opacity: 0; }
}
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  14%     { transform: scale(1.15); }
  28%     { transform: scale(1); }
  42%     { transform: scale(1.1); }
  70%     { transform: scale(1); }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}
@keyframes zoomBounce {
  0%   { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(3deg);  opacity: 1; }
  100% { transform: scale(1)   rotate(0deg);  opacity: 1; }
}

/* ─── SCROLL REVEAL BASE ─── */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left  { opacity: 0; transform: translateX(-50px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal-right { opacity: 0; transform: translateX(50px);  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal-scale { opacity: 0; transform: scale(0.8);         transition: opacity .6s ease, transform .6s cubic-bezier(.34,1.56,.64,1); }
.reveal-left.revealed, .reveal-right.revealed, .reveal-scale.revealed {
  opacity: 1; transform: none;
}

/* Stagger delays for child elements */
.stagger-children > *:nth-child(1)  { transition-delay: .05s; }
.stagger-children > *:nth-child(2)  { transition-delay: .12s; }
.stagger-children > *:nth-child(3)  { transition-delay: .19s; }
.stagger-children > *:nth-child(4)  { transition-delay: .26s; }
.stagger-children > *:nth-child(5)  { transition-delay: .33s; }
.stagger-children > *:nth-child(6)  { transition-delay: .40s; }
.stagger-children > *:nth-child(7)  { transition-delay: .47s; }
.stagger-children > *:nth-child(8)  { transition-delay: .54s; }
.stagger-children > *:nth-child(9)  { transition-delay: .61s; }
.stagger-children > *:nth-child(10) { transition-delay: .68s; }

/* ─── HERO FLOATING ORBS ─── */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: .35;
}
.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -200px; left: -150px;
  animation: floatA 8s ease-in-out infinite;
}
.hero-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  bottom: -150px; right: -100px;
  animation: floatB 10s ease-in-out infinite;
}
.hero-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  top: 40%; right: 15%;
  animation: floatC 7s ease-in-out infinite;
  opacity: .2;
}

/* ─── FLOATING IMAGE FORMAT BADGES ─── */
.floating-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fbadge {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
  padding: .35rem .75rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: .06em;
  white-space: nowrap;
}
.fbadge-1  { top: 18%; left:  5%; animation: floatA 6s  ease-in-out infinite; animation-delay: 0s;   }
.fbadge-2  { top: 35%; left:  2%; animation: floatB 8s  ease-in-out infinite; animation-delay:.8s;   }
.fbadge-3  { top: 65%; left:  7%; animation: floatC 7s  ease-in-out infinite; animation-delay:1.4s;  }
.fbadge-4  { top: 80%; left:  3%; animation: floatA 9s  ease-in-out infinite; animation-delay:0.3s;  }
.fbadge-5  { top: 12%; right: 6%; animation: floatB 6s  ease-in-out infinite; animation-delay:0.5s;  }
.fbadge-6  { top: 30%; right: 3%; animation: floatC 10s ease-in-out infinite; animation-delay:1.1s;  }
.fbadge-7  { top: 55%; right: 5%; animation: floatA 7s  ease-in-out infinite; animation-delay:0.7s;  }
.fbadge-8  { top: 72%; right: 2%; animation: floatB 8s  ease-in-out infinite; animation-delay:1.8s;  }
@media (max-width: 767px) { .floating-badges { display: none; } }

/* ─── ANIMATED STATS COUNTER ─── */
.hero-stat-value {
  animation: numberCount .8s ease forwards;
}
.hero-stats { position: relative; z-index: 2; }

/* ─── HERO BADGE ENTRANCE ─── */
.hero-badge { animation: fadeDown .8s cubic-bezier(.22,1,.36,1) .2s both; }
.hero h1    { animation: fadeUp  .9s cubic-bezier(.22,1,.36,1) .4s both; }
.hero > .container > p { animation: fadeUp .8s cubic-bezier(.22,1,.36,1) .6s both; }
.format-pills  { animation: fadeUp .7s cubic-bezier(.22,1,.36,1) .75s both; }
.hero-upload-widget { animation: zoomBounce .9s cubic-bezier(.22,1,.36,1) .9s both; }
.hero-stats   { animation: fadeUp .7s cubic-bezier(.22,1,.36,1) 1.1s both; }

/* ─── FORMAT PILL HOVER ─── */
.format-pill {
  cursor: default;
  transition: all .25s ease;
}
.format-pill:hover {
  transform: translateY(-4px) scale(1.1);
  background: rgba(99,102,241,.4);
  border-color: #a5b4fc;
  color: #fff;
}

/* ─── LOGO ANIMATION ─── */
.logo { transition: transform .25s ease; }
.logo:hover { transform: scale(1.05); }
.logo-icon { animation: heartbeat 3s ease-in-out 2s infinite; }

/* ─── NAV LINK UNDERLINE SLIDE ─── */
nav a {
  position: relative;
  overflow: hidden;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .25s ease;
}
nav a:hover::after, nav a.active::after { width: 60%; }

/* ─── QUICK TOOL CARD ANIMATIONS ─── */
.quick-tool-card {
  animation: none;
  position: relative;
  overflow: hidden;
}
.quick-tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(168,85,247,.08));
  opacity: 0;
  transition: opacity .25s;
}
.quick-tool-card:hover::after { opacity: 1; }
.quick-tool-card:hover .quick-tool-icon {
  animation: wiggle .5s ease;
}
.quick-tool-card .quick-tool-icon {
  display: inline-block;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.quick-tool-card:hover .quick-tool-icon { transform: scale(1.3) translateY(-4px); }

/* ─── FEATURE CARD GLOW ─── */
.feature-card {
  transition: all .35s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 60px rgba(99,102,241,.18), 0 0 0 1px rgba(99,102,241,.15);
}
.feature-icon {
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.feature-card:hover .feature-icon {
  transform: scale(1.2) rotate(-5deg);
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}

/* ─── TOOL CARD 3D TILT ─── */
.tool-card {
  transition: all .3s cubic-bezier(.22,1,.36,1);
  transform-style: preserve-3d;
}
.tool-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 50px rgba(99,102,241,.2), 0 0 0 1px rgba(99,102,241,.12);
}
.tool-card .tool-card-icon-wrap {
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.tool-card:hover .tool-card-icon-wrap {
  transform: scale(1.18) rotate(-8deg) translateY(-4px);
  box-shadow: 0 12px 28px rgba(99,102,241,.4);
}

/* ─── WORKFLOW CARD ─── */
.workflow-card {
  transition: all .35s cubic-bezier(.22,1,.36,1);
}
.workflow-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 40px rgba(99,102,241,.15);
}
.workflow-number {
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.workflow-card:hover .workflow-number {
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 8px 24px rgba(99,102,241,.5);
}

/* ─── BUTTONS ANIMATION ─── */
.btn-hero-primary, .btn-hero-secondary, .widget-btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-hero-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(99,102,241,.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .5s ease, height .5s ease;
}
.btn-hero-primary:hover::before { width: 300px; height: 300px; }

/* Ripple click effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transform: scale(0);
  animation: ripple .6s linear;
  pointer-events: none;
}

/* ─── SECTION WAVE DIVIDERS ─── */
.wave-divider {
  position: relative;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ─── STATS SECTION GLOW RING ─── */
.stat-glow {
  position: relative;
}
.stat-glow::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,.3);
  transform: translate(-50%,-50%);
  animation: pulseRing 2s ease-out infinite;
}

/* ─── COMPARISON TABLE ANIMATIONS ─── */
.comparison-row {
  transition: background .2s ease;
}
.comparison-row:hover { background: rgba(99,102,241,.04); }

/* ─── TESTIMONIAL CARDS ─── */
.testimonial-card {
  transition: all .3s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s ease;
}
.testimonial-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(99,102,241,.14); }
.testimonial-card:hover::before { transform: scaleX(1); }

/* ─── FAQ ANIMATIONS ─── */
.faq-item {
  transition: all .25s ease;
}
.faq-item:hover { border-color: rgba(99,102,241,.3); }
.faq-answer {
  transition: all .35s cubic-bezier(.22,1,.36,1);
}

/* ─── IMAGE SHOWCASE ANIMATIONS ─── */
.showcase-img {
  transition: all .4s cubic-bezier(.22,1,.36,1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.showcase-img:hover { transform: scale(1.04) translateY(-6px); box-shadow: 0 30px 80px rgba(99,102,241,.25); }

/* ─── FORMAT SHOWCASE GRID ─── */
.format-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  cursor: default;
}
.format-card:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--primary-light);
  box-shadow: 0 16px 40px rgba(99,102,241,.18);
}
.format-card-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.format-card:hover .format-card-icon { transform: scale(1.3) rotate(-10deg); }

/* ─── SECTION ENTRY ANIMATIONS ─── */
.features-section  .section-header { animation: none; }
.tools-section     .section-header { animation: none; }

/* ─── PROGRESS BAR ANIMATED ─── */
.skill-bar-fill {
  height: 8px;
  border-radius: 100px;
  background: var(--grad-primary);
  width: 0;
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}
.skill-bar {
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  height: 8px;
}

/* ─── DARK SECTION BACKGROUND ANIMATION ─── */
.dark-section {
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
}

/* ─── SCROLL-TO-TOP BUTTON ─── */
#scrollTop {
  position: fixed;
  bottom: 2rem;
  left: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s cubic-bezier(.22,1,.36,1);
  z-index: 999;
}
#scrollTop.visible { opacity: 1; transform: translateY(0); }
#scrollTop:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99,102,241,.55);
}

/* ─── TOOLTIP ─── */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-wrap .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #0f172a;
  color: #fff;
  font-size: .75rem;
  padding: .35rem .7rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  z-index: 10;
}
.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── ANIMATED GRADIENT TEXT ─── */
.grad-text {
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #6366f1);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerFlow 4s linear infinite;
}

/* ─── BLOB SHAPE DECORATION ─── */
.blob-deco {
  position: absolute;
  pointer-events: none;
  opacity: .06;
  animation: morphBorder 12s ease-in-out infinite;
}
.blob-deco-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  top: -100px; right: -100px;
}
.blob-deco-2 {
  width: 300px; height: 300px;
  background: var(--accent);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  bottom: -80px; left: -80px;
  animation-delay: 4s;
}

/* ─── LOADING SHIMMER (skeleton) ─── */
.shimmer-box {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmerFlow 1.5s infinite;
  border-radius: var(--radius);
}

/* ─── BADGE PULSE ─── */
.tool-badge.popular {
  animation: heartbeat 2s ease-in-out infinite;
  animation-delay: 2s;
}

/* ─── PAGE TRANSITION ─── */
body { animation: fadeIn .5s ease; }

/* ─── MEDIA: reduce motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
