/* ===================================
   SRV Biosciences - Animations
   Keyframes and Animation Classes
   =================================== */

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays for Sequential Animations */
.reveal:nth-child(1) {
    transition-delay: 0s;
}

.reveal:nth-child(2) {
    transition-delay: 0.1s;
}

.reveal:nth-child(3) {
    transition-delay: 0.2s;
}

.reveal:nth-child(4) {
    transition-delay: 0.3s;
}

.reveal:nth-child(5) {
    transition-delay: 0.4s;
}

.reveal:nth-child(6) {
    transition-delay: 0.5s;
}

.reveal:nth-child(7) {
    transition-delay: 0.6s;
}

.reveal:nth-child(8) {
    transition-delay: 0.7s;
}

/* Hero Slider Animations */
.slider-fade-enter {
    opacity: 0;
}

.slider-fade-enter-active {
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.slider-fade-exit {
    opacity: 1;
}

.slider-fade-exit-active {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* Preloader Animation */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader-logo {
    width: 200px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(to right, #2563eb, #9333ea);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
    background-size: 200% auto;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Backdrop Blur Effects */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.backdrop-blur-xl {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Transition */
.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

/* Count Up Animation (will be controlled by JS) */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* Product Card Hover */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.product-card:hover .product-icon {
    transform: scale(1.1);
    background-color: #2563eb;
    color: white;
}

.product-icon {
    transition: all 0.5s ease;
}

/* Magnetic Button Effect (simplified for vanilla JS) */
.magnetic-btn {
    transition: transform 0.2s ease;
}

/* Hero Content Animation */
.hero-content>* {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content>*:nth-child(1) {
    animation-delay: 0.1s;
}

.hero-content>*:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-content>*:nth-child(3) {
    animation-delay: 0.3s;
}

.hero-content>*:nth-child(4) {
    animation-delay: 0.4s;
}

.hero-content>*:nth-child(5) {
    animation-delay: 0.5s;
}

/* Molecule Canvas */
#molecules-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Ensure content is above molecules */
.content-layer {
    position: relative;
    z-index: 10;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}