/* ============================================================
   CNL Global Soft Tech — Premium Background Enhancement
   Version: 3.0 | Theme: Deep Tech / SaaS / Navy-Cyan
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. BODY — Layered gradient + animated mesh + subtle grid
   ──────────────────────────────────────────────────────────── */
body {
    background-color: #020617 !important;
    /* Multi-stop deep tech gradient underneath canvas */
    background-image: none !important;
    background-attachment: fixed !important;
}

/* Light mode override — keep it clean */
body.light-mode {
    background-color: #f0f4f8 !important;
    background-image:
        linear-gradient(rgba(0, 61, 130, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 61, 130, 0.04) 1px, transparent 1px),
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(0, 156, 166, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 100% 0%, rgba(0, 61, 130, 0.04) 0%, transparent 55%),
        linear-gradient(160deg, #e8f0fe 0%, #f0f4f8 50%, #edf2f7 100%) !important;
    background-size: 60px 60px, 60px 60px, 100% 100%, 100% 100%, 100% 100% !important;
    background-attachment: fixed !important;
}

/* ────────────────────────────────────────────────────────────
   2. GLOBAL ANIMATED BACKGROUND CANVAS
   Floating blobs that drift across entire page — subtle, not distracting
   ──────────────────────────────────────────────────────────── */
body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 0;
    will-change: transform;
}

/* Large deep-blue orb — drifts slowly from bottom-left */
body::before {
    width: 900px;
    height: 900px;
    bottom: -300px;
    left: -200px;
    background: radial-gradient(circle, rgba(0, 61, 130, 0.18) 0%, rgba(0, 156, 166, 0.06) 45%, transparent 70%);
    filter: blur(80px);
    animation: orb-drift-a 22s ease-in-out infinite alternate;
}

/* Smaller cyan accent orb — top-right area */
body::after {
    width: 600px;
    height: 600px;
    top: -100px;
    right: -150px;
    background: radial-gradient(circle, rgba(0, 156, 166, 0.14) 0%, rgba(0, 229, 255, 0.06) 50%, transparent 70%);
    filter: blur(60px);
    animation: orb-drift-b 18s ease-in-out infinite alternate;
}

@keyframes orb-drift-a {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(80px, -60px) scale(1.08); }
    66%  { transform: translate(-40px, 100px) scale(0.96); }
    100% { transform: translate(60px, 40px) scale(1.04); }
}

@keyframes orb-drift-b {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-70px, 50px) scale(1.1); }
    66%  { transform: translate(50px, -80px) scale(0.94); }
    100% { transform: translate(-30px, 30px) scale(1.06); }
}

/* ────────────────────────────────────────────────────────────
   3. HERO SECTION — Cinematic depth layers
   ──────────────────────────────────────────────────────────── */
.hero {
    background: transparent !important;
    position: relative;
}

/* Animated glowing arc — upper-left sweep */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -5%;
    width: 70%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(0, 61, 130, 0.28) 0%, rgba(0, 156, 166, 0.08) 40%, transparent 65%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
    animation: hero-glow-pulse 8s ease-in-out infinite alternate;
}

/* Diagonal tech sweep line — right side */
.hero::after {
    content: '';
    position: absolute;
    top: 15%;
    right: -10%;
    width: 55%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(0, 156, 166, 0.18) 0%, rgba(0, 229, 255, 0.05) 45%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    animation: hero-glow-pulse 10s ease-in-out 2s infinite alternate-reverse;
}

@keyframes hero-glow-pulse {
    0%   { opacity: 0.7; transform: scale(1) rotate(0deg); }
    50%  { opacity: 1;   transform: scale(1.06) rotate(1deg); }
    100% { opacity: 0.8; transform: scale(0.97) rotate(-1deg); }
}

/* ────────────────────────────────────────────────────────────
   4. DECORATIVE TECH-GRID LAYER — fixed, full-page SVG overlay
   Diagonal dots / circuit pattern — very subtle
   ──────────────────────────────────────────────────────────── */
