/* =============================================
   ANIMATIONS
   ============================================= */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* NEW: Text reveal animation */
@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* NEW: Glitch effect */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* NEW: 3D flip animation */
@keyframes flipIn {
    0% {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* NEW: Zoom bounce */
@keyframes zoomBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* NEW: Slide up with bounce */
@keyframes slideUpBounce {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px);
        opacity: 1;
    }
    80% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* NEW: Rotate scale in */
@keyframes rotateScaleIn {
    0% {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

/* NEW: Blur in */
@keyframes blurIn {
    0% {
        filter: blur(20px);
        opacity: 0;
        transform: scale(1.2);
    }
    100% {
        filter: blur(0);
        opacity: 1;
        transform: scale(1);
    }
}

/* NEW: Elastic pop */
@keyframes elasticPop {
    0% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    85% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* NEW: Typewriter cursor blink */
@keyframes cursorBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* NEW: Gradient shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* NEW: Counter flip */
@keyframes counterFlip {
    0% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

/* NEW: Shake attention */
@keyframes shakeAttention {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* NEW: Border draw animation */
@keyframes borderDraw {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* NEW: Floating particles */
@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: translate(10px, -20px) rotate(90deg);
    }
    50% {
        transform: translate(-5px, -40px) rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: translate(15px, -60px) rotate(270deg);
    }
    100% {
        transform: translate(0, -80px) rotate(360deg);
        opacity: 0;
    }
}

/* NEW: Shine sweep */
@keyframes shineSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* NEW: Morphing blob */
@keyframes morphBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
    }
}

/* NEW: Confetti fall animation */
@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx, 50px), var(--ty, 100px)) rotate(720deg) scale(0);
    }
}

/* NEW: Text shadow pulse */
@keyframes textShadowPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 107, 53, 0.6), 0 0 60px rgba(255, 107, 53, 0.3);
    }
}

/* NEW: Border pulse */
@keyframes borderPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 107, 53, 0);
    }
}

/* NEW: Wiggle animation */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

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

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        border-color: transparent;
    }
    50% {
        border-color: var(--congress-orange);
    }
}

@keyframes wave {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

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

.animate-glow {
    animation: glow 2s infinite;
}

/* Delay Classes */
.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1s;
}

/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.animate-on-scroll.slide-left {
    transform: translateX(-50px);
}

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

.animate-on-scroll.slide-right {
    transform: translateX(50px);
}

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

.animate-on-scroll.scale {
    transform: scale(0.8);
}

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

/* Stagger Animation for Lists */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation.animated > *:nth-child(1) {
    animation: fadeInUp 0.5s ease forwards 0.1s;
}

.stagger-animation.animated > *:nth-child(2) {
    animation: fadeInUp 0.5s ease forwards 0.2s;
}

.stagger-animation.animated > *:nth-child(3) {
    animation: fadeInUp 0.5s ease forwards 0.3s;
}

.stagger-animation.animated > *:nth-child(4) {
    animation: fadeInUp 0.5s ease forwards 0.4s;
}

.stagger-animation.animated > *:nth-child(5) {
    animation: fadeInUp 0.5s ease forwards 0.5s;
}

.stagger-animation.animated > *:nth-child(6) {
    animation: fadeInUp 0.5s ease forwards 0.6s;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Text Animations */
.text-gradient-animate {
    background: linear-gradient(90deg, var(--congress-orange), var(--saffron), var(--congress-orange));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--congress-orange);
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

/* Loading Animation */
.loading-dots {
    display: inline-flex;
    gap: 5px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--congress-orange);
    border-radius: 50%;
    animation: wave 1.3s linear infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: -1.1s;
}

.loading-dots span:nth-child(3) {
    animation-delay: -0.9s;
}

/* Particle Background */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 4s; }
.particle:nth-child(2) { left: 20%; top: 40%; animation-delay: 0.5s; animation-duration: 5s; }
.particle:nth-child(3) { left: 30%; top: 60%; animation-delay: 1s; animation-duration: 6s; }
.particle:nth-child(4) { left: 40%; top: 80%; animation-delay: 1.5s; animation-duration: 4.5s; }
.particle:nth-child(5) { left: 50%; top: 30%; animation-delay: 2s; animation-duration: 5.5s; }
.particle:nth-child(6) { left: 60%; top: 50%; animation-delay: 2.5s; animation-duration: 4s; }
.particle:nth-child(7) { left: 70%; top: 70%; animation-delay: 3s; animation-duration: 6s; }
.particle:nth-child(8) { left: 80%; top: 20%; animation-delay: 3.5s; animation-duration: 5s; }
.particle:nth-child(9) { left: 90%; top: 40%; animation-delay: 4s; animation-duration: 4.5s; }
.particle:nth-child(10) { left: 15%; top: 90%; animation-delay: 4.5s; animation-duration: 5.5s; }

/* Counter Animation */
.counter-animate {
    display: inline-block;
}

/* Card Flip Animation */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* Image Reveal Animation */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--congress-orange), var(--saffron));
    transform: translateX(0);
    transition: transform 0.8s ease;
    z-index: 1;
}

.image-reveal.animated::before {
    transform: translateX(100%);
}

/* Progress Bar Animation */
.progress-animate {
    width: 0;
    transition: width 1.5s ease;
}

.progress-animate.animated {
    width: var(--progress);
}

/* Number Counter Animation - handled by JS */
.number-counter {
    display: inline-block;
}

/* Smooth Scroll Animation */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Page Transition */
.page-transition {
    animation: fadeIn 0.5s ease;
}

/* Success/Error Animation */
.success-animation {
    animation: scaleIn 0.5s ease, pulse 0.5s ease 0.5s;
}

.error-shake {
    animation: shake 0.5s ease;
}

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

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