/* ============================================================
   HERO SLIDE 3 — 2 Geradores + ATS520 + Carga (medição de energia)
   ============================================================ */

/* ── Canvas (traces entre geradores → ATS → carga) ─────────── */
.s3-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    display: block;
}

/* ── Overlay: escurece à direita para realçar o texto ──────── */
.hero-slide-3 .hero-overlay {
    background: linear-gradient(
        to right,
        rgba(0, 20, 45, 0.30) 0%,
        rgba(0, 16, 36, 0.55) 38%,
        rgba(0, 10, 26, 0.90) 68%,
        rgba(0, 8, 22, 0.95) 100%
    );
}

/* ── Stage container ───────────────────────────────────────── */
.s3-stage {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.s3-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Geradores (desenhados no canvas; aqui só o rótulo) ────── */
.s3-gen {
    width: 1px;
    height: 1px;
}
.s3-gen-1 { left: 8.5%; top: 30%; }
.s3-gen-2 { left: 8.5%; top: 62%; }

.s3-gen-label {
    margin-top: 56px;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 168, 90, 0.80);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(231, 120, 23, 0.55);
    white-space: nowrap;
}
.s3-gen-label span { color: rgba(255, 255, 255, 0.55); }

/* ── ATS520 (foto real) ────────────────────────────────────── */
.s3-ats {
    left: 27.5%;
    top: 46%;
}
.s3-ats img {
    width: 252px;
    border-radius: 8px;
    filter: drop-shadow(0 0 18px rgba(0, 170, 255, 0.65))
            drop-shadow(0 0 42px rgba(0, 120, 220, 0.30))
            drop-shadow(0 8px 16px rgba(0, 0, 0, 0.65));
}
.s3-ats-label {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(110, 215, 255, 0.88);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 180, 255, 0.55);
    white-space: nowrap;
}
.s3-ats-label span { color: #e77817; }

/* ── Carga conectada (à direita do ATS) ────────────────────── */
.s3-load {
    left: 46.5%;
    top: 46%;
}
.s3-load-box {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(0, 40, 64, 0.55), rgba(0, 18, 34, 0.65));
    border: 1.5px solid rgba(120, 225, 190, 0.45);
    box-shadow: 0 0 0 0 rgba(60, 230, 180, 0.0),
                inset 0 0 18px rgba(60, 230, 180, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.s3-load-box i {
    font-size: 28px;
    color: rgba(120, 240, 200, 0.85);
    text-shadow: 0 0 12px rgba(60, 230, 180, 0.55);
}
.s3-load-bars {
    position: absolute;
    bottom: 10px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 16px;
}
.s3-load-bars span {
    width: 4px;
    border-radius: 2px;
    background: rgba(120, 240, 200, 0.80);
    box-shadow: 0 0 6px rgba(60, 230, 180, 0.6);
    height: 30%;
    animation: s3LoadBar 1.6s ease-in-out infinite;
}
.s3-load-bars span:nth-child(1) { animation-delay: 0s; }
.s3-load-bars span:nth-child(2) { animation-delay: 0.18s; }
.s3-load-bars span:nth-child(3) { animation-delay: 0.36s; }
.s3-load-bars span:nth-child(4) { animation-delay: 0.54s; }

@keyframes s3LoadBar {
    0%, 100% { height: 25%; }
    50%      { height: 90%; }
}

.s3-load-label {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 2.5px;
    color: rgba(120, 240, 200, 0.85);
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(60, 230, 180, 0.45);
    white-space: nowrap;
}
.s3-load-label span { color: rgba(255, 255, 255, 0.55); }

/* ── Painel de métricas (telemetria ao vivo) ───────────────── */
.s3-metrics {
    position: absolute;
    left: 9%;
    top: 80%;
    width: 42%;
    transform: translateY(-50%);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.9s ease, transform 0.9s ease;
    transition-delay: 1.5s;
}
.s3-metric {
    background: rgba(0, 20, 40, 0.45);
    border: 1px solid rgba(0, 170, 255, 0.22);
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.s3-metric-wide { grid-column: span 2; }
.s3-m-label {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(0, 200, 255, 0.65);
    margin-bottom: 2px;
}
.s3-m-val {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 180, 255, 0.45);
    white-space: nowrap;
}
.s3-m-val small {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-left: 2px;
}

/* ── Container acima do stage ──────────────────────────────── */
.hero-slide-3 .container { position: relative; z-index: 5; }

/* ── Estado ativo (acionado via JS na troca de slide) ──────── */
.hero-slide-3.s3-active .s3-gen-1,
.hero-slide-3.s3-active .s3-gen-2 { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hero-slide-3.s3-active .s3-gen-1 { transition-delay: 0.20s; }
.hero-slide-3.s3-active .s3-gen-2 { transition-delay: 0.45s; }
.hero-slide-3.s3-active .s3-ats   { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: 0.85s; }
.hero-slide-3.s3-active .s3-load  { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: 1.35s; }
.hero-slide-3.s3-active .s3-metrics { opacity: 1; transform: translateY(0); }

/* ── Oculta o diagrama em telas menores (mantém só texto) ──── */
@media (max-width: 991.98px) {
    .s3-canvas,
    .s3-stage { display: none; }
}
