/* ==========================================
   Decolab Website - Animation Styles
   ========================================== */

/* ==========================================
   Keyframe Animations
   ========================================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Glow Animation */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(233, 69, 96, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
    }
}

/* Typewriter Animation */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink Animation */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ==========================================
   Utility Animation Classes
   ========================================== */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ==========================================
   Section Animations
   ========================================== */

/* Hero Section Animations */
.hero-title {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-actions {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Research Cards Animation */
.research-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.research-card:nth-child(1) { animation-delay: 0.1s; }
.research-card:nth-child(2) { animation-delay: 0.2s; }
.research-card:nth-child(3) { animation-delay: 0.3s; }
.research-card:nth-child(4) { animation-delay: 0.4s; }

/* Publication Cards Animation */
.publication-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.publication-card:nth-child(1) { animation-delay: 0.1s; }
.publication-card:nth-child(2) { animation-delay: 0.2s; }
.publication-card:nth-child(3) { animation-delay: 0.3s; }

/* Team Cards Animation */
.team-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.team-card:nth-child(1) { animation-delay: 0.1s; }
.team-card:nth-child(2) { animation-delay: 0.2s; }
.team-card:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================
   Laboratory Animations
   ========================================== */

/* Lab Panel Entrance */
.lab-panel {
    opacity: 0;
    transform: scale(0.95);
    animation: scaleIn 0.5s ease-out forwards;
}

.lab-panel:nth-child(1) { animation-delay: 0.1s; }
.lab-panel:nth-child(2) { animation-delay: 0.2s; }
.lab-panel:nth-child(3) { animation-delay: 0.3s; }

/* Lab Tab Animations */
.lab-tab {
    position: relative;
    overflow: hidden;
}

.lab-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-highlight);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.lab-tab.active::before {
    transform: scaleX(1);
}

/* Demo Button Animations */
.demo-controls .btn {
    position: relative;
    overflow: hidden;
}

.demo-controls .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.demo-controls .btn:active::before {
    width: 200px;
    height: 200px;
}

/* ==========================================
   Particle System Animation
   ========================================== */

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    background-color: var(--color-highlight);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

/* Different particle sizes and speeds */
.particle.small {
    width: 2px;
    height: 2px;
    animation-duration: 8s;
}

.particle.medium {
    width: 4px;
    height: 4px;
    animation-duration: 12s;
}

.particle.large {
    width: 6px;
    height: 6px;
    animation-duration: 16s;
}

/* ==========================================
   Data Flow Animation
   ========================================== */

@keyframes dataFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.data-flow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.data-packet {
    position: absolute;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-highlight), transparent);
    animation: dataFlow 3s linear infinite;
}

/* ==========================================
   Encryption Animation
   ========================================== */

@keyframes encryptTransform {
    0% {
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        filter: blur(2px);
    }
    100% {
        transform: scale(1) rotate(360deg);
        filter: blur(0px);
    }
}

.encrypt-animation {
    animation: encryptTransform 1s ease-in-out;
}

/* ==========================================
   Compression Animation
   ========================================== */

@keyframes compressShrink {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
}

.compress-animation {
    animation: compressShrink 0.8s ease-in-out;
}

/* ==========================================
   Loading Animations
   ========================================== */

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

.loading-dots::after {
    content: '.';
    animation: loadingDots 1.5s infinite;
}

/* ==========================================
   Scroll Animations
   ========================================== */

/* Intersection Observer Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(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; }
.stagger-5 { transition-delay: 0.5s; }

/* ==========================================
   Hover Animations
   ========================================== */

/* Card hover effects */
.card-hover-lift {
    transition: transform var(--transition-normal);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
}

/* Icon hover effects */
.icon-hover-spin {
    transition: transform var(--transition-fast);
}

.icon-hover-spin:hover {
    transform: rotate(180deg);
}

/* Button hover effects */
.btn-hover-glow {
    transition: all var(--transition-fast);
}

.btn-hover-glow:hover {
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

/* ==========================================
   Text Animations
   ========================================== */

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end);
}

/* Blinking cursor */
.blinking-cursor::after {
    content: '|';
    animation: blink 1s infinite;
}

/* Text gradient animation */
@keyframes textGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animated {
    background: linear-gradient(90deg, var(--color-highlight), var(--color-accent), var(--color-highlight));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 3s ease infinite;
}

/* ==========================================
   Interactive Element Animations
   ========================================== */

/* Button click animation */
@keyframes buttonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.btn-click {
    animation: buttonClick 0.2s ease-in-out;
}

/* Input focus animation */
@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
    }
}

.input-focus {
    animation: inputFocus 0.3s ease-out;
}

/* ==========================================
   Canvas Animations
   ========================================== */

/* Canvas drawing animation */
@keyframes canvasDraw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.canvas-draw {
    stroke-dasharray: 1000;
    animation: canvasDraw 2s ease-in-out forwards;
}

/* ==========================================
   Responsive Animation Adjustments
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-down,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-scale-in,
    .animate-slide-in,
    .animate-bounce,
    .animate-pulse,
    .animate-glow,
    .animate-rotate,
    .animate-shake {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .particle {
        animation: none;
    }
    
    .data-packet {
        animation: none;
    }
    
    .text-gradient-animated {
        animation: none;
    }
    
    .typewriter {
        animation: none;
        white-space: normal;
    }
    
    .blinking-cursor::after {
        animation: none;
    }
}

/* ==========================================
   Animation Performance Optimizations
   ========================================== */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-all {
    will-change: transform, opacity;
}

/* Hardware acceleration */
.hardware-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================
   Custom Animation Delays
   ========================================== */

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* ==========================================
   Animation Duration Utilities
   ========================================== */

.duration-200 { animation-duration: 0.2s; }
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }

/* ==========================================
   Animation Timing Functions
   ========================================== */

.ease-linear { animation-timing-function: linear; }
.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }