/* ===========================
   Animation Keyframes
   =========================== */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-5px);
    }
    70% {
        transform: translateY(-2px);
    }
    90% {
        transform: translateY(-1px);
    }
}

/* ===========================
   Base Animation Classes
   =========================== */

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

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

.slide-in-left {
    animation: slideInFromLeft 0.8s ease-out forwards;
}

.slide-in-right {
    animation: slideInFromRight 0.8s ease-out forwards;
}

/* ===========================
   Animation Delays
   =========================== */

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

/* ===========================
   Scroll-triggered Animations
   =========================== */

.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.scroll-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-out;
}

.scroll-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===========================
   Staggered Animations
   =========================== */

.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

/* ===========================
   Button Hover Animations
   =========================== */

.btn-hover-scale {
    transition: transform 0.2s ease-in-out;
}

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

.btn-hover-lift {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===========================
   Card Animations
   =========================== */

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===========================
   Loading Animations
   =========================== */

.loading-fade {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out 0.3s forwards;
}

.loading-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

/* ===========================
   Hero Section Animations
   =========================== */

.hero-title {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

.hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

/* ===========================
   Icon Animations
   =========================== */

.icon-float {
    animation: bounce 2s infinite;
}

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

.icon-hover-rotate {
    transition: transform 0.3s ease;
}

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

/* ===========================
   Text Animations
   =========================== */

.text-highlight {
    background: linear-gradient(120deg, transparent 0%, transparent 50%, #0c7ff2 50%);
    background-size: 240% 100%;
    background-repeat: no-repeat;
    background-position: 100% 0;
    transition: background-position 0.6s ease;
}

.text-highlight:hover {
    background-position: 0 0;
    color: white;
}

/* ===========================
   Particle Effects (Subtle)
   =========================== */

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(12, 127, 242, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(12, 127, 242, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(12, 127, 242, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* ===========================
   Reduce motion for accessibility
   =========================== */

@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;
    }
    
    .fade-in-up,
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ===========================
   Performance Optimizations
   =========================== */

.will-animate {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===========================
   Interactive Elements
   =========================== */

.interactive-hover {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-hover:hover {
    transform: scale(1.02);
}

.interactive-press:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* ===========================
   Section Entry Animations
   =========================== */

.section-enter {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-enter.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   Smooth Scrolling Enhancement
   =========================== */

.smooth-scroll {
    scroll-behavior: smooth;
}

/* For browsers that support scroll-padding */
.scroll-target {
    scroll-margin-top: 80px; /* Account for fixed header */
}
