/* ========================================
   KAOMA Labs - Modern Lab Animations
   ======================================== */

/* ==================== PARTICLE SYSTEM ==================== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 15s infinite ease-in-out;
}

.particle-purple {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, rgba(168, 85, 247, 0) 70%);
}

.particle-green {
    background: radial-gradient(circle, rgba(34, 197, 94, 0.8) 0%, rgba(34, 197, 94, 0) 70%);
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    25% {
        transform: translate(30px, -40px) scale(1.1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-20px, -80px) scale(0.9);
        opacity: 0.4;
    }

    75% {
        transform: translate(40px, -120px) scale(1.05);
        opacity: 0.5;
    }
}

/* ==================== GLOW EFFECTS ==================== */
.glow-pulse {
    animation: glowPulse 3s infinite ease-in-out;
}

.glow-pulse-purple {
    animation: glowPulsePurple 3s infinite ease-in-out;
}

.glow-pulse-green {
    animation: glowPulseGreen 3s infinite ease-in-out;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3),
            0 0 40px rgba(168, 85, 247, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.6),
            0 0 60px rgba(168, 85, 247, 0.3),
            0 0 80px rgba(168, 85, 247, 0.1);
    }
}

@keyframes glowPulsePurple {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(168, 85, 247, 0.7),
            0 0 40px rgba(168, 85, 247, 0.4);
    }
}

@keyframes glowPulseGreen {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.7),
            0 0 40px rgba(34, 197, 94, 0.4);
    }
}

/* ==================== SCAN LINES ==================== */
.scan-line-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.1;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(168, 85, 247, 0.8) 50%,
            transparent 100%);
    animation: scanLineMove 8s linear infinite;
}

@keyframes scanLineMove {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100vh);
    }
}

/* ==================== GRID OVERLAY ==================== */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.5;
}

/* ==================== CARD HOVER EFFECTS ==================== */
.lab-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.lab-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4),
        0 0 40px rgba(168, 85, 247, 0.2);
}

.lab-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #a855f7, #22c55e, #a855f7);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.lab-card:hover::before {
    opacity: 0.3;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ==================== DATA VISUALIZATION ==================== */
.progress-bar {
    height: 4px;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #22c55e);
    border-radius: 2px;
    animation: progressFill 2s ease-out forwards;
    position: relative;
    overflow: hidden;
}

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

@keyframes progressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ==================== NUMBER COUNTER ==================== */
.counter {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

/* ==================== REVEAL ANIMATIONS ==================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== SEQUENTIAL REVEAL ==================== */
.sequential-reveal>* {
    opacity: 0;
    transform: translateY(20px);
    animation: sequentialFadeIn 0.6s ease-out forwards;
}

.sequential-reveal>*:nth-child(1) {
    animation-delay: 0.1s;
}

.sequential-reveal>*:nth-child(2) {
    animation-delay: 0.2s;
}

.sequential-reveal>*:nth-child(3) {
    animation-delay: 0.3s;
}

.sequential-reveal>*:nth-child(4) {
    animation-delay: 0.4s;
}

.sequential-reveal>*:nth-child(5) {
    animation-delay: 0.5s;
}

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

/* ==================== HOLOGRAPHIC EFFECT ==================== */
.holographic {
    position: relative;
    background: linear-gradient(135deg,
            rgba(168, 85, 247, 0.1) 0%,
            rgba(34, 197, 94, 0.1) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.holographic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(168, 85, 247, 0.3),
            transparent);
    animation: holographicSweep 3s infinite;
}

@keyframes holographicSweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* ==================== LOADING SPINNER ==================== */
.lab-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .lab-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .particle {
        animation-duration: 20s;
    }
}

/* ==================== PERFORMANCE OPTIMIZATION ==================== */
@media (prefers-reduced-motion: reduce) {

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