.tech-bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image:
        /* Diagonal fine dots */
        radial-gradient(circle, rgba(0, 229, 255, 0.18) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.light-mode .tech-bg-layer {
    opacity: 0.12;
}

/* ────────────────────────────────────────────────────────────
   5. SECTION SEPARATORS — glow dividers between sections
   ──────────────────────────────────────────────────────────── */
.section {
    position: relative;
    isolation: isolate;
}

/* Subtle teal glow at top of alternate sections */
.section:nth-child(even)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.2) 30%,
        rgba(0, 156, 166, 0.35) 50%,
        rgba(0, 229, 255, 0.2) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Soft ambient glow behind alternate sections */
.section:nth-child(even)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0, 61, 130, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ────────────────────────────────────────────────────────────
   6. HERO CONTENT — Make sure it sits above the bg layers
   ──────────────────────────────────────────────────────────── */
.hero-content,
.hero .container {
    position: relative;
    z-index: 10;
}

/* Ambient glow wrapper must stay behind all content */
.ambient-glow-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Canvas always fills full screen */
#techBackgroundCanvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    display: block !important;
}

/* All page content must sit above the canvas */
nav, header, main, section, footer,
.navbar, .hero, .section, .footer-advanced {
    position: relative;
    z-index: 1;
}

/* But hero container needs to be above everything */
.hero .container,
.hero-content {
    position: relative;
    z-index: 10 !important;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
}

.glow-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 61, 130, 0.5) 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation: orb-drift-a 20s ease-in-out infinite alternate;
}

.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 156, 166, 0.4) 0%, transparent 70%);
    top: 30%;
    right: -100px;
    animation: orb-drift-b 16s ease-in-out infinite alternate;
}

.glow-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: 40%;
    animation: orb-drift-a 24s ease-in-out 3s infinite alternate-reverse;
}

/* ────────────────────────────────────────────────────────────
   7. SECTION BG ACCENTS — localised glow spots per section
   ──────────────────────────────────────────────────────────── */

/* Services section — warm blue accent */
#services::before,
.services-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 61, 130, 0.1) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: -1;
}

/* About / CTA section — teal accent */
#about::after,
.about-section::after,
.cta-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 156, 166, 0.08) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: -1;
}

/* Portfolio section */
#portfolio::before,
.portfolio-section::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -100px;
    width: 400px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(0, 229, 255, 0.05) 0%, transparent 65%);
    filter: blur(50px);
    pointer-events: none;
    z-index: -1;
}

/* Contact section */
.contact-section {
    background: rgba(10, 20, 40, 0.55) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 229, 255, 0.08) !important;
    box-shadow:
        0 0 60px rgba(0, 61, 130, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* ────────────────────────────────────────────────────────────
   8. FOOTER — Deeper gradient with subtle pattern
   ──────────────────────────────────────────────────────────── */
.footer-advanced {
    background:
        linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px),
        linear-gradient(180deg, #010c1f 0%, #020617 60%, #00080f 100%) !important;
    background-size: 40px 40px, 40px 40px, 100% 100% !important;
    border-top: 1px solid rgba(0, 229, 255, 0.08) !important;
    position: relative;
}

.footer-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 229, 255, 0.3) 30%,
        rgba(0, 156, 166, 0.4) 50%,
        rgba(0, 229, 255, 0.3) 70%,
        transparent);
    pointer-events: none;
}

/* ────────────────────────────────────────────────────────────
   9. NAVBAR — Enhanced glass effect on scroll
   ──────────────────────────────────────────────────────────── */
.navbar {
    background: rgba(2, 6, 23, 0.72) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(0, 229, 255, 0.06) !important;
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.3) !important;
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.92) !important;
    border-bottom-color: rgba(0, 229, 255, 0.1) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}

/* ────────────────────────────────────────────────────────────
   10. CARD SURFACE REFINEMENT — premium glass cards
   ──────────────────────────────────────────────────────────── */
