/* NeoCityOS Animation Styles */

/* Light Particle Animation */
.light-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(0, 247, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: lightParticleFloat 8s ease-in-out infinite;
    z-index: 10;
}

@keyframes lightParticleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-40px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.5);
    }
}

/* Neon Effect Animation */
.neon-effect {
    position: absolute;
    background: radial-gradient(circle, rgba(0, 247, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: neonPulse 6s ease-in-out infinite;
    z-index: 5;
}

@keyframes neonPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
        box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
        box-shadow: 0 0 40px rgba(0, 247, 255, 0.6);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
        box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
    }
}

/* Data Particle Animation */
.data-particle {
    position: absolute;
    color: #00f7ff;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    pointer-events: none;
    animation: dataParticleFall 5s linear infinite;
    z-index: 15;
    text-shadow: 0 0 10px #00f7ff;
}

@keyframes dataParticleFall {
    0% {
        opacity: 0;
        transform: translateY(-50px) rotate(0deg);
    }
    10% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    90% {
        opacity: 1;
        transform: translateY(100px) rotate(360deg);
    }
    100% {
        opacity: 0;
        transform: translateY(150px) rotate(720deg);
    }
}

/* Window Transition Animations */
.app-window {
    animation: windowFadeIn 0.3s ease-out;
}

@keyframes windowFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.app-window.closing {
    animation: windowFadeOut 0.3s ease-in;
}

@keyframes windowFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Shake Animation for Errors */
@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;
}

/* Glitch Effect */
.glitch-mode {
    position: relative;
}

.glitch-mode::before,
.glitch-mode::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-mode::before {
    animation: glitch-1 0.3s infinite;
    color: #ff6b6b;
    z-index: -1;
}

.glitch-mode::after {
    animation: glitch-2 0.3s infinite;
    color: #00f7ff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
}

/* Hover Effects */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
    transform: translateY(-2px);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::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.5s;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 247, 255, 0.3);
    border-top: 4px solid #00f7ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 247, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 247, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 247, 255, 0);
    }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Slide In Animation */
.slide-in {
    animation: slideIn 0.5s ease-out;
}

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

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #00f7ff;
    white-space: nowrap;
    animation: typing 3.5s 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: #00f7ff; }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.matrix-rain::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0, 247, 255, 0.1) 50%, 
        transparent 100%);
    animation: matrixRain 10s linear infinite;
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Neon Border Animation */
.neon-border {
    position: relative;
    border: 2px solid #00f7ff;
    border-radius: 8px;
    overflow: hidden;
}

.neon-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00f7ff, #ff6b6b, #51cf66, #00f7ff);
    border-radius: 8px;
    z-index: -1;
    animation: neonBorderRotate 3s linear infinite;
}

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

/* Accessibility - Reduced 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;
    }
    
    .light-particle,
    .neon-effect,
    .data-particle {
        display: none !important;
    }
}

/* Performance Optimizations */
@media (max-width: 768px) {
    .light-particle,
    .neon-effect,
    .data-particle {
        display: none;
    }
    
    .app-window {
        animation-duration: 0.2s;
    }
}

/* High Performance Mode */
.high-performance .light-particle,
.high-performance .neon-effect,
.high-performance .data-particle {
    display: none;
}

.high-performance .app-window {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
} 