/* ============================================
   ADVANCED INTRO & OUTRO ANIMATIONS
   Smooth, natural animations without spinning or warping
   ============================================ */

/* ============================================
   BASE ANIMATION UTILITIES
   ============================================ */

/* Animation delay utilities for staggered effects */
.delay-100 { animation-delay: 0.1s !important; }
.delay-200 { animation-delay: 0.2s !important; }
.delay-300 { animation-delay: 0.3s !important; }
.delay-400 { animation-delay: 0.4s !important; }
.delay-500 { animation-delay: 0.5s !important; }
.delay-600 { animation-delay: 0.6s !important; }
.delay-700 { animation-delay: 0.7s !important; }
.delay-800 { animation-delay: 0.8s !important; }

/* ============================================
   SMOOTH FADE ANIMATIONS
   ============================================ */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Fade In Up - Smooth upward slide with fade */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Fade In Down - Smooth downward slide with fade */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
    opacity: 0;
}

/* Fade In Left - Smooth left slide with fade */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

/* Fade In Right - Smooth right slide with fade */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

/* Scale In - Smooth zoom in with fade */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Scale In Up - Zoom in with upward movement */
@keyframes scaleInUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-scale-in-up {
    animation: scaleInUp 0.7s ease-out forwards;
    opacity: 0;
}

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */

/* Slide In Up - Content slides up smoothly */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-in-up {
    animation: slideInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

/* Slide In Down */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-in-down {
    animation: slideInDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

/* ============================================
   BLUR REVEAL ANIMATIONS
   ============================================ */

/* Blur In - Smooth blur to clear transition */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.animate-blur-in {
    animation: blurIn 1s ease-out forwards;
    opacity: 0;
}

/* ============================================
   STAGGERED GRID ANIMATIONS
   ============================================ */

/* Grid Item Reveal - For cards and grid items */
@keyframes gridItemReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-grid-item {
    animation: gridItemReveal 0.6s ease-out forwards;
    opacity: 0;
}

/* Staggered delays for grid children */
.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; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* ============================================
   TEXT REVEAL ANIMATIONS
   ============================================ */

/* Text Fade In - Character by character effect (CSS only) */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-text-reveal {
    animation: textReveal 0.5s ease-out forwards;
    opacity: 0;
}

/* Letter spacing animation for headers */
@keyframes letterSpaceReveal {
    from {
        opacity: 0;
        letter-spacing: 0.2em;
    }
    to {
        opacity: 1;
        letter-spacing: 0.05em;
    }
}

.animate-letter-space {
    animation: letterSpaceReveal 1s ease-out forwards;
    opacity: 0;
}

/* ============================================
   GRADIENT SWEEP ANIMATIONS
   ============================================ */

/* Gradient Reveal - Smooth color transition */
@keyframes gradientSweep {
    from {
        background-position: 200% center;
    }
    to {
        background-position: 0% center;
    }
}

.animate-gradient-sweep {
    background-size: 200% 100%;
    animation: gradientSweep 1.5s ease-out forwards;
}

/* ============================================
   BORDER DRAW ANIMATIONS
   ============================================ */

/* Border Draw - Smooth border reveal */
@keyframes borderDraw {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.animate-border-draw {
    position: relative;
}

.animate-border-draw::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid currentColor;
    animation: borderDraw 1s ease-out forwards;
    clip-path: inset(0 100% 0 0);
}

/* ============================================
   LIFT ANIMATIONS
   ============================================ */

/* Lift Up - Smooth upward float */
@keyframes liftUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-lift-up {
    animation: liftUp 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
}

/* ============================================
   GLOW REVEAL ANIMATIONS
   ============================================ */

/* Glow In - Smooth glow effect reveal */
@keyframes glowIn {
    from {
        opacity: 0;
        filter: brightness(0.5) blur(5px);
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        filter: brightness(1) blur(0);
        transform: scale(1);
    }
}

.animate-glow-in {
    animation: glowIn 1.2s ease-out forwards;
    opacity: 0;
}

/* ============================================
   SCROLL REVEAL UTILITIES
   ============================================ */

/* Default state for scroll-triggered animations */
.scroll-reveal {
    opacity: 0;
    transition: none;
}

/* Active state when in viewport */
.scroll-reveal.is-visible {
    opacity: 1;
    animation-play-state: running;
}

/* ============================================
   HOVER ENHANCEMENTS
   ============================================ */

/* Smooth lift on hover */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1),
                box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Smooth scale on hover */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Smooth glow on hover */
.hover-glow {
    transition: box-shadow 0.3s ease, filter 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(30, 64, 175, 0.5);
    filter: brightness(1.1);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

/* Button Pulse - Smooth attention grabber */
@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(30, 64, 175, 0);
    }
}

.animate-button-pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

/* Button Slide In */
@keyframes buttonSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-button-slide {
    animation: buttonSlideIn 0.6s ease-out forwards;
    opacity: 0;
}

/* ============================================
   BACKGROUND ANIMATIONS
   ============================================ */

/* Smooth background shift */
@keyframes backgroundShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-background-shift {
    background-size: 200% 200%;
    animation: backgroundShift 15s ease infinite;
}

/* ============================================
   SHIMMER EFFECT
   ============================================ */

/* Shimmer reveal for images and content */
@keyframes shimmerReveal {
    from {
        opacity: 0;
        background-position: -200% center;
    }
    to {
        opacity: 1;
        background-position: 200% center;
    }
}

.animate-shimmer {
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.animate-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmerReveal 2s ease-out;
    background-size: 200% 100%;
}

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */

/* Page fade in after preloader */
@keyframes pageReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-loaded {
    animation: pageReveal 1s ease-out forwards;
}

/* ============================================
   SECTION REVEAL ANIMATIONS
   ============================================ */

/* Section container reveal */
@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-section {
    animation: sectionReveal 1s ease-out forwards;
    opacity: 0;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Card entrance */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-card {
    animation: cardEntrance 0.7s ease-out forwards;
    opacity: 0;
}

/* Card flip reveal */
@keyframes cardFlipReveal {
    from {
        opacity: 0;
        transform: perspective(1000px) rotateX(-15deg);
    }
    to {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg);
    }
}

.animate-card-flip {
    animation: cardFlipReveal 0.8s ease-out forwards;
    opacity: 0;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce motion for users who prefer it */
@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;
    }
}

/* Hardware acceleration for smooth animations */
.animate-fade-in-up,
.animate-fade-in-down,
.animate-fade-in-left,
.animate-fade-in-right,
.animate-scale-in,
.animate-scale-in-up,
.animate-slide-in-up,
.animate-slide-in-down,
.animate-blur-in,
.animate-grid-item,
.animate-lift-up,
.animate-glow-in,
.animate-card,
.animate-card-flip {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove will-change after animation completes */
.animate-fade-in-up.animation-complete,
.animate-fade-in-down.animation-complete,
.animate-fade-in-left.animation-complete,
.animate-fade-in-right.animation-complete,
.animate-scale-in.animation-complete,
.animate-scale-in-up.animation-complete,
.animate-slide-in-up.animation-complete,
.animate-slide-in-down.animation-complete,
.animate-blur-in.animation-complete,
.animate-grid-item.animation-complete,
.animate-lift-up.animation-complete,
.animate-glow-in.animation-complete,
.animate-card.animation-complete,
.animate-card-flip.animation-complete {
    will-change: auto;
}
