/**
 * Network Mesh Background Enhancements
 * Additional CSS for the animated mesh network
 */

/* Ensure body has proper dark background */
body.app-shell {
    background: #020611;
    position: relative;
    overflow-x: hidden;
}

/* Canvas positioning and layering */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: all;
    background: radial-gradient(ellipse at top, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 17, 1) 100%);
}

/* Content must be above canvas */
.site-chrome,
.nav-panel,
.main-content,
.site-footer {
    position: relative;
    z-index: 10;
}

/* Subtle ambient background gradients behind mesh */
body.app-shell::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(124, 93, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
    animation: ambientPulse 8s ease-in-out infinite;
}

body.app-shell::after {
    content: '';
    position: fixed;
    bottom: -15%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
    animation: ambientPulse 10s ease-in-out infinite reverse;
}

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

/* Glass effect for cards over network mesh */
.glass-effect {
    background: rgba(10, 14, 27, 0.75) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Hero sections get extra depth */
.hero {
    position: relative;
    z-index: 10;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 100%;
    background: radial-gradient(ellipse at center top, rgba(124, 93, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* Cards get subtle glow on hover over mesh */
.feature-card:hover,
.service-card:hover,
.product-card:hover {
    box-shadow:
        0 8px 32px rgba(124, 93, 255, 0.15),
        0 0 0 1px rgba(124, 93, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Section backgrounds */
.section {
    position: relative;
    z-index: 10;
}

.section-surface {
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    z-index: 10;
}

/* Ensure text is readable over mesh */
.main-content {
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    body.app-shell::before,
    body.app-shell::after {
        display: none;
    }

    #network-canvas {
        opacity: 0.7;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    #network-canvas {
        display: none;
    }

    body.app-shell::before,
    body.app-shell::after {
        animation: none;
    }

    .feature-card:hover,
    .service-card:hover,
    .product-card:hover {
        transform: none;
    }
}

/* Dark mode text adjustments */
body.app-shell {
    color: #f4f7ff;
}

body.app-shell .text-muted {
    color: #9ea7c4;
}

/* Ensure proper contrast for links */
body.app-shell a {
    color: #a78bfa;
}

body.app-shell a:hover {
    color: #c4b5fd;
}

/* Loading state for canvas */
#network-canvas.loading {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

#network-canvas.loaded {
    opacity: 1;
}
