/* Enhanced Parallax Effects for NXSYS Website */

/* Parallax Container Base */
.parallax-section {
    position: relative;
    overflow: hidden;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Parallax Layers */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.parallax-layer-bg {
    z-index: 1;
}

.parallax-layer-mid {
    z-index: 2;
}

.parallax-layer-front {
    z-index: 3;
}

/* AI Neural Network Background Pattern */
.ai-network-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    position: relative;
}

.ai-network-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(200, 16, 46, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(200, 16, 46, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(200, 16, 46, 0.12) 0%, transparent 50%);
    animation: aiPulse 8s ease-in-out infinite;
}

.ai-network-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C8102E' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    animation: patternSlide 20s linear infinite;
}

@keyframes aiPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes patternSlide {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(60px, 60px);
    }
}

/* Floating Particles Animation */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 15s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 14s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 16s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 17s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4.5s; animation-duration: 15s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1.5s; animation-duration: 19s; }

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Data Stream Effect */
.data-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.data-line {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    opacity: 0.3;
    animation: dataFlow 8s linear infinite;
}

.data-line:nth-child(1) { left: 15%; animation-delay: 0s; }
.data-line:nth-child(2) { left: 35%; animation-delay: 2s; }
.data-line:nth-child(3) { left: 55%; animation-delay: 4s; }
.data-line:nth-child(4) { left: 75%; animation-delay: 6s; }
.data-line:nth-child(5) { left: 85%; animation-delay: 1s; }

@keyframes dataFlow {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* 3D Tilt Card Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    will-change: transform;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) scale(1.02);
}

/* Parallax Hero Section */
.hero-parallax {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-parallax-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2d2d2d 100%);
    z-index: 0;
    will-change: transform;
}

.hero-parallax-content {
    position: relative;
    z-index: 10;
    will-change: transform;
}

/* Glowing Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: orbFloat 20s ease-in-out infinite;
    pointer-events: none;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    bottom: 20%;
    right: 15%;
    animation-delay: 5s;
}

.glow-orb-3 {
    width: 250px;
    height: 250px;
    background: var(--primary-color);
    top: 50%;
    right: 25%;
    animation-delay: 10s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

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

.reveal-fade-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

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

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

.reveal-fade-right.revealed {
    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.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delay Classes */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-card-light {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 16, 46, 0.1);
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(90deg, #C8102E, #ff4d6d, #C8102E);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

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

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.magnetic-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Infinite Scroll Ticker */
.ticker-wrapper {
    overflow: hidden;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    padding: 16px 0;
}

.ticker {
    display: flex;
    animation: scroll 30s linear infinite;
    will-change: transform;
}

.ticker-item {
    flex-shrink: 0;
    padding: 0 40px;
    color: var(--white);
    font-weight: 600;
    white-space: nowrap;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Grid Background Pattern */
.grid-bg {
    background-image:
        linear-gradient(rgba(200, 16, 46, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 16, 46, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    position: relative;
}

.grid-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(255, 255, 255, 0.8) 100%);
    pointer-events: none;
}

/* Neon Glow Effect */
.neon-text {
    color: var(--white);
    text-shadow:
        0 0 5px rgba(200, 16, 46, 0.9),
        0 0 10px rgba(200, 16, 46, 0.7),
        0 0 15px rgba(200, 16, 46, 0.5),
        0 0 20px rgba(200, 16, 46, 0.3);
    animation: neonFlicker 2s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(200, 16, 46, 0.9),
            0 0 10px rgba(200, 16, 46, 0.7),
            0 0 15px rgba(200, 16, 46, 0.5);
    }
    50% {
        text-shadow:
            0 0 8px rgba(200, 16, 46, 1),
            0 0 15px rgba(200, 16, 46, 0.9),
            0 0 25px rgba(200, 16, 46, 0.7);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .parallax-section {
        background-attachment: scroll;
    }

    .glow-orb {
        display: none;
    }

    .particles-container {
        display: none;
    }
}

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