/**
 * Enhanced Animations & Visual Effects
 * Modern CSS animations and transitions
 */

/* ========================================
   Pulse Animation for CTAs
   ======================================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

.btn-primary.pulse {
    animation: pulse 2s infinite;
}

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

.gradient-animated {
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

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

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

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

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

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

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

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

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

.shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   Bounce Animation
   ======================================== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

.bounce {
    animation: bounce 2s ease infinite;
}

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

.rotate {
    animation: rotate 20s linear infinite;
}

/* ========================================
   Scale on Hover
   ======================================== */
.scale-hover {
    transition: transform 0.3s ease;
}

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

/* ========================================
   Glow Effect
   ======================================== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
    }
}

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

/* ========================================
   Text Gradient Animation
   ======================================== */
@keyframes text-gradient {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

.text-gradient-animated {
    background: linear-gradient(
        90deg,
        #2563eb,
        #f59e0b,
        #10b981,
        #2563eb
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient 3s ease infinite;
    display: inline-block;
    white-space: normal;
    word-wrap: break-word;
}

/* ========================================
   Card Shine Effect
   ======================================== */
.card-shine {
    position: relative;
    overflow: hidden;
}

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

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

/* ========================================
   Stagger Children Animation
   ======================================== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   Number Counter Animation
   ======================================== */
.counter-animate {
    display: inline-block;
    transition: all 0.3s ease;
}

.counter-animate.counting {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* ========================================
   Button Loading State
   ======================================== */
@keyframes button-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading 0.6s linear infinite;
}

/* ========================================
   Underline Hover Effect
   ======================================== */
.underline-hover {
    position: relative;
    display: inline-block;
}

.underline-hover::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.underline-hover:hover::after {
    width: 100%;
}

/* ========================================
   Background Patterns
   ======================================== */
.pattern-dots {
    background-image: radial-gradient(circle, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.pattern-grid {
    background-image: 
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ========================================
   Icon Animations
   ======================================== */
.icon-bounce {
    animation: bounce 1s ease infinite;
}

.icon-rotate {
    animation: rotate 10s linear infinite;
}

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

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

/* ========================================
   Parallax Layers
   ======================================== */
.parallax-slow {
    transform: translateZ(0);
    will-change: transform;
}

/* ========================================
   Highlight Animation
   ======================================== */
@keyframes highlight {
    0% {
        background-size: 0% 100%;
    }
    100% {
        background-size: 100% 100%;
    }
}

.highlight-animated {
    background: linear-gradient(
        to right,
        rgba(245, 158, 11, 0.3) 0%,
        rgba(245, 158, 11, 0.3) 100%
    );
    background-repeat: no-repeat;
    background-size: 0% 100%;
    animation: highlight 1s ease-in-out forwards;
    animation-delay: 0.5s;
}

/* ========================================
   Modal/Popup Animations
   ======================================== */
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-animate {
    animation: modal-fade-in 0.3s ease-out;
}

/* ========================================
   Scroll Progress Indicator
   ======================================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #f59e0b);
    z-index: 9999;
    transition: width 0.1s ease;
}

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

