/* ============================================
   MUHANDISLIK HUB - Animations
   Keyframes & Animation Classes
   ============================================ */

/* ============ KEYFRAMES ============ */

/* Spin Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px var(--shadow-cyan);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 40px var(--shadow-cyan), 0 0 60px var(--shadow-purple);
        opacity: 0.8;
    }
}

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

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

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

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

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

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

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

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

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Glow Animations */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px var(--primary-cyan));
    }
    50% {
        filter: drop-shadow(0 0 30px var(--primary-cyan)) drop-shadow(0 0 60px var(--primary-purple));
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: var(--primary-cyan);
        box-shadow: 0 0 10px var(--shadow-cyan);
    }
    50% {
        border-color: var(--primary-purple);
        box-shadow: 0 0 20px var(--shadow-purple);
    }
}

/* 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;
    }
}

/* Text Animations */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

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

@keyframes textShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Gear Rotation */
@keyframes gearRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* Circuit Animation */
@keyframes circuitFlow {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

/* Data Flow */
@keyframes dataFlow {
    0% {
        transform: translateX(-100%) translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(0);
        opacity: 0;
    }
}

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

/* Hub Pulse */
@keyframes hubPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

/* Scroll Indicator */
@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scrollDot {
    0%, 100% { top: 10px; opacity: 1; }
    50% { top: 25px; opacity: 0.3; }
}

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

/* Orbit Animation */
@keyframes orbit {
    0% { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(5px); }
}

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

/* Engineers Gather Animation */
@keyframes engineerGather {
    0% {
        opacity: 0;
        transform: scale(0.3) translate(var(--start-x), var(--start-y));
    }
    30% {
        opacity: 1;
        transform: scale(1.2) translate(calc(var(--start-x) * 0.5), calc(var(--start-y) * 0.5));
    }
    100% {
        opacity: 1;
        transform: scale(1) translate(var(--end-x), var(--end-y));
    }
}

/* ============ ANIMATION CLASSES ============ */

/* Spin */
.animate-spin { animation: spin 1s linear infinite; }
.animate-spin-slow { animation: spin 3s linear infinite; }
.animate-spin-reverse { animation: spinReverse 1s linear infinite; }

/* Pulse */
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

/* Fade */
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-fade-out { animation: fadeOut 0.5s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease forwards; }
.animate-fade-in-down { animation: fadeInDown 0.8s ease forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.8s ease forwards; }
.animate-fade-in-right { animation: fadeInRight 0.8s ease forwards; }

/* Scale */
.animate-scale-in { animation: scaleIn 0.5s ease forwards; }
.animate-scale-out { animation: scaleOut 0.5s ease forwards; }
.animate-scale-pulse { animation: scalePulse 2s ease-in-out infinite; }

/* Bounce */
.animate-bounce { animation: bounce 2s ease-in-out infinite; }
.animate-bounce-in { animation: bounceIn 0.8s ease forwards; }

/* Float */
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 8s ease-in-out infinite; }

/* Glow */
.animate-glow { animation: glowPulse 2s ease-in-out infinite; }
.animate-border-glow { animation: borderGlow 3s ease-in-out infinite; }

/* Slide */
.animate-slide-in-left { animation: slideInLeft 0.5s ease forwards; }
.animate-slide-in-right { animation: slideInRight 0.5s ease forwards; }
.animate-slide-in-up { animation: slideInUp 0.5s ease forwards; }
.animate-slide-in-down { animation: slideInDown 0.5s ease forwards; }

/* Text */
.animate-typewriter { animation: typewriter 3s steps(30) forwards; }
.animate-blink { animation: blink 1s step-end infinite; }
.animate-shimmer {
    background-size: 200% auto;
    animation: textShimmer 3s linear infinite;
}

/* Gear */
.animate-gear { animation: gearRotate 10s linear infinite; }
.animate-gear-reverse { animation: gearRotateReverse 10s linear infinite; }
.animate-gear-fast { animation: gearRotate 5s linear infinite; }

/* Delay 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; }

/* Duration Classes */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 0.8s; }
.duration-slower { animation-duration: 1.5s; }

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

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

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

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

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

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

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Children */
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* Hover Animations */
.hover-float:hover { transform: translateY(-10px); }
.hover-scale:hover { transform: scale(1.05); }
.hover-glow:hover { box-shadow: var(--glow-cyan); }
.hover-rotate:hover { transform: rotate(5deg); }