.service-card {
    background: linear-gradient(135deg,
        rgba(15, 30, 60, 0.75) 0%,
        rgba(10, 20, 45, 0.65) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.07) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.service-card:hover {
    background: linear-gradient(135deg,
        rgba(0, 61, 130, 0.25) 0%,
        rgba(0, 156, 166, 0.12) 100%) !important;
    border-color: rgba(0, 229, 255, 0.2) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 229, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* ────────────────────────────────────────────────────────────
   11. HERO STATS STRIP — glassmorphism bar
   ──────────────────────────────────────────────────────────── */
.hero-stats {
    background: rgba(5, 15, 35, 0.5);
    border: 1px solid rgba(0, 229, 255, 0.07);
    border-radius: 16px;
    padding: 2rem 3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.hero-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.25), transparent);
}

/* ────────────────────────────────────────────────────────────
   12. HERO VISUAL WRAPPER — premium floating card
   ──────────────────────────────────────────────────────────── */
.hero-visual-image-wrapper {
    background: linear-gradient(135deg,
        rgba(0, 30, 70, 0.6) 0%,
        rgba(0, 15, 40, 0.5) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.12) !important;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.hero-visual-image-wrapper:hover {
    border-color: rgba(0, 229, 255, 0.28) !important;
    box-shadow:
        0 35px 80px rgba(0, 0, 0, 0.55),
        0 0 50px rgba(0, 229, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

/* ────────────────────────────────────────────────────────────
   13. SERVICE DETAIL HERO — richer gradient
   ──────────────────────────────────────────────────────────── */
.service-detail-hero {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 61, 130, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(0, 156, 166, 0.1) 0%, transparent 60%) !important;
    border-bottom: 1px solid rgba(0, 229, 255, 0.06) !important;
}

/* ────────────────────────────────────────────────────────────
   14. FLOATING PARTICLES ANIMATION — soft dots on hero
   ──────────────────────────────────────────────────────────── */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    z-index: 15; /* Floating particles drift dynamically in front of hero visual for cinematic visual integration! */
}

.particle-1 {
    width: 3px; height: 3px;
    background: rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.8);
    top: 20%; left: 15%;
    animation: float-particle 12s ease-in-out infinite;
}
.particle-2 {
    width: 2px; height: 2px;
    background: rgba(0, 156, 166, 0.7);
    box-shadow: 0 0 4px rgba(0, 156, 166, 0.9);
    top: 40%; left: 80%;
    animation: float-particle 16s ease-in-out 2s infinite reverse;
}
.particle-3 {
    width: 4px; height: 4px;
    background: rgba(0, 61, 130, 0.8);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
    top: 70%; left: 25%;
    animation: float-particle 14s ease-in-out 1s infinite;
}
.particle-4 {
    width: 2px; height: 2px;
    background: rgba(0, 229, 255, 0.5);
    top: 60%; left: 65%;
    animation: float-particle 18s ease-in-out 3s infinite reverse;
}
.particle-5 {
    width: 3px; height: 3px;
    background: rgba(0, 156, 166, 0.6);
    box-shadow: 0 0 6px rgba(0, 156, 166, 0.7);
    top: 85%; left: 50%;
    animation: float-particle 20s ease-in-out 4s infinite;
}

@keyframes float-particle {
    0%   { transform: translate(0, 0); opacity: 0.4; }
    25%  { transform: translate(20px, -30px); opacity: 0.8; }
    50%  { transform: translate(-10px, -60px); opacity: 0.5; }
    75%  { transform: translate(30px, -40px); opacity: 0.9; }
    100% { transform: translate(0, 0); opacity: 0.4; }
}

/* ────────────────────────────────────────────────────────────
   15. WAVE DIVIDER — decorative SVG wave between hero and sections
   ──────────────────────────────────────────────────────────── */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
    pointer-events: none;
}

.wave-divider svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider .wave-fill {
    fill: #020617;
    opacity: 0.6;
}

