/* ===== KEYFRAME ANIMATIONS ===== */

/* Loading Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

/* Entry Animations */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes fadeInRight {
    0% {
        transform: translateX(50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Geometric Shape Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(2deg);
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 20;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Workflow Animations */
@keyframes discoveryPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes dataPointFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) scale(1.1);
        opacity: 1;
    }
}

@keyframes blueprintDraw {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes codeBlockType {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

@keyframes testBarGrow {
    0% {
        height: 0;
        opacity: 0;
    }
    100% {
        height: 100%;
        opacity: 1;
    }
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rocketLaunch {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateY(-40px) rotate(-5deg);
    }
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Portfolio Project Animations */
@keyframes browserLoad {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes graphBarGrow {
    0% {
        height: 0;
    }
    100% {
        height: var(--bar-height, 100%);
    }
}

@keyframes mobileSlide {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes neuronPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes dataFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes productCardHover {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

/* Form Animations */
@keyframes formSubmitRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes inputFocus {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

/* Particle Animations */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
}

@keyframes particleTwinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Hover Animations */
@keyframes hoverGlow {
    0% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

@keyframes hoverBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes hoverRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Screen Enhancements */
@keyframes loadingSpinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loadingPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* ===== ANIMATION UTILITY CLASSES ===== */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

.animate-rotate {
    animation: rotate 10s linear infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

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

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

.animate-fade-in-left {
    animation: slideInFromLeft 0.6s ease-out;
}

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

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

/* 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-700 { animation-delay: 0.7s; }
.delay-1000 { animation-delay: 1s; }

/* ===== SPECIFIC ELEMENT ANIMATIONS ===== */

/* Workflow Step Animations */
.discovery-animation .search-icon {
    animation: discoveryPulse 2s ease-in-out infinite;
}

.discovery-animation .point {
    animation: dataPointFloat 3s ease-in-out infinite;
}

.discovery-animation .point-1 { animation-delay: 0s; }
.discovery-animation .point-2 { animation-delay: 0.5s; }
.discovery-animation .point-3 { animation-delay: 1s; }
.discovery-animation .point-4 { animation-delay: 1.5s; }

.strategy-animation .blueprint-line {
    stroke-dasharray: 100;
    animation: blueprintDraw 3s ease-in-out infinite;
}

.strategy-animation .blueprint-line.line-1 { animation-delay: 0s; }
.strategy-animation .blueprint-line.line-2 { animation-delay: 0.5s; }
.strategy-animation .blueprint-line.line-3 { animation-delay: 1s; }

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

.strategy-animation .blueprint-node.node-1 { animation-delay: 0.2s; }
.strategy-animation .blueprint-node.node-2 { animation-delay: 0.7s; }
.strategy-animation .blueprint-node.node-3 { animation-delay: 1.2s; }

.development-animation .code-block {
    animation: codeBlockType 2s ease-in-out infinite;
}

.development-animation .code-block.block-1 { animation-delay: 0s; }
.development-animation .code-block.block-2 { animation-delay: 0.3s; }
.development-animation .code-block.block-3 { animation-delay: 0.6s; }

.development-animation .design-element {
    animation: float 4s ease-in-out infinite;
}

.development-animation .design-element.element-1 { animation-delay: 0s; }
.development-animation .design-element.element-2 { animation-delay: 1s; }

.testing-animation .result-bar {
    animation: testBarGrow 3s ease-in-out infinite;
}

.testing-animation .result-bar.bar-1 { animation-delay: 0s; }
.testing-animation .result-bar.bar-2 { animation-delay: 0.5s; }
.testing-animation .result-bar.bar-3 { animation-delay: 1s; }

.testing-animation .checkmark {
    animation: checkmarkPop 2s ease-in-out infinite;
}

.testing-animation .checkmark.check-1 { animation-delay: 1.5s; }
.testing-animation .checkmark.check-2 { animation-delay: 2s; }
.testing-animation .checkmark.check-3 { animation-delay: 2.5s; }

.launch-animation .rocket {
    animation: rocketLaunch 3s ease-in-out infinite;
}

.launch-animation .trail-particle {
    animation: trailFade 1s ease-out infinite;
}

.launch-animation .trail-particle.particle-1 { animation-delay: 0s; }
.launch-animation .trail-particle.particle-2 { animation-delay: 0.2s; }
.launch-animation .trail-particle.particle-3 { animation-delay: 0.4s; }

/* Portfolio Project Animations */
.web-project .browser-frame {
    animation: browserLoad 1s ease-out;
}

.web-project .graph-bar {
    animation: graphBarGrow 2s ease-out;
}

.web-project .graph-bar.bar-1 { animation-delay: 0.2s; --bar-height: 60%; }
.web-project .graph-bar.bar-2 { animation-delay: 0.4s; --bar-height: 80%; }
.web-project .graph-bar.bar-3 { animation-delay: 0.6s; --bar-height: 45%; }
.web-project .graph-bar.bar-4 { animation-delay: 0.8s; --bar-height: 90%; }

.mobile-project .mobile-content {
    animation: mobileSlide 1s ease-out 0.3s both;
}

.mobile-project .mobile-card {
    animation: fadeInUp 0.6s ease-out;
}

.mobile-project .mobile-card.card-1 { animation-delay: 0.5s; }
.mobile-project .mobile-card.card-2 { animation-delay: 0.7s; }
.mobile-project .mobile-card.card-3 { animation-delay: 0.9s; }

.ai-project .neuron {
    animation: neuronPulse 2s ease-in-out infinite;
}

.ai-project .neuron.neuron-1 { animation-delay: 0s; }
.ai-project .neuron.neuron-2 { animation-delay: 0.3s; }
.ai-project .neuron.neuron-3 { animation-delay: 0.6s; }
.ai-project .neuron.neuron-4 { animation-delay: 0.9s; }

.ai-project .flow-particle {
    animation: dataFlow 3s ease-in-out infinite;
}

.ai-project .flow-particle.particle-1 { animation-delay: 0s; }
.ai-project .flow-particle.particle-2 { animation-delay: 1s; }
.ai-project .flow-particle.particle-3 { animation-delay: 2s; }

.ecommerce-project .product-card {
    animation: productCardHover 0.3s ease-out;
}

.ecommerce-project .product-card:hover {
    animation: hoverBounce 0.6s ease-in-out;
}

/* Service Card Animations */
.service-card:hover .service-graphic {
    animation: hoverGlow 0.3s ease-out forwards;
}

.service-card[data-service="consulting"]:hover .service-graphic {
    animation: hoverRotate 2s ease-in-out infinite;
}

/* Form Animations */
.form-submit .submit-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.form-submit:active .submit-circle {
    animation: formSubmitRipple 0.6s ease-out;
}

/* Scroll Animations */
@keyframes slideInFromBottom {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.scroll-animate {
    opacity: 0;
    animation: slideInFromBottom 0.8s ease-out forwards;
}

/* Particle System */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation: particleTwinkle 3s ease-in-out infinite;
}

/* Advanced Hover Effects */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    left: 100%;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .animate-float {
        animation-duration: 8s;
    }
    
    .hero-title .title-line {
        animation-duration: 0.8s;
    }
    
    .particle {
        animation-duration: 10s;
    }
}

@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;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
} 