/* =========================================================
   FI Cyber Hero Background Plugin
   Divi 5-safe animated cybersecurity background
   ========================================================= */


/* =========================================================
   Main shortcode wrapper
   ========================================================= */

.fi-cyber-hero-bg-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: var(--fi-cyber-hero-height, 100%);
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 42%, rgba(40, 190, 210, 0.34), transparent 28%),
        linear-gradient(135deg, #020817 0%, #061a39 46%, #020817 100%);
    isolation: isolate;
    pointer-events: none;
}

.fi-cyber-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.fi-cyber-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    background:
        linear-gradient(
            90deg,
            rgba(2, 8, 23, 0.82),
            rgba(5, 24, 55, 0.42),
            rgba(2, 8, 23, 0.68)
        ),
        radial-gradient(circle at center, transparent 0%, rgba(2, 8, 23, 0.24) 72%);
    pointer-events: none;
}


/* =========================================================
   Divi 5 background row / column / module positioning
   ========================================================= */

.fi-cyber-hero-section {
    position: relative !important;
    overflow: hidden !important;
    min-height: 520px !important;
    background: #020817 !important;
}

/* Background Row */
.fi-cyber-hero-section .fi-cyber-bg-row {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Background Column */
.fi-cyber-hero-section .fi-cyber-bg-column {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Background Code Module */
.fi-cyber-hero-section .fi-cyber-bg-module {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Any wrappers Divi creates around the shortcode */
.fi-cyber-hero-section .fi-cyber-bg-module > *,
.fi-cyber-hero-section .fi-cyber-hero-bg-wrap {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Foreground hero content row */
.fi-cyber-hero-section .fi-cyber-hero-content-row {
    position: relative !important;
    z-index: 5 !important;
}

/* Keep non-background rows/modules above the animation */
.fi-cyber-hero-section > *:not(.fi-cyber-bg-row) {
    position: relative !important;
    z-index: 5 !important;
}

/* Optional content class for specific modules/rows */
.fi-cyber-hero-content {
    position: relative !important;
    z-index: 5 !important;
}

/* Keep section dividers above the background */
.fi-cyber-hero-section [class*="divider"] {
    position: absolute !important;
    z-index: 6 !important;
}

/* Do not let the animated layer create horizontal scroll */
body {
    overflow-x: hidden;
}


/* =========================================================
   Animated perspective grid
   ========================================================= */

.fi-cyber-grid {
    position: absolute;
    left: -25%;
    right: -25%;
    bottom: -34%;
    height: 72%;
    background-image:
        linear-gradient(rgba(93, 223, 244, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 223, 244, 0.22) 1px, transparent 1px);
    background-size: 54px 54px;
    transform: perspective(720px) rotateX(62deg);
    transform-origin: top center;
    animation: fi-cyber-grid-drift 6s linear infinite;
    opacity: 0.9;
}


/* =========================================================
   Particles
   ========================================================= */

.fi-cyber-particles {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(69, 224, 245, 1) 0 1.4px, transparent 2px),
        radial-gradient(circle, rgba(126, 211, 33, 0.85) 0 1.1px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.65) 0 0.9px, transparent 1.6px);
    background-size: 120px 90px, 180px 150px, 260px 220px;
    background-position: 0 0, 60px 40px, 120px 80px;
    opacity: 0.72;
    animation: fi-cyber-particles-drift 8s linear infinite;
}


/* =========================================================
   Glowing orbs
   ========================================================= */

.fi-cyber-orb {
    position: absolute;
    display: block;
    border-radius: 999px;
    filter: blur(45px);
    opacity: 0.75;
    mix-blend-mode: screen;
    will-change: transform;
}

.fi-cyber-orb-one {
    top: 14%;
    right: 10%;
    width: 390px;
    height: 390px;
    background: rgba(40, 205, 220, 0.78);
    animation: fi-cyber-orb-one 5s ease-in-out infinite;
}

.fi-cyber-orb-two {
    bottom: 18%;
    left: 9%;
    width: 280px;
    height: 280px;
    background: rgba(31, 95, 174, 0.86);
    animation: fi-cyber-orb-two 6s ease-in-out infinite;
}

.fi-cyber-orb-three {
    bottom: 14%;
    right: 20%;
    width: 220px;
    height: 220px;
    background: rgba(126, 211, 33, 0.72);
    animation: fi-cyber-orb-three 7s ease-in-out infinite;
}


/* =========================================================
   Wave lines
   ========================================================= */

.fi-cyber-wave {
    position: absolute;
    left: -25%;
    width: 150%;
    height: 220px;
    border-radius: 50%;
    border-top: 1px solid rgba(61, 220, 242, 0.58);
    border-bottom: 1px solid rgba(61, 220, 242, 0.08);
    box-shadow: 0 0 28px rgba(61, 220, 242, 0.14);
    will-change: transform, opacity;
}

.fi-cyber-wave-one {
    top: 18%;
    transform: rotate(-9deg);
    animation: fi-cyber-wave-slide-one 6s ease-in-out infinite;
}

.fi-cyber-wave-two {
    top: 32%;
    transform: rotate(-4deg);
    animation: fi-cyber-wave-slide-two 7s ease-in-out infinite reverse;
}

.fi-cyber-wave-three {
    bottom: 18%;
    transform: rotate(-7deg);
    animation: fi-cyber-wave-slide-three 8s ease-in-out infinite;
}


/* =========================================================
   Cybersecurity hex grid
   ========================================================= */

.fi-cyber-hex-grid {
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image:
        linear-gradient(30deg, rgba(95, 230, 245, 0.22) 12%, transparent 12.5%, transparent 87%, rgba(95, 230, 245, 0.22) 87.5%, rgba(95, 230, 245, 0.22)),
        linear-gradient(150deg, rgba(95, 230, 245, 0.22) 12%, transparent 12.5%, transparent 87%, rgba(95, 230, 245, 0.22) 87.5%, rgba(95, 230, 245, 0.22)),
        linear-gradient(60deg, rgba(95, 230, 245, 0.12) 25%, transparent 25.5%, transparent 75%, rgba(95, 230, 245, 0.12) 75%, rgba(95, 230, 245, 0.12));
    background-size: 84px 147px;
    animation: fi-cyber-hex-drift 20s linear infinite;
}


/* =========================================================
   Circuit-board line texture
   ========================================================= */

.fi-cyber-circuit-lines {
    position: absolute;
    inset: 0;
    opacity: 0.24;
    background:
        linear-gradient(90deg, transparent 0 10%, rgba(95, 230, 245, 0.28) 10% 10.2%, transparent 10.2% 100%),
        linear-gradient(0deg, transparent 0 22%, rgba(95, 230, 245, 0.18) 22% 22.2%, transparent 22.2% 100%),
        linear-gradient(90deg, transparent 0 62%, rgba(126, 211, 33, 0.2) 62% 62.15%, transparent 62.15% 100%),
        linear-gradient(0deg, transparent 0 72%, rgba(126, 211, 33, 0.16) 72% 72.2%, transparent 72.2% 100%);
    background-size: 360px 220px;
    animation: fi-cyber-circuit-shift 16s linear infinite;
}


/* =========================================================
   Scanning beam
   ========================================================= */

.fi-cyber-scanline {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 120px;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(75, 230, 245, 0.08),
        rgba(75, 230, 245, 0.22),
        rgba(126, 211, 33, 0.08),
        transparent
    );
    transform: rotate(-8deg);
    filter: blur(4px);
    animation: fi-cyber-scanline 7s ease-in-out infinite;
}


/* =========================================================
   Floating binary / security text
   ========================================================= */

.fi-cyber-binary {
    position: absolute;
    z-index: 2;
    color: rgba(130, 245, 255, 0.36);
    font-family: "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(70, 230, 245, 0.28);
    pointer-events: none;
}

.fi-cyber-binary-one {
    top: 14%;
    left: -20%;
    animation: fi-cyber-binary-drift-right 18s linear infinite;
}

.fi-cyber-binary-two {
    top: 48%;
    right: -25%;
    color: rgba(126, 211, 33, 0.34);
    animation: fi-cyber-binary-drift-left 22s linear infinite;
}

.fi-cyber-binary-three {
    bottom: 18%;
    left: -30%;
    animation: fi-cyber-binary-drift-right 26s linear infinite;
}


/* =========================================================
   Glowing network nodes
   ========================================================= */

.fi-cyber-node {
    position: absolute;
    z-index: 2;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #7ed321;
    box-shadow:
        0 0 12px rgba(126, 211, 33, 0.9),
        0 0 24px rgba(126, 211, 33, 0.45);
    animation: fi-cyber-node-pulse 2.8s ease-in-out infinite;
}

.fi-cyber-node::before,
.fi-cyber-node::after {
    content: "";
    position: absolute;
    top: 4px;
    height: 1px;
    width: 120px;
    background: linear-gradient(90deg, rgba(126, 211, 33, 0.55), transparent);
    transform-origin: left center;
}

.fi-cyber-node-one {
    top: 24%;
    left: 18%;
}

.fi-cyber-node-one::before {
    transform: rotate(18deg);
}

.fi-cyber-node-one::after {
    transform: rotate(-32deg);
}

.fi-cyber-node-two {
    top: 32%;
    right: 20%;
    background: #49e6f5;
    box-shadow:
        0 0 12px rgba(73, 230, 245, 0.9),
        0 0 24px rgba(73, 230, 245, 0.45);
}

.fi-cyber-node-two::before {
    background: linear-gradient(90deg, rgba(73, 230, 245, 0.55), transparent);
    transform: rotate(152deg);
}

.fi-cyber-node-two::after {
    background: linear-gradient(90deg, rgba(73, 230, 245, 0.55), transparent);
    transform: rotate(205deg);
}

.fi-cyber-node-three {
    bottom: 28%;
    left: 28%;
}

.fi-cyber-node-three::before {
    transform: rotate(-8deg);
}

.fi-cyber-node-three::after {
    transform: rotate(42deg);
}

.fi-cyber-node-four {
    bottom: 24%;
    right: 30%;
    background: #49e6f5;
    box-shadow:
        0 0 12px rgba(73, 230, 245, 0.9),
        0 0 24px rgba(73, 230, 245, 0.45);
}

.fi-cyber-node-four::before {
    background: linear-gradient(90deg, rgba(73, 230, 245, 0.55), transparent);
    transform: rotate(190deg);
}

.fi-cyber-node-four::after {
    background: linear-gradient(90deg, rgba(73, 230, 245, 0.55), transparent);
    transform: rotate(238deg);
}


/* =========================================================
   Keyframes
   ========================================================= */

@keyframes fi-cyber-grid-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 54px;
    }
}

