/* ========================================
   Animations - Modern Landing Pages
======================================== */

/* ========== KEYFRAMES ========== */

/* 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 scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

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

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

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

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

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

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: currentColor;
    }
}

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

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

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* ========== ANIMATION CLASSES ========== */

/* Fade Animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

/* Scale Animations */
.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

.animate-scale-up {
    animation: scaleUp 0.3s ease-out;
}

/* Rotation Animations */
.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out;
}

/* Float Animation */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Shake Animation */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Slide Animations */
.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

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

.animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

/* Loading Animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Glow Animation */
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Wobble Animation */
.animate-wobble {
    animation: wobble 1s ease-in-out;
}

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

/* Base class for scroll animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Staggered animations */
.scroll-animate:nth-child(1) { transition-delay: 0.1s; }
.scroll-animate:nth-child(2) { transition-delay: 0.2s; }
.scroll-animate:nth-child(3) { transition-delay: 0.3s; }
.scroll-animate:nth-child(4) { transition-delay: 0.4s; }
.scroll-animate:nth-child(5) { transition-delay: 0.5s; }
.scroll-animate:nth-child(6) { transition-delay: 0.6s; }

/* Different scroll animation types */
.scroll-fade-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.scroll-fade-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

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

/* Card hover effects */
.hover-lift {
    transition: var(--transition-all);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.hover-scale {
    transition: var(--transition-transform);
}

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

.hover-rotate {
    transition: var(--transition-transform);
}

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

.hover-tilt {
    transition: var(--transition-transform);
}

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

/* Button hover effects */
.btn-hover-slide {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-dark);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-hover-slide:hover::before {
    left: 0;
}

.btn-hover-bounce {
    transition: var(--transition-transform);
}

.btn-hover-bounce:hover {
    animation: bounce 0.6s ease-in-out;
}

/* Icon hover effects */
.icon-hover-spin {
    transition: var(--transition-transform);
}

.icon-hover-spin:hover {
    transform: rotate(360deg);
}

.icon-hover-pulse {
    transition: var(--transition-all);
}

.icon-hover-pulse:hover {
    animation: pulse 1s ease-in-out;
}

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

/* Typing effect */
.typing-text {
    overflow: hidden;
    border-right: 2px solid currentColor;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

.typing-text.animation-complete {
    border-right: none;
    animation: none;
}

/* Gradient text animation */
.gradient-text-animated {
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--accent-blue), var(--primary-light));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Letter spacing animation */
.letter-spacing-hover {
    transition: letter-spacing 0.3s ease;
}

.letter-spacing-hover:hover {
    letter-spacing: 2px;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Dot loading */
.dots-loading {
    display: inline-block;
}

.dots-loading::after {
    content: '';
    animation: dots 2s linear infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    25%, 45% {
        content: '.';
    }
    50%, 70% {
        content: '..';
    }
    75%, 95% {
        content: '...';
    }
}

/* ========== TRANSITION UTILITIES ========== */

.transition-all {
    transition: var(--transition-all);
}

.transition-colors {
    transition: var(--transition-colors);
}

.transition-opacity {
    transition: var(--transition-opacity);
}

.transition-shadow {
    transition: var(--transition-shadow);
}

.transition-transform {
    transition: var(--transition-transform);
}

/* Duration modifiers */
.duration-75 {
    transition-duration: 75ms;
}

.duration-100 {
    transition-duration: 100ms;
}

.duration-150 {
    transition-duration: 150ms;
}

.duration-200 {
    transition-duration: 200ms;
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-500 {
    transition-duration: 500ms;
}

.duration-700 {
    transition-duration: 700ms;
}

.duration-1000 {
    transition-duration: 1000ms;
}

/* Easing modifiers */
.ease-linear {
    transition-timing-function: var(--ease-linear);
}

.ease-in {
    transition-timing-function: var(--ease-in);
}

.ease-out {
    transition-timing-function: var(--ease-out);
}

.ease-in-out {
    transition-timing-function: var(--ease-in-out);
}

.ease-in-back {
    transition-timing-function: var(--ease-in-back);
}

.ease-out-back {
    transition-timing-function: var(--ease-out-back);
}

/* ========== REDUCED MOTION ========== */

/* Respect user's motion preferences */
@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-float,
    .animate-pulse,
    .animate-bounce,
    .animate-rotate,
    .animate-spin {
        animation: none !important;
    }

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

/* ========== PERFORMANCE OPTIMIZATIONS ========== */

/* GPU acceleration for smooth animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

/* Prevent layout thrashing */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}