/**
 * Visible Background Patterns
 * Clearly visible patterns for modern aesthetic
 */

/* ========== BASE PATTERN STYLES ========== */

body {
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.45;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 3px,
            rgba(218, 165, 32, 0.12) 3px,
            rgba(218, 165, 32, 0.12) 6px
        ),
        radial-gradient(ellipse 1800px 1200px at 20% 30%, rgba(218, 165, 32, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse 1600px 1000px at 80% 70%, rgba(218, 165, 32, 0.25) 0%, transparent 55%),
        url('../images/background-pattern.png');
    background-size: 60px 60px, 100% 100%, 100% 100%, 300px 300px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    background-repeat: repeat, no-repeat, no-repeat, repeat;
    filter: invert(1) brightness(0.65);
    animation: patternShift 60s ease-in-out infinite;
}

@keyframes patternShift {
    0%, 100% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0 0;
    }
    25% {
        background-position: 1% 0.5%, -0.5% -0.5%, -0.5% -0.5%, 30px 30px;
    }
    50% {
        background-position: 2% 1%, -1% -1%, -1% -1%, 60px 60px;
    }
    75% {
        background-position: 1% 0.5%, -0.5% -0.5%, -0.5% -0.5%, 30px 30px;
    }
}

/* ========== DARK SECTION PATTERNS ========== */

.hero,
.testimonials-section,
.work-section,
.services-section,
.feature-section {
    position: relative;
}

.hero::before,
.testimonials-section::before,
.work-section::before,
.services-section::before,
.feature-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(218, 165, 32, 0.1) 2px,
            rgba(218, 165, 32, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(218, 165, 32, 0.1) 2px,
            rgba(218, 165, 32, 0.1) 4px
        ),
        radial-gradient(ellipse 1200px 900px at 15% 25%, rgba(218, 165, 32, 0.35) 0%, transparent 65%),
        radial-gradient(ellipse 1300px 950px at 85% 75%, rgba(218, 165, 32, 0.3) 0%, transparent 65%),
        url('../images/background-pattern.png');
    background-size: 80px 80px, 80px 80px, 100% 100%, 100% 100%, 300px 300px;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
    background-repeat: repeat, repeat, no-repeat, no-repeat, repeat;
    filter: invert(1) brightness(0.55);
    animation: patternMove 80s ease-in-out infinite;
}

@keyframes patternMove {
    0%, 100% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0 0;
        opacity: 0.4;
    }
    25% {
        background-position: 1% 0.5%, 0.5% 0.5%, -0.5% -0.5%, -0.5% -0.5%, 40px 40px;
        opacity: 0.42;
    }
    50% {
        background-position: 2% 1%, 1% 1%, -1% -1%, -1% -1%, 80px 80px;
        opacity: 0.45;
    }
    75% {
        background-position: 1% 0.5%, 0.5% 0.5%, -0.5% -0.5%, -0.5% -0.5%, 40px 40px;
        opacity: 0.42;
    }
}

/* ========== LIGHT SECTION PATTERNS (for glass cards) ========== */

.glass-card,
.navbar,
.top-bar,
.hero-content-box,
.feature-large-card,
.stat-card,
.service-card,
.work-item,
.testimonial-card,
.cta-section,
.footer-container,
.section-header,
.rating-display {
    position: relative;
    overflow: hidden;
}

.glass-card::after,
.navbar::after,
.top-bar::after,
.hero-content-box::after,
.feature-large-card::after,
.stat-card::after,
.service-card::after,
.work-item::after,
.testimonial-card::after,
.cta-section::after,
.footer-container::after,
.section-header::after,
.rating-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
    background-image: url('../images/background-pattern.png');
    background-size: 220px 220px;
    background-position: 0 0;
    background-repeat: repeat;
    filter: invert(1) brightness(0.5);
    border-radius: inherit;
    animation: cardPatternFloat 70s ease-in-out infinite;
}

@keyframes cardPatternFloat {
    0%, 100% {
        background-position: 0 0;
    }
    50% {
        background-position: 110px 110px;
    }
}

/* ========== WAVY LINE PATTERN (More Subtle) ========== */

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    background-image: url('../images/background-pattern.png');
    background-size: 350px 350px;
    background-position: 0 0;
    background-repeat: repeat;
    filter: invert(1) brightness(0.6);
    animation: wavePattern 45s linear infinite;
}

@keyframes wavePattern {
    0% {
        background-position: 0 0;
    }
    50% {
        background-position: 175px 175px;
    }
    100% {
        background-position: 350px 350px;
    }
}

/* ========== CONCENTRIC ARC PATTERN ========== */

.hero::after,
.testimonials-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
    background-image: 
        radial-gradient(ellipse 900px 600px at 20% 30%, transparent 40%, rgba(218, 165, 32, 0.2) 45%, transparent 50%),
        radial-gradient(ellipse 750px 500px at 20% 30%, transparent 45%, rgba(218, 165, 32, 0.15) 50%, transparent 55%),
        radial-gradient(ellipse 600px 400px at 20% 30%, transparent 50%, rgba(218, 165, 32, 0.12) 55%, transparent 60%);
    background-size: 100% 100%;
    background-position: 0 0;
    animation: arcPulse 100s ease-in-out infinite;
}

@keyframes arcPulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    25% {
        opacity: 0.27;
        transform: scale(1.02);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.04);
    }
    75% {
        opacity: 0.27;
        transform: scale(1.02);
    }
}

/* ========== CONTAINER Z-INDEX FIX ========== */

/* Ensure all main sections are above background patterns */
.top-bar,
.navbar,
.hero,
.feature-section,
.services-section,
.work-section,
.testimonials-section,
.cta-section,
.footer {
    position: relative;
    z-index: 1;
}

/* Ensure all containers and content are above patterns */
.hero-container,
.testimonials-container,
.services-container,
.work-container,
.feature-container,
.hero-title,
.hero-content-box,
.section-title,
.section-description,
.service-card,
.work-item,
.testimonial-card,
.stat-card,
.feature-large-card {
    position: relative;
    z-index: 2;
}

/* Ensure card content is above card patterns */
.navbar > *,
.top-bar > *,
.hero-content-box > *,
.feature-large-card > *,
.stat-card > *,
.service-card > *,
.work-item > *,
.testimonial-card > *,
.cta-section > *,
.footer-container > * {
    position: relative;
    z-index: 1;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */

@media (max-width: 768px) {
    body::before {
        opacity: 0.35;
    }
    
    body::after {
        opacity: 0.25;
    }
    
    .hero::before,
    .testimonials-section::before,
    .work-section::before,
    .services-section::before,
    .feature-section::before {
        opacity: 0.3;
    }
    
    .glass-card::after,
    .navbar::after,
    .hero-content-box::after,
    .service-card::after,
    .testimonial-card::after {
        opacity: 0.2;
    }
}

/* ========== ADDITIONAL VISIBLE PATTERNS ========== */

/* Note: Diagonal line and grid patterns are now integrated into the main background-image declarations above */

/* ========== PERFORMANCE OPTIMIZATION ========== */

body::before,
body::after,
.hero::before,
.hero::after,
.testimonials-section::before,
.testimonials-section::after,
.glass-card::after,
.navbar::after,
.service-card::after,
.testimonial-card::after {
    will-change: background-position, opacity;
}