@keyframes fi-cyber-particles-drift {
    from {
        background-position: 0 0, 60px 40px, 120px 80px;
    }

    to {
        background-position: 240px 180px, 420px 340px, 640px 520px;
    }
}

@keyframes fi-cyber-orb-one {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-120px, 60px, 0) scale(1.18);
    }
}

@keyframes fi-cyber-orb-two {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(120px, -70px, 0) scale(1.2);
    }
}

@keyframes fi-cyber-orb-three {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(70px, -90px, 0) scale(0.9);
    }
}

@keyframes fi-cyber-wave-slide-one {
    0%,
    100% {
        transform: translateX(-4%) rotate(-9deg);
        opacity: 0.45;
    }

    50% {
        transform: translateX(6%) rotate(-6deg);
        opacity: 0.9;
    }
}

@keyframes fi-cyber-wave-slide-two {
    0%,
    100% {
        transform: translateX(4%) rotate(-4deg);
        opacity: 0.35;
    }

    50% {
        transform: translateX(-7%) rotate(-7deg);
        opacity: 0.8;
    }
}

@keyframes fi-cyber-wave-slide-three {
    0%,
    100% {
        transform: translateX(-3%) rotate(-7deg);
        opacity: 0.28;
    }

    50% {
        transform: translateX(5%) rotate(-4deg);
        opacity: 0.7;
    }
}

