/* =====================================================================
   GIDEON BUSINESS — Hero: Núcleo de orquestación de agentes
   Reemplaza el mock de WhatsApp por un hub central con 7 agentes
   conectados (comunicación interna) y handoffs animados.
   Estética consistente: negro + azul #1B4EF5 / #5997ff + Grotesk/Mono.
   ===================================================================== */

.hero-hub {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 8px;
}

.hub-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* ----- Anillo guía exterior ----- */
.hub-ring {
    fill: none;
    stroke: rgba(89, 151, 255, 0.14);
    stroke-width: 1;
    stroke-dasharray: 2 8;
}

/* ----- Líneas de conexión (flujo de datos animado) ----- */
.hub-link {
    stroke: rgba(89, 151, 255, 0.4);
    stroke-width: 1.4;
    stroke-dasharray: 3 10;
    animation: hub-flow 2.2s linear infinite;
}
.hub-link.hub-link-ring {
    stroke: rgba(89, 151, 255, 0.18);
    animation-duration: 3.6s;
}
@keyframes hub-flow {
    to {
        stroke-dashoffset: -26;
    }
}

/* ----- Centro (GIDEON CORE) ----- */
.hub-center-pulse {
    fill: none;
    stroke: rgba(89, 151, 255, 0.5);
    stroke-width: 1.6;
    transform-box: fill-box;
    transform-origin: center;
    animation: hub-ping 2.8s ease-out infinite;
}
.hub-center {
    fill: url(#hubCoreGrad);
    stroke: rgba(137, 180, 255, 0.45);
    stroke-width: 1;
}
.hub-core-a,
.hub-core-b {
    font-family: "Mono", monospace;
    font-size: 15px;
    letter-spacing: 0.16em;
    fill: #f4f7f5;
    font-weight: 500;
    pointer-events: none;
}
.hub-core-b {
    fill: #5997ff;
}
@keyframes hub-ping {
    0% {
        transform: scale(0.72);
        opacity: 0.85;
    }
    70%,
    100% {
        transform: scale(1.28);
        opacity: 0;
    }
}

/* ----- Nodos de agente ----- */
.hub-node .hub-halo {
    fill: rgba(27, 78, 245, 0.18);
    stroke: rgba(89, 151, 255, 0.38);
    stroke-width: 1;
}
.hub-node .hub-dot {
    fill: #5997ff;
    filter: drop-shadow(0 0 6px rgba(89, 151, 255, 0.95));
}
.hub-node .hub-ping {
    fill: none;
    stroke: rgba(89, 151, 255, 0.55);
    stroke-width: 1.2;
    transform-box: fill-box;
    transform-origin: center;
    animation: hub-ping 2.8s ease-out infinite;
}
.hub-label {
    font-family: "Mono", monospace;
    font-size: 9.5px;
    letter-spacing: 0.13em;
    fill: rgba(244, 247, 245, 0.85);
    /* contorno oscuro para que la etiqueta lea sobre las líneas */
    paint-order: stroke;
    stroke: rgba(10, 10, 12, 0.92);
    stroke-width: 3px;
    stroke-linejoin: round;
    pointer-events: none;
}

/* ----- Leyenda bajo el hub ----- */
.hub-caption {
    margin: 16px 0 0;
    text-align: center;
    font-family: "Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: rgba(244, 247, 245, 0.55);
}
.hub-caption .hub-caption-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6bc044;
    margin-right: 8px;
    vertical-align: middle;
    animation: hub-blink 1.6s ease-in-out infinite;
}
@keyframes hub-blink {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}

/* ----- Responsive ----- */
@media (max-width: 575px) {
    .hero-hub {
        max-width: 360px;
        padding: 4px;
    }
    .hub-label {
        font-size: 8.5px;
    }
    .hub-core-a,
    .hub-core-b {
        font-size: 13px;
    }
}

/* =====================================================================
   Popup informativo de los nodos (estilo card del panel "Multi-empresa")
   ===================================================================== */
.hub-node {
    cursor: pointer;
}
.hub-node:hover .hub-dot,
.hub-node:focus .hub-dot,
.hub-node.is-active .hub-dot {
    fill: #a5dcf3;
    filter: drop-shadow(0 0 10px rgba(165, 220, 243, 0.95));
}
.hub-node:hover .hub-halo,
.hub-node:focus .hub-halo,
.hub-node.is-active .hub-halo {
    stroke: rgba(165, 220, 243, 0.6);
}

.hub-popup {
    position: absolute;
    z-index: 6;
    width: 340px;
    padding: 16px 18px;
    border: 1px solid var(--neo-line, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    background:
        radial-gradient(
            120% 100% at 0% 0%,
            rgba(27, 78, 245, 0.16),
            transparent 55%
        ),
        var(--neo-ink, #050507);
    box-shadow:
        0 30px 60px -30px rgba(0, 0, 0, 0.85),
        0 0 40px -16px rgba(27, 78, 245, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}
.hub-popup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--neo-neon, #5997ff),
        transparent
    );
    opacity: 0.6;
}
.hub-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.hub-popup-idx {
    display: block;
    font-family: "Grotesk", sans-serif;
    font-weight: 500;
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.03em;
    color: transparent;
    -webkit-text-stroke: 1.4px rgba(89, 151, 255, 0.6);
    margin-bottom: 8px;
}
.hub-popup-title {
    font-family: "Grotesk", sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text-2, #f4f7f5);
    margin: 0 0 6px;
}
.hub-popup-desc {
    color: var(--text-main, #f4f7f5a3);
    font-size: 12.5px;
    line-height: 1.5;
    margin: 0 0 12px;
}
.hub-popup-cmd {
    display: inline-block;
    font-family: "Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--neo-neon, #5997ff);
    background: rgba(27, 78, 245, 0.12);
    border: 1px solid rgba(89, 151, 255, 0.25);
    border-radius: 8px;
    padding: 5px 10px;
}
@media (max-width: 575px) {
    .hub-popup {
        width: 300px;
        padding: 14px 16px;
    }
    .hub-popup-idx {
        font-size: 20px;
    }
    .hub-popup-title {
        font-size: 17px;
    }
}
