/**
 * Custom Animations for KPW-RSSA Seminar Landing Page
 * High-converting CTA effects and micro-interactions
 */

/* ============================================
   Pulsing CTA Button Animations
   ============================================ */

/* Continuous pulse with shadow */
@keyframes pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(255, 107, 53, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
        transform: scale(1);
    }
}

.pulse-cta {
    animation: pulse-shadow 2s infinite;
    transition: all 0.3s ease;
}

.pulse-cta:hover {
    animation-play-state: paused;
    transform: scale(1.05) !important;
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.3);
}

/* Urgent pulse for critical CTAs */
@keyframes urgent-pulse {
    0%, 100% {
        transform: scale(1);
        background-color: #ef4444;
    }
    25% {
        transform: scale(1.03);
        background-color: #dc2626;
    }
    50% {
        transform: scale(1);
        background-color: #ef4444;
    }
    75% {
        transform: scale(1.03);
        background-color: #dc2626;
    }
}

.urgent-pulse {
    animation: urgent-pulse 1.5s infinite;
}

/* ============================================
   Gradient Background Animations
   ============================================ */

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

.animated-gradient {
    background: linear-gradient(-45deg, #1e3a5f, #0891b2, #1e3a5f, #0891b2);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Faster gradient for hover states */
.animated-gradient-fast {
    background: linear-gradient(-45deg, #ff6b35, #ff8c42, #ff6b35, #ff8c42);
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
}

/* ============================================
   Counter Animations
   ============================================ */

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

.count-animation {
    animation: count-up 0.6s ease-out forwards;
}

/* Number rolling effect */
@keyframes number-roll {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.number-roll {
    animation: number-roll 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Floating Elements
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(-1deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

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

/* Subtle float for badges */
@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

.gentle-float {
    animation: gentle-float 3s ease-in-out infinite;
}

/* ============================================
   Live Indicator Animations
   ============================================ */

@keyframes live-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.live-dot {
    animation: live-pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

/* Live broadcast effect */
@keyframes broadcast {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 1);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.broadcast-dot {
    background: #ef4444;
    border-radius: 50%;
    animation: broadcast 1.5s infinite;
}

/* ============================================
   Check Mark Animations
   ============================================ */

@keyframes check-in {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.check-item {
    animation: check-in 0.5s ease-out forwards;
    opacity: 0;
}

/* Staggered check animation */
.check-item:nth-child(1) { animation-delay: 0.1s; }
.check-item:nth-child(2) { animation-delay: 0.2s; }
.check-item:nth-child(3) { animation-delay: 0.3s; }
.check-item:nth-child(4) { animation-delay: 0.4s; }
.check-item:nth-child(5) { animation-delay: 0.5s; }
.check-item:nth-child(6) { animation-delay: 0.6s; }
.check-item:nth-child(7) { animation-delay: 0.7s; }
.check-item:nth-child(8) { animation-delay: 0.8s; }

/* Check mark draw animation */
@keyframes check-draw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.check-draw {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: check-draw 0.5s ease-out forwards;
}

/* ============================================
   Form Input Animations
   ============================================ */

/* Focus glow effect */
@keyframes input-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
    }
}

.input-focus-glow:focus {
    animation: input-glow 0.5s ease-out;
    border-color: #3b82f6;
}

/* Success checkmark */
@keyframes success-check {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.success-check {
    animation: success-check 0.3s ease-out forwards;
}

/* ============================================
   Loading Animations
   ============================================ */

/* Dots loading */
@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-dot {
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0; }

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

.spinner {
    animation: spin 1s linear infinite;
}

/* ============================================
   Confetti Animation
   ============================================ */

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    animation: confetti-fall 3s linear forwards;
}

/* ============================================
   Bounce Animations
   ============================================ */

@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Attention bounce */
@keyframes attention-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(-10px);
    }
    75% {
        transform: translateY(-15px);
    }
}

.attention-bounce {
    animation: attention-bounce 2s ease-in-out infinite;
}

/* ============================================
   Slide Animations
   ============================================ */

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slide-in-right 0.5s ease-out forwards;
}

.slide-in-left {
    animation: slide-in-left 0.5s ease-out forwards;
}

.slide-in-up {
    animation: slide-in-up 0.5s ease-out forwards;
}

/* ============================================
   Shake Animation for Urgency
   ============================================ */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Gentle shake for attention */
@keyframes gentle-shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-1deg);
    }
    75% {
        transform: rotate(1deg);
    }
}

.gentle-shake {
    animation: gentle-shake 0.3s ease-in-out;
}

/* ============================================
   Progress Bar Animations
   ============================================ */

@keyframes progress-fill {
    from {
        width: 0%;
    }
}

.progress-fill {
    animation: progress-fill 2s ease-out forwards;
}

/* Striped progress animation */
@keyframes progress-stripes {
    from {
        background-position: 40px 0;
    }
    to {
        background-position: 0 0;
    }
}

.progress-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, .15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, .15) 50%,
        rgba(255, 255, 255, .15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: progress-stripes 1s linear infinite;
}

/* ============================================
   Fade Animations
   ============================================ */

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.fade-in {
    animation: fade-in 0.5s ease-out;
}

.fade-in-up {
    animation: fade-in-up 0.5s ease-out;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Disable animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }