/* =====================================================
   animation.css — TikeTaka Landing Page Animations
   ===================================================== */

/* ── Keyframes ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 40px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate3d(0, -40px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translate3d(-50px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translate3d(50px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%       { transform: translate3d(0, -18px, 0); }
}

@keyframes floatSlow {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33%       { transform: translate3d(0, -12px, 0) rotate(2deg); }
  66%       { transform: translate3d(0, -6px, 0) rotate(-1deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale3d(1, 1, 1); opacity: 1; }
  50%       { transform: scale3d(1.05, 1.05, 1); opacity: 0.85; }
}

@keyframes pulseRing {
  0%   { transform: scale3d(0.8, 0.8, 1); opacity: 0.8; }
  100% { transform: scale3d(2.0, 2.0, 1); opacity: 0; }
}

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

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

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

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

@keyframes zoomIn {
  from { transform: scale3d(0.8, 0.8, 1); opacity: 0; }
  to   { transform: scale3d(1, 1, 1);   opacity: 1; }
}

@keyframes rotateIn {
  from { transform: rotate(-10deg) scale3d(0.9, 0.9, 1); opacity: 0; }
  to   { transform: rotate(0deg) scale3d(1, 1, 1);     opacity: 1; }
}

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale3d(0, 0, 1); }
  40%           { transform: scale3d(1.0, 1.0, 1); }
}

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

@keyframes bgFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25%       { transform: translate3d(10px, -15px, 0) rotate(5deg); }
  50%       { transform: translate3d(-8px, -25px, 0) rotate(-3deg); }
  75%       { transform: translate3d(12px, -10px, 0) rotate(7deg); }
}

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

@keyframes borderPulse {
  0%, 100% { border-color: var(--color-primary); box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
  50%       { border-color: var(--color-secondary); box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}

/* ── Scroll-Reveal Base Classes ── */
/* Elements start hidden; JS adds .is-visible to trigger animation */

.reveal {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotate(0deg) !important;
}

.reveal-up     { transform: translate3d(0, 50px, 0); }
.reveal-down   { transform: translate3d(0, -50px, 0); }
.reveal-left   { transform: translate3d(-50px, 0, 0); }
.reveal-right  { transform: translate3d(50px, 0, 0); }
.reveal-zoom   { transform: scale3d(0.85, 0.85, 1); }
.reveal-rotate { transform: rotate(-5deg) scale3d(0.9, 0.9, 1); }

/* Stagger delays */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }
.delay-600 { transition-delay: 0.6s !important; }
.delay-700 { transition-delay: 0.7s !important; }
.delay-800 { transition-delay: 0.8s !important; }

/* ── Utility Animation Classes ── */
.anim-float     { animation: floatY 4s ease-in-out infinite; will-change: transform; }
.anim-float-slow{ animation: floatSlow 6s ease-in-out infinite; will-change: transform; }
.anim-pulse     { animation: pulse 3s ease-in-out infinite; will-change: transform, opacity; }
.anim-spin      { animation: spin 8s linear infinite; will-change: transform; }
.anim-gradient  { animation: gradientShift 6s ease infinite; background-size: 200% 200%; }
.anim-shimmer   {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* ── Hero Section Animations ── */
.hero-title-anim {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.1s;
}
.hero-desc-anim {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.25s;
}
.hero-btn-anim {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.4s;
}
.hero-badge-anim {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.0s;
}
.hero-img-anim {
  animation: fadeInRight 1s ease both, floatY 5s ease-in-out 1s infinite;
}

/* ── Navbar Animation ── */
.navbar-shrink {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.08) !important;
  transition: all 0.3s ease;
}

/* ── Card Hover Lift ── */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  will-change: transform;
}
.hover-lift:hover {
  transform: translate3d(0, -8px, 0);
  box-shadow: 0 20px 60px rgba(37,99,235,0.15) !important;
}

/* ── Icon Hover Bounce ── */
.icon-bounce {
  transition: transform 0.3s ease;
  display: inline-block;
  will-change: transform;
}
.icon-bounce:hover,
.card:hover .icon-bounce {
  transform: scale3d(1.15, 1.15, 1) rotate(-5deg);
}

/* ── Button Hover ── */
.btn-hover-glow:hover {
  box-shadow: 0 0 0 4px rgba(37,99,235,0.25), 0 8px 24px rgba(37,99,235,0.3);
}

/* ── Timeline step animation ── */
.timeline-step {
  opacity: 0;
  transform: translate3d(-30px, 0, 0);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: transform, opacity;
}
.timeline-step.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ── Blob background animation ── */
.blob-shape {
  animation: bgFloat 10s ease-in-out infinite;
  will-change: transform;
}
.blob-shape:nth-child(2) { animation-delay: -3s; animation-duration: 13s; }
.blob-shape:nth-child(3) { animation-delay: -6s; animation-duration: 8s; }

/* ── Loading dots ── */
.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
  animation: bounceDot 1.4s infinite ease-in-out both;
}
.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0.32s; }

/* ── Slider transition ── */
.slider-track {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ── Accordion animation ── */
.accordion-button:not(.collapsed) .acc-icon {
  transform: rotate(45deg);
  color: var(--color-primary);
}
.acc-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

/* ── Back to top button ── */
#back-to-top {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Counter number animation ── */
.counter-number {
  animation: countUp 0.6s ease both;
}

/* ── Progress bar animation ── */
.progress-anim {
  animation: fadeInLeft 1s ease both;
}
.progress-bar-fill {
  width: 0;
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.progress-bar-fill.animated {
  width: var(--target-width, 80%);
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-float, .anim-float-slow, .anim-pulse, .anim-spin { animation: none !important; }
}
