/* 3D Animations and Keyframes */

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Cube Rotation */
@keyframes rotateCube {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: rotateX(90deg) rotateY(0deg);
    }
    50% {
        transform: rotateX(90deg) rotateY(90deg);
    }
    75% {
        transform: rotateX(0deg) rotateY(90deg);
    }
    100% {
        transform: rotateX(0deg) rotateY(0deg);
    }
}

/* Building Pulse */
@keyframes buildingPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Orbit Animation */
@keyframes orbit {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

/* Slide In Animations */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Scale Animation */
@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        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);
    }
}

/* Rotate Animation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Zoom Animation */
@keyframes zoomIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Flip Animation */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    40% {
        transform: perspective(400px) rotateY(-90deg);
    }
    60% {
        transform: perspective(400px) rotateY(-90deg);
    }
    100% {
        transform: perspective(400px) rotateY(0);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Glow Animation */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 212, 255, 0.8), 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

/* Hover Effects */
.hover-float:hover {
    animation: float 2s ease-in-out infinite;
}

.hover-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

.hover-glow:hover {
    animation: glow 2s ease-in-out infinite;
}

.hover-bounce:hover {
    animation: bounce 1s ease-in-out;
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

.hover-rotate:hover {
    animation: rotate 2s linear infinite;
}

.hover-wobble:hover {
    animation: wobble 1s ease-in-out;
}

.hover-zoom:hover {
    animation: zoomIn 0.5s ease-in-out;
}

.hover-flip:hover {
    animation: flip 0.6s ease-in-out;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80%, 100% {
        content: '';
    }
}

/* Typing Animation */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* Particle Animation */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Morphing Animation */
.morphing-shape {
    animation: morph 6s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 30% 70% 70% 30% / 70% 30% 30% 70%;
        transform: rotate(270deg);
    }
}

/* Neon Glow Animation */
.neon-glow {
    animation: neonGlow 2s ease-in-out infinite alternate;
}

@keyframes neonGlow {
    from {
        text-shadow: 
            0 0 5px var(--primary-color),
            0 0 10px var(--primary-color),
            0 0 15px var(--primary-color),
            0 0 20px var(--primary-color);
    }
    to {
        text-shadow: 
            0 0 2px var(--primary-color),
            0 0 5px var(--primary-color),
            0 0 8px var(--primary-color),
            0 0 12px var(--primary-color);
    }
}

/* 3D Tilt Animation */
.tilt-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.tilt-3d:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* Liquid Animation */
.liquid {
    position: relative;
    overflow: hidden;
}

.liquid::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: liquidFlow 3s ease-in-out infinite;
}

@keyframes liquidFlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

.matrix-char {
    position: absolute;
    color: var(--primary-color);
    font-family: monospace;
    font-size: 14px;
    animation: matrixFall 10s linear infinite;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Enhanced Orbit Animation */
@keyframes orbit {
    0% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg) translateX(200px) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) translateY(-50%) rotate(360deg) translateX(200px) rotate(-360deg);
    }
}

/* Floating Icon Animation */
@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
        opacity: 1;
    }
}

/* Glitch Animations */
@keyframes glitch-1 {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: translate(2px, -2px);
        filter: hue-rotate(180deg);
    }
    30% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(270deg);
    }
    40% {
        transform: translate(2px, 2px);
        filter: hue-rotate(360deg);
    }
    50% {
        transform: translate(-2px, 0);
        filter: hue-rotate(180deg);
    }
    60% {
        transform: translate(2px, 0);
        filter: hue-rotate(270deg);
    }
    70% {
        transform: translate(0, -2px);
        filter: hue-rotate(90deg);
    }
    80% {
        transform: translate(0, 2px);
        filter: hue-rotate(0deg);
    }
    90% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(360deg);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translate(2px, -2px);
        filter: hue-rotate(270deg);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(180deg);
    }
    30% {
        transform: translate(2px, 2px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: translate(2px, 0);
        filter: hue-rotate(270deg);
    }
    60% {
        transform: translate(-2px, 0);
        filter: hue-rotate(180deg);
    }
    70% {
        transform: translate(0, 2px);
        filter: hue-rotate(90deg);
    }
    80% {
        transform: translate(0, -2px);
        filter: hue-rotate(0deg);
    }
    90% {
        transform: translate(2px, -2px);
        filter: hue-rotate(360deg);
    }
}

@keyframes glitch-main {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translate(-1px, 1px);
        filter: hue-rotate(45deg);
    }
    20% {
        transform: translate(1px, -1px);
        filter: hue-rotate(90deg);
    }
    30% {
        transform: translate(-1px, -1px);
        filter: hue-rotate(135deg);
    }
    40% {
        transform: translate(1px, 1px);
        filter: hue-rotate(180deg);
    }
    50% {
        transform: translate(-1px, 0);
        filter: hue-rotate(225deg);
    }
    60% {
        transform: translate(1px, 0);
        filter: hue-rotate(270deg);
    }
    70% {
        transform: translate(0, -1px);
        filter: hue-rotate(315deg);
    }
    80% {
        transform: translate(0, 1px);
        filter: hue-rotate(360deg);
    }
    90% {
        transform: translate(-1px, 1px);
        filter: hue-rotate(45deg);
    }
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(45deg, 
        rgba(255, 0, 150, 0.3),
        rgba(0, 255, 255, 0.3),
        rgba(255, 255, 0, 0.3),
        rgba(255, 0, 150, 0.3)
    );
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

