/* ============================================
   Animation Library - URL Shortener Pro
   Comprehensive collection of reusable animations
   ============================================ */

/* ========== Keyframe Animations ========== */

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@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 heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@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);
    }
}

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Rotate Animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }

    to {
        transform: perspective(400px) rotateY(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 5px currentColor;
    }

    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Loading Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* ========== Animation Utility Classes ========== */

/* Fade Classes */
.animate-fade-in {
    animation: fadeIn var(--duration-500) ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-500) ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown var(--duration-500) ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft var(--duration-500) ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight var(--duration-500) ease-out;
}

/* Scale Classes */
.animate-scale-in {
    animation: scaleIn var(--duration-300) ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-bounce-in {
    animation: bounceIn var(--duration-700) cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Slide Classes */
.animate-slide-in-up {
    animation: slideInUp var(--duration-500) ease-out;
}

.animate-slide-in-down {
    animation: slideInDown var(--duration-500) ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft var(--duration-500) ease-out;
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-500) ease-out;
}

/* Rotate Classes */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-flip {
    animation: flip 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake var(--duration-500) ease-in-out;
}

/* Glow Classes */
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ========== On-Scroll Animation Observer ========== */

.animate-on-scroll {
    opacity: 0;
    transition: opacity var(--duration-700) ease-out, transform var(--duration-700) ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
}