/* Shared CSS for Hub Diagram - Elementor & Gutenberg */
.hub-diagram-host {
    position: relative;
    width: 100%;
    height: 540px;
    min-height: 300px;
    overflow: hidden;
    box-sizing: border-box;
    display: block;
    counter-reset: step-counter;
    container-type: inline-size;
    container-name: hub-diagram;
}

/* CENTER CIRCLE */
.hub-diagram-host .hd-center {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.hub-diagram-host .hd-center-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.hub-diagram-host .hd-center-inner {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
.hub-diagram-host .hd-center-title {
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
    color: #111;
}
.hub-diagram-host .hd-center-sub {
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    margin-top: 4px;
    line-height: 1.35;
}

/* CARDS base */
.hub-diagram-host .hd-card {
    position: absolute;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .22s ease, opacity .3s, border-color .22s;
    z-index: 10;
    text-decoration: none;
    counter-increment: step-counter;
}

/* SHAPES */
.hub-diagram-host .hd-card.shape-rect {
    border-radius: 13px;
    box-shadow: 0 3px 10px rgba(0,0,0,.09), 0 6px 22px rgba(0,0,0,.07);
}
.hub-diagram-host .hd-card.shape-pill {
    border-radius: 40px;
    box-shadow: 0 3px 10px rgba(0,0,0,.09), 0 6px 22px rgba(0,0,0,.07);
}
.hub-diagram-host .hd-card.shape-outline {
    background: transparent !important;
    border: 2px solid #cbd5e1;
    box-shadow: none;
    border-radius: 13px;
}

/* HOVER STATES */
.hub-diagram-host .hd-card:hover {
    transform: translateY(-5px) scale(1.04);
}
.hub-diagram-host .hd-card.shape-rect:hover,
.hub-diagram-host .hd-card.shape-pill:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.hub-diagram-host .hd-card.shape-outline:hover {
    border-color: #6366f1;
}

.hub-diagram-host .hd-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hub-diagram-host .hd-card-icon {
    font-size: 20px;
    height: 20px;
    width: 20px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}
.hub-diagram-host .hd-card-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    padding: 6px 10px;
}
.hub-diagram-host .hd-card-bar {
    width: 100%;
    height: 11px;
    flex-shrink: 0;
}
.hub-diagram-host .hd-card.hd-highlighted {
    outline: 3px solid #E8793A;
    outline-offset: 2px;
}
.hub-diagram-host .hd-card.hd-dimmed {
    opacity: .18;
    pointer-events: none;
}

/* GLOW FLOW PARTICLES ANIMATION (GPU Rendered) */
.hub-diagram-host .hd-glow-line {
    stroke-dasharray: 6, 14;
    animation: hd-glow-flow 1.4s linear infinite;
    opacity: 0.95;
}

@keyframes hd-glow-flow {
    to {
        stroke-dashoffset: -20;
    }
}

/* ─────────────────────────────────────────────────────────────
   TABLET — tighter diagram, still hub layout
───────────────────────────────────────────────────────────── */
.hub-diagram-host.hd-tablet {
    min-height: 380px;
}

@container hub-diagram (max-width: 1023px) and (min-width: 768px) {
    .hub-diagram-host {
        min-height: 380px;
    }
}

/* ─────────────────────────────────────────────────────────────
   MOBILE — vertical timeline (JS toggles .hd-mobile on host width)
───────────────────────────────────────────────────────────── */
.hub-diagram-host.hd-mobile {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px 16px 28px !important;
}

.hub-diagram-host.hd-mobile svg {
    display: none !important;
}

.hub-diagram-host.hd-mobile .hd-center {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 140px !important;
    height: 140px !important;
    margin: 0 auto 20px !important;
    flex-shrink: 0;
}

.hub-diagram-host.hd-mobile .hd-center-inner {
    padding: 12px;
}

.hub-diagram-host.hd-mobile .hd-nodes {
    position: relative !important;
    inset: auto !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding-left: 28px;
}

.hub-diagram-host.hd-mobile .hd-mobile-rail {
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, #E8793A 0%, #D4A92A 50%, #26B8B8 100%);
    border-radius: 2px;
    opacity: 0.55;
    pointer-events: none;
}

.hub-diagram-host.hd-mobile .hd-mobile-item {
    position: relative;
    width: 100%;
}

.hub-diagram-host.hd-mobile .hd-mobile-bullet {
    position: absolute;
    left: -23px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,.08);
    z-index: 2;
}

.hub-diagram-host.hd-mobile .hd-card {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    display: block;
}

.hub-diagram-host.hd-mobile .hd-card:hover {
    transform: translateY(-2px) !important;
}

.hub-diagram-host.hd-mobile .hd-card-inner {
    min-height: 72px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 14px 14px 18px;
    text-align: left;
    position: relative;
}

.hub-diagram-host.hd-mobile .hd-card-inner::before {
    content: "Step " counter(step-counter);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    position: absolute;
    top: 8px;
    right: 12px;
}

.hub-diagram-host.hd-mobile .hd-card-icon {
    margin: 0;
    flex-shrink: 0;
    font-size: 22px;
    width: 24px;
    height: 24px;
}

.hub-diagram-host.hd-mobile .hd-card-label {
    flex: 1;
    justify-content: flex-start;
    padding: 0;
    font-size: 14px !important;
}

.hub-diagram-host.hd-mobile .hd-card-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    height: auto;
    border-radius: 0;
}

.hub-diagram-host.hd-mobile .hd-card.shape-pill .hd-card-bar,
.hub-diagram-host.hd-mobile .hd-card.shape-rect .hd-card-bar {
    border-radius: 13px 0 0 13px;
}

/* Fallback if JS class missing (viewport-based) */
@media (max-width: 767px) {
    .hub-diagram-host:not(.hd-tablet) {
        height: auto;
        min-height: 0;
    }
}

/* ANIMATIONS */
@keyframes hd-fadeDown {
    from { opacity:0; transform:translateY(-22px); }
    to   { opacity:1; transform:none; }
}
@keyframes hd-fadeUp {
    from { opacity:0; transform:translateY(22px); }
    to   { opacity:1; transform:none; }
}
@keyframes hd-scaleIn {
    from { opacity:0; transform:translate(-50%,-50%) scale(.5); }
    to   { opacity:1; transform:translate(-50%,-50%) scale(1); }
}
@keyframes hd-mobileIn {
    from { opacity:0; transform:scale(.85); }
    to   { opacity:1; transform:scale(1); }
}