/* ────────────────────────────────────────────────────────────
   16. LIGHT BARS — decorative horizontal accent lines
   ──────────────────────────────────────────────────────────── */
.section-glow-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.15) 25%,
        rgba(0, 156, 166, 0.25) 50%,
        rgba(0, 229, 255, 0.15) 75%,
        transparent 100%);
    pointer-events: none;
}

/* ────────────────────────────────────────────────────────────
   17. SIDEBAR CARDS — richer glass on service detail page
   ──────────────────────────────────────────────────────────── */
.sidebar-card {
    background: linear-gradient(135deg,
        rgba(5, 18, 45, 0.8) 0%,
        rgba(0, 25, 60, 0.7) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.08) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* ────────────────────────────────────────────────────────────
   18. AUTH CARD — premium glass login page
   ──────────────────────────────────────────────────────────── */
.auth-card {
    background: linear-gradient(135deg,
        rgba(5, 18, 45, 0.88) 0%,
        rgba(0, 20, 55, 0.82) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.1) !important;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(0, 61, 130, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* ────────────────────────────────────────────────────────────
   19. MODAL CONTENT — darker glass with glow
   ──────────────────────────────────────────────────────────── */
.modal-content,
.service-modal-content {
    background: linear-gradient(135deg,
        rgba(5, 15, 38, 0.96) 0%,
        rgba(2, 10, 28, 0.94) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.1) !important;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(0, 61, 130, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* ────────────────────────────────────────────────────────────
   20. RESPONSIVE — reduce fixed bg on mobile for perf
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        background-attachment: scroll !important;
    }

    body::before {
        width: 500px;
        height: 500px;
        filter: blur(60px);
    }

    body::after {
        width: 350px;
        height: 350px;
        filter: blur(50px);
    }

    .hero::before,
    .hero::after {
        filter: blur(50px);
    }

    .tech-bg-layer {
        opacity: 0.2;
    }
}

@media (max-width: 480px) {
    body::before,
    body::after {
        display: none;
    }

    .hero::before {
        width: 100%;
        height: 60%;
        top: 0;
        left: 0;
        filter: blur(40px);
    }

    .hero::after {
        display: none;
    }
}

/* ────────────────────────────────────────────────────────────
   21. NAVBAR SCROLLED STATE — JS will add class "scrolled"
   ──────────────────────────────────────────────────────────── */
.navbar.scrolled {
    background: rgba(2, 6, 23, 0.95) !important;
    box-shadow: 0 2px 40px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(0, 229, 255, 0.08) !important;
}

/* ────────────────────────────────────────────────────────────
   22. CONTACT SECTION — floating glass card refinement
   ──────────────────────────────────────────────────────────── */
.contact-item {
    background: linear-gradient(135deg,
        rgba(5, 20, 50, 0.7) 0%,
        rgba(0, 15, 40, 0.6) 100%) !important;
    border: 1px solid rgba(0, 229, 255, 0.07) !important;
    backdrop-filter: blur(12px) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-item:hover {
    background: linear-gradient(135deg,
        rgba(0, 61, 130, 0.2) 0%,
        rgba(0, 156, 166, 0.1) 100%) !important;
    border-color: rgba(0, 229, 255, 0.22) !important;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08) !important;
    transform: translateY(-4px) !important;
}

/* ────────────────────────────────────────────────────────────
   23. SPECIAL OFFER CARD — more vivid pulsing glow
   ──────────────────────────────────────────────────────────── */
.special-offer-card {
    background: linear-gradient(135deg,
        rgba(230, 100, 101, 0.08) 0%,
        rgba(145, 100, 229, 0.06) 100%) !important;
}

/* ────────────────────────────────────────────────────────────
   24. SECTION BADGE — enhanced glow
   ──────────────────────────────────────────────────────────── */
.section-badge {
    box-shadow: 0 0 20px rgba(0, 156, 166, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ────────────────────────────────────────────────────────────
   25. SCROLLBAR — matching dark theme
   ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #010c1f;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #003d82, #009ca6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #009ca6, #00e5ff);
}