@keyframes fi-cyber-hex-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 84px 147px;
    }
}

@keyframes fi-cyber-circuit-shift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 360px 220px;
    }
}

@keyframes fi-cyber-scanline {
    0% {
        transform: translateY(-220px) rotate(-8deg);
        opacity: 0;
    }

    18% {
        opacity: 0.85;
    }

    55% {
        opacity: 0.45;
    }

    100% {
        transform: translateY(900px) rotate(-8deg);
        opacity: 0;
    }
}

@keyframes fi-cyber-binary-drift-right {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    12%,
    88% {
        opacity: 1;
    }

    100% {
        transform: translateX(160vw);
        opacity: 0;
    }
}

@keyframes fi-cyber-binary-drift-left {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    12%,
    88% {
        opacity: 1;
    }

    100% {
        transform: translateX(-160vw);
        opacity: 0;
    }
}

@keyframes fi-cyber-node-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.6);
        opacity: 1;
    }
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 767px) {
    .fi-cyber-hero-section {
        min-height: 560px !important;
    }

    .fi-cyber-hero-section .fi-cyber-bg-row,
    .fi-cyber-hero-section .fi-cyber-bg-column,
    .fi-cyber-hero-section .fi-cyber-bg-module,
    .fi-cyber-hero-section .fi-cyber-hero-bg-wrap {
        height: 100% !important;
        min-height: 0 !important;
    }

    .fi-cyber-binary {
        font-size: 10px;
    }

    .fi-cyber-orb-one,
    .fi-cyber-orb-two {
        width: 240px;
        height: 240px;
    }

    .fi-cyber-node::before,
    .fi-cyber-node::after {
        width: 70px;
    }
}


/* =========================================================
   Accessibility
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .fi-cyber-grid,
    .fi-cyber-particles,
    .fi-cyber-orb,
    .fi-cyber-wave,
    .fi-cyber-hex-grid,
    .fi-cyber-circuit-lines,
    .fi-cyber-scanline,
    .fi-cyber-binary,
    .fi-cyber-node {
        animation: none !important;
    }
}