/* ═══════════════════════════════════════════════════════════════
   SeEnergy — Energy Theme CSS
   Page-specific visual effects for electric, solar, automation
   ═══════════════════════════════════════════════════════════════ */

/* ─── Energy Canvas Container ─────────────────────────────── */
.energy-canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.energy-canvas {
    width: 100%;
    height: 100%;
    display: block;
}


/* ─── Solar Shimmer (Solar page headings) ─────────────────── */
@keyframes solarShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.solar-shimmer {
    background: linear-gradient(90deg,
            #13ec5b 0%,
            #ffc832 25%,
            #13ec5b 50%,
            #ffc832 75%,
            #13ec5b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: solarShimmer 5s linear infinite;
}

/* ─── Circuit Trace Border (Automation cards) ─────────────── */
@keyframes circuitTrace {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

.circuit-trace {
    position: relative;
}

.circuit-trace::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(50, 220, 200, 0.4) 20%,
            rgba(19, 236, 91, 0.6) 50%,
            rgba(50, 220, 200, 0.4) 80%,
            transparent 100%);
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: circuitTrace 3s linear infinite;
    pointer-events: none;
}

/* ─── Energy Flow Divider ─────────────────────────────────── */
@keyframes flowDivider {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.energy-flow-divider {
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(19, 236, 91, 0.05),
            rgba(19, 236, 91, 0.4),
            rgba(19, 236, 91, 0.05),
            transparent);
    background-size: 200% 100%;
    animation: flowDivider 4s linear infinite;
    max-width: 80%;
    margin: 0 auto;
}

/* ─── Spark Burst on Hover (CTAs) ─────────────────────────── */
@keyframes sparkBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.spark-cta {
    position: relative;
    overflow: hidden;
}

.spark-cta::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(19, 236, 91, 0.3);
    pointer-events: none;
    opacity: 0;
    left: var(--spark-x, 50%);
    top: var(--spark-y, 50%);
    transform: translate(-50%, -50%) scale(0);
}

.spark-cta:active::after {
    animation: sparkBurst 0.5s ease-out;
}

/* ─── Voltage Bar Animation ───────────────────────────────── */
@keyframes voltageBar {
    0% {
        width: 0%;
    }

    100% {
        width: var(--bar-width, 75%);
    }
}

.voltage-bar {
    animation: voltageBar 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.voltage-bar.revealed {
    animation: voltageBar 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ─── Typing cursor blink ─────────────────────────────────── */
@keyframes cursorBlink {

    0%,
    100% {
        border-color: transparent;
    }

    50% {
        border-color: rgba(19, 236, 91, 0.8);
    }
}

.typing-cursor {
    border-right: 2px solid rgba(19, 236, 91, 0.8);
    animation: cursorBlink 1s step-end infinite;
    padding-right: 4px;
}

/* ─── Glowing Border Sweep ────────────────────────────────── */
@keyframes borderSweep {
    0% {
        --angle: 0deg;
    }

    100% {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.glow-border-sweep {
    border: 1px solid transparent;
    background-image: linear-gradient(var(--bg, #0c1a11), var(--bg, #0c1a11)),
        conic-gradient(from var(--angle), transparent 70%, rgba(19, 236, 91, 0.5) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: borderSweep 4s linear infinite;
}

/* ─── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .electric-glow {
        animation: none;
    }

    .solar-shimmer {
        animation: none;
        -webkit-text-fill-color: #13ec5b;
    }

    .circuit-trace::before {
        animation: none;
    }

    .energy-flow-divider {
        animation: none;
    }

    .voltage-bar {
        animation: none;
        width: var(--bar-width, 75%);
    }

    .typing-cursor {
        animation: none;
    }

    .glow-border-sweep {
        animation: none;
    }
}