/* ==========================================================================
   SR Associates - Keyframe Animations, Transitions & Scroll-Reveal
   ========================================================================== */

/* Pulse Dot (Announcement Bar) */
@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(244, 195, 0, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(244, 195, 0, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(244, 195, 0, 0);
    }
}

/* Badge Pulse */
@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* AI Floating Button Ring */
@keyframes pulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.15);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Up */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Float Bounce (Decorative) */
@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Shimmer Loading Skeleton */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================================================
   NEW: Premium UI Animations
   ========================================================================== */

/* Shimmer Sweep for CTA Buttons */
@keyframes shimmerSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Slide In Up (Scroll Reveal) */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In with Bounce (Modals) */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gradient Shift (Banner backgrounds) */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Button Click Ripple */
@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Toast Progress Bar */
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast Slide In */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Counting Glow */
@keyframes countGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(244, 195, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 25px rgba(244, 195, 0, 0.6), 0 0 50px rgba(244, 195, 0, 0.2);
    }
}

/* Star Fill */
@keyframes starFill {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Image Hover Zoom */
@keyframes imageReveal {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ring Rotate (Advisor Avatar) */
@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ringRotateReverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes gradientBorderRotate {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 0 22px rgba(0, 91, 172, 0.45), 0 0 12px rgba(244, 195, 0, 0.35);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 35px rgba(244, 195, 0, 0.7), 0 0 18px rgba(0, 91, 172, 0.45);
    }
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 22px rgba(0, 91, 172, 0.45), 0 0 12px rgba(244, 195, 0, 0.35);
    }
}

/* ==========================================================================
   Scroll-Reveal Animation System (IntersectionObserver driven)
   ========================================================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Variation: Scale In */
.animate-on-scroll.scale-in {
    opacity: 0;
    transform: scale(0.92);
}

.animate-on-scroll.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Variation: Slide From Left */
.animate-on-scroll.slide-left {
    opacity: 0;
    transform: translateX(-40px);
}

.animate-on-scroll.slide-left.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Variation: Slide From Right */
.animate-on-scroll.slide-right {
    opacity: 0;
    transform: translateX(40px);
}

.animate-on-scroll.slide-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger delay utilities */
.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; }

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.fade-in-view {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.float-animation {
    animation: floatBounce 4s ease-in-out infinite;
}

.shimmer-bg {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Page transition container */
.page-transitioning {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Stat counter animated state */
.stat-counting {
    animation: countGlow 2s ease-in-out;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
