/* JaldiMoney V2 — Animations */

/* Fade In Up */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Fade In Left */
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in-left {
    animation: fadeInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Fade In Right */
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-in-right {
    animation: fadeInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Scale In */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Typewriter effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}
@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: #10b981; }
}
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #10b981;
    animation: typewriter 2s steps(40) 0.5s forwards, blink 0.8s step-end infinite;
    width: 0;
}

/* Gauge fill animation */
@keyframes gaugeFill {
    from { stroke-dashoffset: 565; }
}
.animate-gauge {
    animation: gaugeFill 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Slide in from bottom (for modals/drawers) */
@keyframes slideInBottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.animate-slide-in-bottom {
    animation: slideInBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide in from right (for mobile menu) */
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.animate-slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Bounce in */
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered card reveal */
@keyframes cardReveal {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.card-reveal {
    opacity: 0;
    animation: cardReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.card-reveal:nth-child(1) { animation-delay: 0.05s; }
.card-reveal:nth-child(2) { animation-delay: 0.1s; }
.card-reveal:nth-child(3) { animation-delay: 0.15s; }
.card-reveal:nth-child(4) { animation-delay: 0.2s; }
.card-reveal:nth-child(5) { animation-delay: 0.25s; }
.card-reveal:nth-child(6) { animation-delay: 0.3s; }
.card-reveal:nth-child(7) { animation-delay: 0.35s; }
.card-reveal:nth-child(8) { animation-delay: 0.4s; }
.card-reveal:nth-child(9) { animation-delay: 0.45s; }
.card-reveal:nth-child(10) { animation-delay: 0.5s; }

/* Progress bar fill */
@keyframes progressFill {
    from { width: 0; }
}
.animate-progress {
    animation: progressFill 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Spin (for loading) */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin 2s linear infinite;
}

/* Dot loading */
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0); opacity: 0; }
    40% { transform: scale(1); opacity: 1; }
}
.dot-loading span:nth-child(1) { animation: dotPulse 1.4s ease-in-out infinite; }
.dot-loading span:nth-child(2) { animation: dotPulse 1.4s ease-in-out 0.2s infinite; }
.dot-loading span:nth-child(3) { animation: dotPulse 1.4s ease-in-out 0.4s infinite; }

/* Number count up (JS-driven, this just handles the display) */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* Gradient border animation */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.gradient-border {
    background: linear-gradient(90deg, #10b981, #3b50e0, #10b981);
    background-size: 200% 200%;
    animation: gradientBorder 3s ease infinite;
    padding: 2px;
    border-radius: 16px;
}
.gradient-border > * {
    border-radius: 14px;
}

/* Ripple effect for buttons */
.ripple {
    position: relative;
    overflow: hidden;
}
.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}
.ripple:active::after {
    width: 300px;
    height: 300px;
}
