/* ==========================================
   ANIMATIONS & TRANSITIONS
   ========================================== */

/* ==========================================
   KEYFRAME DEFINITIONS
   ========================================== */

/* Floating Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Gentle Float (for smaller elements) */
@keyframes float-gentle {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow Pulse */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37), 0 0 40px rgba(180, 230, 255, 0.4);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.animate-float-gentle {
    animation: float-gentle 4s ease-in-out infinite;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* ==========================================
   SCROLL-TRIGGERED ANIMATIONS
   ========================================== */

.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ==========================================
   STAGGER DELAYS (for sequential animations)
   ========================================== */

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

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

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

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

.delay-5 {
    animation-delay: 0.5s;
    transition-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
    transition-delay: 0.6s;
}

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

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    position: relative;
    transition: all var(--transition-base);
}

.hover-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 40px rgba(180, 230, 255, 0.4);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.hover-glow:hover::after {
    opacity: 1;
}

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

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

/* ==========================================
   SHIMMER EFFECT (for loading or emphasis)
   ========================================== */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    animation: shimmer 3s infinite;
}

/* ==========================================
   PARTICLE EFFECT CLASSES
   ========================================== */

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 230, 255, 0.8), transparent);
    pointer-events: none;
    animation: float-gentle 4s ease-in-out infinite;
}

/* ==========================================
   ENTRANCE ANIMATIONS (for page load)
   ========================================== */

.entrance-1 {
    animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.entrance-2 {
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.entrance-3 {
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

.entrance-4 {
    animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float,
    .animate-float-gentle,
    .animate-glow {
        animation: none;
    }

    .scroll-animate,
    .scroll-animate-left,
    .scroll-animate-right,
    .scroll-animate-scale {
        opacity: 1;
        transform: none;
    }
}

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

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

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