/* Animation Keyframes and Effects */

/* Glow Animation */
@keyframes glow {
    0% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    100% {
        text-shadow: 0 0 30px rgba(102, 126, 234, 0.8), 0 0 40px rgba(118, 75, 162, 0.6);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

/* Typing Effect */
@keyframes typing {
    0%, 100% {
        width: 0;
    }
    50% {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Typing Dots Animation */
@keyframes typing-dots {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-15px) rotate(3deg);
    }
}

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

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

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

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

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

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

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

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

/* Rotate In Animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

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

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

/* Matrix Rain Effect */
@keyframes matrixRain {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-char {
    position: absolute;
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrixRain linear infinite;
    opacity: 0.7;
}

/* Neural Network Pulse */
@keyframes neuralPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.neural-node {
    animation: neuralPulse 2s ease-in-out infinite;
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Progress Bar Animation */
@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: var(--progress-width, 100%);
    }
}

.progress-animate {
    animation: progressFill 2s ease-out forwards;
}

/* Button Hover Effects */
.btn-hover-glow:hover {
    box-shadow: 0 0 30px currentColor;
    transform: translateY(-2px);
}

.btn-hover-pulse:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Card Hover Effects */
.card-hover-lift:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
    border-color: var(--accent-purple);
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

.text-reveal {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-cyan);
    animation: textReveal 2s steps(40) 1s forwards, blink 1s infinite 3s;
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-30px) translateX(10px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) translateX(-10px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-40px) translateX(5px) rotate(270deg);
        opacity: 0.9;
    }
}

.particle {
    animation: particleFloat 6s ease-in-out infinite;
}

/* Delayed Animation Classes */
.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; }

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-fast {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-transition-slow {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Scale Effects */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-scale-sm:hover {
    transform: scale(1.02);
}

.hover-scale-lg:hover {
    transform: scale(1.1);
}

/* Parallax Effects */
.parallax-slow {
    transform: translateZ(0);
    will-change: transform;
}

/* Intersection Observer Animations */
.observe-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.observe-fade.in-view {
    opacity: 1;
    transform: translateY(0);
}

.observe-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.observe-slide-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.observe-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.observe-slide-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.observe-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease-out;
}

.observe-scale.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
}

.smooth-scroll {
    scroll-behavior: smooth;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .parallax-slow {
        transform: none !important;
    }
}