/* Visual Effects and Backgrounds - CnC */
/* Rich visual enhancements with scroll-based animations */

/* Animated Background System */
.visual-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Place above body background but behind content */
    overflow: hidden;
    pointer-events: none;
}

/* Gradient Background with Animation */
.animated-gradient-bg {
    background: linear-gradient(-45deg, #0a5ad4, #1a8f5b, #0a5ad4, #1a8f5b);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite linear;
    pointer-events: none;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 2s; animation-duration: 25s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 6s; animation-duration: 22s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 8s; animation-duration: 19s; }
.particle:nth-child(6) { width: 7px; height: 7px; left: 60%; animation-delay: 10s; animation-duration: 24s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 12s; animation-duration: 17s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 14s; animation-duration: 21s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 16s; animation-duration: 23s; }
.particle:nth-child(10) { width: 6px; height: 6px; left: 95%; animation-delay: 18s; animation-duration: 26s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Geometric Shapes Background */
.geometric-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.05;
    animation: geometricFloat 30s infinite linear;
}

.shape:nth-child(1) {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 20px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    border-radius: 50%;
    top: 20%;
    right: 15%;
    animation-delay: 5s;
}

.shape:nth-child(3) {
    width: 120px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 30px;
    bottom: 20%;
    left: 20%;
    animation-delay: 10s;
}

.shape:nth-child(4) {
    width: 90px;
    height: 90px;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    top: 60%;
    right: 25%;
    animation-delay: 15s;
}

.shape:nth-child(5) {
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 15px;
    bottom: 40%;
    right: 10%;
    animation-delay: 20s;
}

@keyframes geometricFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.05;
    }
    25% {
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.05;
    }
    75% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0.05;
    }
}

/* Scroll-based Parallax Effects */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: transform;
}

.parallax-layer-1 {
    /* Background image will be set dynamically by BackgroundManager */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: brightness(0.7) saturate(1.08);
    transform: translateZ(0);
}

.parallax-layer-2 {
    background: radial-gradient(circle at 30% 70%, rgba(10, 90, 212, 0.08), transparent 55%);
    transform: translateZ(-1px);
}

.parallax-layer-3 {
    background: radial-gradient(circle at 70% 30%, rgba(26, 143, 91, 0.08), transparent 55%);
    transform: translateZ(-2px);
}

/* Enhanced Page Content with Visual Effects */
.page-content {
    position: relative;
    z-index: 1;
    /* Make page wrapper transparent so the global gradient/bg image shows */
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
}

/* Scroll-triggered Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Enhanced Hero Sections */
.hero-banner {
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 90, 212, 0.9), rgba(26, 143, 91, 0.9));
    z-index: 1;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    z-index: 2;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 3;
}

/* Enhanced Feature Cards */
.feature-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card::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.6s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow-lg);
    border-color: var(--accent);
}

/* Enhanced Product Items */
.product-item {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s ease;
}

.product-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 90, 212, 0.05), rgba(26, 143, 91, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-item:hover::after {
    opacity: 1;
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

/* Enhanced Contact CTA */
.contact-cta {
    position: relative;
    overflow: hidden;
}

.contact-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-content {
        margin: 10px;
        border-radius: 15px;
    }
    
    .parallax-layer {
        height: 100%;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .page-content {
        margin: 5px;
        border-radius: 10px;
    }
    
    .visual-background {
        display: none;
    }
}

/* Performance Optimizations */
.visual-background,
.parallax-layer,
.particle,
.shape {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .animated-gradient-bg,
    .particle,
    .shape,
    .contact-cta::before {
        animation: none;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

