/* ===== PROFESSIONAL ANIMATIONS LIBRARY ===== */

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInDown {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translate3d(-100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        transform: translate3d(100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

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

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

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

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

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

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Loading Animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Background Animations */
@keyframes backgroundFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(10px, -10px) rotate(90deg);
    }
    50% {
        transform: translate(0, -20px) rotate(180deg);
    }
    75% {
        transform: translate(-10px, -10px) rotate(270deg);
    }
}

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

/* Typography Animations */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCaret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-500);
    }
}

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

/* Entrance Animations */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Hover Animations */
.hover-float:hover {
    animation: float 3s ease-in-out infinite;
}

.hover-pulse:hover {
    animation: pulse 2s ease-in-out infinite;
}

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

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

.hover-spin:hover {
    animation: spin 1s linear infinite;
}

.hover-gradient:hover {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.loading-progress {
    animation: progress 2s ease-in-out infinite;
}

/* Background Effects */
.background-float {
    animation: backgroundFloat 20s ease-in-out infinite;
}

.ripple-effect {
    animation: ripple 0.6s linear;
}

/* Text Animations */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-500);
    white-space: nowrap;
    margin: 0 auto;
    animation: typewriter 3.5s steps(40, end),
               blinkCaret 0.75s step-end infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* Animation Control */
.animation-paused {
    animation-play-state: paused;
}

.animation-running {
    animation-play-state: running;
}

.animation-infinite {
    animation-iteration-count: infinite;
}

.animation-once {
    animation-iteration-count: 1;
}

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

/* Scroll Triggered Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].animate {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-500);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Wave Animation */
.wave {
    display: inline-block;
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Floating Elements */
.floating {
    animation: float 6s ease-in-out infinite;
}

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

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

/* Attention Seekers */
.attention-bounce {
    animation: bounce 2s infinite;
}

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

.attention-flash {
    animation: pulse 1s infinite;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.3s ease-out forwards;
}

.page-loader.hidden {
    animation: fadeIn 0.3s ease-out reverse forwards;
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500), var(--accent-500));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}