/* ========== Advanced Animations Library ========== */

/* ========== Fade In Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@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);
    }
}

/* ========== Scale Animations ========== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* ========== Rotation Animations ========== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ========== Glow Animations ========== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(150, 191, 72, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(150, 191, 72, 0.6);
    }
}

@keyframes glowText {
    0%, 100% {
        text-shadow: 0 0 10px rgba(150, 191, 72, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(150, 191, 72, 0.8), 0 0 30px rgba(150, 191, 72, 0.6);
    }
}

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

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

/* ========== Scroll Reveal Classes ========== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in-down.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========== Stagger Animation (delay for child elements) ========== */
.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(150, 191, 72, 0.5);
}

.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);
}

/* ========== Card Flip Animation ========== */
.flip-card {
    perspective: 1000px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

/* ========== Shimmer Effect ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(150, 191, 72, 0.2),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========== Typing Animation ========== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-text {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

/* ========== Floating Animation ========== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ========== Wave Animation ========== */
@keyframes wave {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(0) translateX(10px);
    }
    75% {
        transform: translateY(10px) translateX(5px);
    }
}

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

/* ========== Particles Background ========== */
.particles-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 10s infinite ease-in-out;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(100px, -100px) scale(1.2);
        opacity: 0.5;
    }
    50% {
        transform: translate(200px, -50px) scale(0.8);
        opacity: 0.2;
    }
    75% {
        transform: translate(100px, 50px) scale(1.1);
        opacity: 0.4;
    }
}

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

/* ========== Progress Bar Animation ========== */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    height: 4px;
    background: var(--primary-color);
    animation: progressBar 2s ease-in-out forwards;
}

/* ========== Ripple Effect ========== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(150, 191, 72, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* ========== Slide In Animations ========== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

/* ========== Count Up Animation ========== */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* ========== Tilt Animation on Hover ========== */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ========== Background Gradient Animation ========== */
.animated-gradient {
    background: linear-gradient(
        -45deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

/* ========== Spotlight Effect ========== */
@keyframes spotlight {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.spotlight-effect {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(150, 191, 72, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: spotlight 3s ease-in-out infinite;
}

/* ========== Blur In Animation ========== */
@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 1s ease forwards;
}

/* ========== Text Reveal Animation ========== */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s ease forwards;
}

/* ========== Performance Optimizations ========== */
.animate-on-scroll,
.fade-in-up,
.fade-in-down,
.fade-in-left,
.fade-in-right,
.scale-in,
.slide-in-left,
.slide-in-right {
    will-change: transform, opacity;
}

/* 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;
    }
}

.hero-title {
    animation: fadeInUp 1.5s ease-out; /* Fade-in effect for the title */
}

.hero-description {
    animation: fadeInUp 2s ease-out 0.5s; /* Delay effect for description */
}

.hero-buttons .btn {
    animation: fadeInUp 2s ease-out 1s; /* Delay effect for buttons */
}