/* Cyber Grid Background */
.cyber-grid {
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* 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;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .neon-glow {
        text-shadow: none;
        border: 2px solid var(--primary-color);
    }
    
    .hover-glow:hover {
        animation: none;
        border: 2px solid var(--primary-color);
    }
}

/* Advanced 3D Panel Animations */
@keyframes panel3DEntrance {
    0% {
        transform: translateY(100px) rotateX(-90deg);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) rotateX(5deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes panel3DExit {
    0% {
        transform: translateY(0px) rotateX(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) rotateX(5deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) rotateX(90deg);
        opacity: 0;
    }
}

@keyframes hologramScan {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes hex3DRotate {
    0% {
        transform: rotateY(0deg) rotateX(0deg) rotateZ(0deg);
    }
    25% {
        transform: rotateY(90deg) rotateX(15deg) rotateZ(30deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(0deg) rotateZ(60deg);
    }
    75% {
        transform: rotateY(270deg) rotateX(-15deg) rotateZ(90deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg) rotateZ(120deg);
    }
}

@keyframes techGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 212, 255, 0.3),
            0 0 40px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 212, 255, 0.6),
            0 0 60px rgba(0, 212, 255, 0.3),
            0 0 90px rgba(0, 212, 255, 0.1);
    }
}

@keyframes dataStream {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes cyberGrid {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

@keyframes neuralNetwork {
    0%, 100% {
        stroke-dashoffset: 0;
        opacity: 0.3;
    }
    50% {
        stroke-dashoffset: -100;
        opacity: 1;
    }
}

@keyframes quantumPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
        filter: blur(0px);
    }
    25% {
        transform: scale(1.1);
        opacity: 0.9;
        filter: blur(1px);
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: blur(2px);
    }
    75% {
        transform: scale(1.1);
        opacity: 0.9;
        filter: blur(1px);
    }
}

@keyframes holographicGlitch {
    0%, 100% {
        transform: translateX(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translateX(-2px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: translateX(2px);
        filter: hue-rotate(-90deg);
    }
    30% {
        transform: translateX(-1px);
        filter: hue-rotate(180deg);
    }
    40% {
        transform: translateX(1px);
        filter: hue-rotate(-180deg);
    }
    50% {
        transform: translateX(-2px);
        filter: hue-rotate(270deg);
    }
    60% {
        transform: translateX(2px);
        filter: hue-rotate(-270deg);
    }
    70% {
        transform: translateX(-1px);
        filter: hue-rotate(360deg);
    }
    80% {
        transform: translateX(1px);
        filter: hue-rotate(-360deg);
    }
    90% {
        transform: translateX(-2px);
        filter: hue-rotate(450deg);
    }
}

@keyframes techResonance {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: scale(1.05) rotate(1deg);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1) rotate(0deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.05) rotate(-1deg);
        opacity: 0.9;
    }
}

@keyframes energyField {
    0%, 100% {
        background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
        transform: scale(1);
    }
    50% {
        background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
        transform: scale(1.2);
    }
}

@keyframes cyberWave {
    0% {
        transform: translateX(-100%) skewX(15deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) skewX(15deg);
        opacity: 0;
    }
}

@keyframes digitalMatrix {
    0% {
        background-position: 0 0;
        opacity: 0.1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        background-position: 100px 100px;
        opacity: 0.1;
    }
}

/* Advanced 3D Hover Classes */
.hover-3d-flip:hover {
    animation: panel3DEntrance 0.6s ease forwards;
}

.hover-3d-glow:hover {
    animation: techGlow 2s ease-in-out infinite;
}

.hover-quantum:hover {
    animation: quantumPulse 1.5s ease-in-out infinite;
}

.hover-hologram:hover {
    animation: holographicGlitch 0.3s ease-in-out;
}

.hover-resonance:hover {
    animation: techResonance 2s ease-in-out infinite;
}

/* 3D Transform Classes */
.transform-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.panel-3d-entrance {
    animation: panel3DEntrance 1s ease forwards;
}

.panel-3d-exit {
    animation: panel3DExit 0.8s ease forwards;
}

.hologram-scan {
    animation: hologramScan 2s ease-in-out infinite;
}

.hex-3d-rotate {
    animation: hex3DRotate 8s ease-in-out infinite;
}

.tech-glow {
    animation: techGlow 3s ease-in-out infinite;
}

.quantum-pulse {
    animation: quantumPulse 2s ease-in-out infinite;
}

.energy-field {
    animation: energyField 4s ease-in-out infinite;
}
