/* ===== Console Maven Animations ===== */
/* 60fps performance-optimized animations */
/* Version: 1.0 */

/* ===== Performance Optimizations ===== */
/* Use GPU acceleration for smooth 60fps animations */
.animate {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== Fade In Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

.fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

/* Stagger animation delays */
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }
.fade-in-delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ===== Scroll-Triggered Animations ===== */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

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

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

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

/* ===== Terminal Scan Line Effect ===== */
@keyframes scanLine {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.scan-line-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--cyber-green, #00ff88) 50%,
        transparent 100%);
    animation: scanLine 4s linear infinite;
    pointer-events: none;
    z-index: 100;
}

/* ===== Matrix Rain Background ===== */
@keyframes matrixRain {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 200px;
    }
}

.matrix-rain {
    position: relative;
    overflow: hidden;
}

.matrix-rain::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 136, 0.03) 2px,
            rgba(0, 255, 136, 0.03) 4px);
    animation: matrixRain 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.matrix-rain > * {
    position: relative;
    z-index: 1;
}

/* Subtle variant */
.matrix-rain-subtle::before {
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 3px,
            rgba(0, 255, 136, 0.01) 3px,
            rgba(0, 255, 136, 0.01) 6px);
}

/* ===== Glow Pulse Animations ===== */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 136, 0.3),
                    0 0 10px rgba(0, 255, 136, 0.2),
                    0 0 15px rgba(0, 255, 136, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.5),
                    0 0 20px rgba(0, 255, 136, 0.3),
                    0 0 30px rgba(0, 255, 136, 0.2);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 136, 0.5),
                     0 0 10px rgba(0, 255, 136, 0.3);
    }
    50% {
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.8),
                     0 0 20px rgba(0, 255, 136, 0.5),
                     0 0 30px rgba(0, 255, 136, 0.3);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

.text-glow-pulse {
    animation: textGlow 2s ease-in-out infinite;
}

/* ===== Number Counter Animation ===== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.4s ease-out;
}

/* ===== Typewriter Effect ===== */
/* NOTE: Typewriter animation is handled entirely in JavaScript
   CSS only provides the cursor styling */

/* Blinking cursor animation */
@keyframes blinkCursor {
    0%, 49% {
        border-color: var(--cyber-green, #00ff88);
    }
    50%, 100% {
        border-color: transparent;
    }
}

/* Typewriter text with animated cursor */
.typewriter-text {
    display: inline-block;
    border-right: 3px solid var(--cyber-green, #00ff88);
    padding-right: 5px;
    animation: blinkCursor 1s step-end infinite;
}

/* Keep this class for future use if needed for non-animated typewriter text */
.typewriter-no-cursor {
    overflow: hidden;
    white-space: nowrap;
    /* No animations - just text display properties */
}

/* ===== Ripple Effect (for CTAs) ===== */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* ===== Button Hover Animations ===== */
.btn-hover-lift {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

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

.btn-hover-glow {
    position: relative;
    transition: all 0.3s ease-out;
}

.btn-hover-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--cyber-green, #00ff88), var(--data-blue, #00d4ff));
    opacity: 0;
    transition: opacity 0.3s ease-out;
    z-index: -1;
    filter: blur(8px);
}

.btn-hover-glow:hover::before {
    opacity: 0.7;
}

/* ===== Slide Animations ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

.slide-in-down {
    animation: slideInDown 0.6s ease-out forwards;
}

/* ===== Scale Animations ===== */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

.scale-hover {
    transition: transform 0.3s ease-out;
}

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

/* ===== Rotation Animations ===== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.spin-slow {
    animation: spinSlow 3s linear infinite;
}

/* ===== Shake Animation ===== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ===== Bounce Animation ===== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* ===== Float Animation ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ===== Progress Bar Animation ===== */
@keyframes progressBar {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.progress-animate {
    animation: progressBar 1.5s ease-out forwards;
}

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary, #1a1f3a) 0%,
        var(--bg-tertiary, #252b47) 50%,
        var(--bg-secondary, #1a1f3a) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

/* ===== Gradient Animation ===== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* ===== Dot Pulse (Loading) ===== */
@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.dot-pulse {
    display: inline-block;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.dot-pulse-1 { animation-delay: 0s; }
.dot-pulse-2 { animation-delay: 0.2s; }
.dot-pulse-3 { animation-delay: 0.4s; }

/* ===== Border Trace Animation ===== */
@keyframes borderTrace {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%);
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.border-trace {
    position: relative;
}

.border-trace::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--cyber-green, #00ff88);
    animation: borderTrace 2s linear infinite;
}

/* ===== Parallax Effect ===== */
.parallax {
    transform: translateZ(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== Reveal Effect ===== */
@keyframes reveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal {
    animation: reveal 1s ease-out forwards;
}

/* ===== Performance: Reduce Motion ===== */
@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;
    }

    .scan-line-effect,
    .matrix-rain::before {
        animation: none !important;
    }
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile for better performance */
    .matrix-rain::before {
        animation-duration: 30s; /* Slower on mobile */
    }

    .glow-pulse {
        animation: none; /* Disable glow pulse on mobile */
    }

    .parallax {
        transform: none; /* Disable parallax on mobile */
    }
}
