/* ═══════════════════════════════════════════════════════════
   ANIMATIONS.CSS — IntakhabAlam Onboarding
   Keyframes, Entrance Animations, Micro-interactions
═══════════════════════════════════════════════════════════ */

/* ─── Keyframe Definitions ───────────────────────────────── */

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

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

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

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

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

/* ─── Background Orbs ────────────────────────────────────── */

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33%       { transform: translate(40px, -60px) scale(1.05); opacity: 0.8; }
  66%       { transform: translate(-30px, 40px) scale(0.97); opacity: 0.5; }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  40%       { transform: translate(-50px, 30px) scale(1.08); opacity: 0.7; }
  70%       { transform: translate(20px, -50px) scale(0.94); opacity: 0.45; }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(30px, -20px) scale(1.06); }
}

/* ─── Floating Cards ─────────────────────────────────────── */

@keyframes floatCard1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(0.5deg); }
}

@keyframes floatCard2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-6px) rotate(-0.3deg); }
}

@keyframes floatCard3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-10px) rotate(0.4deg); }
}

/* ─── Pulse / Glow Animations ────────────────────────────── */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.95); }
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%       { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
                0 0 40px rgba(59, 130, 246, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5),
                0 0 60px rgba(139, 92, 246, 0.2);
  }
}

@keyframes cardPulseRing {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ─── Counter / Number Animation ─────────────────────────── */

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

/* ─── Flow Nodes ─────────────────────────────────────────── */

@keyframes flowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

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

/* ─── Loading Spinner ────────────────────────────────────── */

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

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

/* ─── Activity Counter Tick ──────────────────────────────── */

@keyframes countTick {
  0%   { transform: translateY(0); opacity: 1; }
  50%  { transform: translateY(-100%); opacity: 0; }
  51%  { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ─── Toast ──────────────────────────────────────────────── */

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

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

/* ─── Star Fill Animation ────────────────────────────────── */

@keyframes starFill {
  from { fill: transparent; }
  to   { fill: #FBBF24; }
}

/* ─── Border Gradient Spin ───────────────────────────────── */
@keyframes borderSpin {
  to { --angle: 360deg; }
}

/* ─── Page Load Orchestration Classes ───────────────────── */
/* Applied by JS after DOM loads */

[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate="fade-down"] {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate="scale-in"] {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-animate="slide-right"] {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* ─── Continuous Animations on Elements ─────────────────── */

.bg-orb--1 { animation: orbFloat1 18s ease-in-out infinite; }
.bg-orb--2 { animation: orbFloat2 22s ease-in-out infinite; }
.bg-orb--3 { animation: orbFloat3 15s ease-in-out infinite; }

.feature-card--1 { animation: floatCard1 5.5s ease-in-out infinite; }
.feature-card--2 { animation: floatCard2 4.8s ease-in-out infinite 0.5s; }
.feature-card--3 { animation: floatCard3 6.2s ease-in-out infinite 1s; }

.badge-dot       { animation: pulseDot 2s ease-in-out infinite; }
.status-dot--green { animation: pulseDot 2s ease-in-out infinite; }
.activity-dot    { animation: pulseDot 1.8s ease-in-out infinite; }

.auth-card__glow { animation: glowPulse 4s ease-in-out infinite; }

.card-pulse      { animation: cardPulseRing 2s ease-out infinite; }

.flow-node--active { animation: flowPulse 2s ease-in-out infinite; }

/* ─── Loading Overlay Spinner ─────────────────────────────── */
.loader-ring::before {
  animation: spin 1.2s linear infinite;
}

/* ─── Shimmer Effect ─────────────────────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* ─── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
