/* Node graph styles */
.node-points .node-circle {
    transition: transform 0.2s ease, filter 0.2s ease, fill 0.3s ease, opacity 0.3s ease;
}

.node-points, .link-line {
    transition: opacity 0.2s ease;
}

/* ─── What If Mode Toggle Button ─── */
.what-if-toggle {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 28px;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid rgba(220, 200, 80, 0.25);
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(8px);
    color: rgba(220, 205, 80, 0.6);
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
    z-index: 100;
}

.what-if-toggle:hover {
    color: #e8d44a;
    border-color: rgba(220, 200, 60, 0.6);
    box-shadow: 0 0 14px rgba(210, 190, 50, 0.25);
}

.what-if-toggle.active {
    color: #e2d040;
    border-color: rgba(215, 195, 55, 0.7);
    background: rgba(210, 185, 40, 0.12);
    box-shadow: 0 0 20px rgba(205, 180, 40, 0.3);
}

/* ─── What If Node States ─── */

/* Root "erased" node: desaturated grey, strikethrough label */
.node-erased .node-circle {
    fill: rgb(80, 80, 85) !important;
    filter: grayscale(1) brightness(0.6);
}

.node-erased .node-name {
    fill: rgba(180, 180, 180, 0.6) !important;
}

/* Affected downstream nodes: grey tint — transitions so cascade waves look smooth */
.node-affected .node-circle {
    fill: rgb(90, 90, 95) !important;
    filter: grayscale(1) brightness(0.55);
    transition: fill 0.25s ease, filter 0.25s ease;
}

.node-affected .node-name {
    fill: rgba(170, 170, 170, 0.5) !important;
    transition: fill 0.25s ease;
}

/* ─── What If Link States ─── */
.link-erased {
    opacity: 0.38 !important;
    stroke: rgb(210, 210, 215) !important;
    /*stroke-dasharray: 5, 5; */
}

/* ─── What If Cross (X) on erased root node ─── */
.whatif-cross {
    stroke: rgb(255, 60, 60);
    stroke-width: 2.5px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(255, 60, 60, 0.8));
    pointer-events: none;
}

/* ─── What If Mode Active Cursor ─── */
body.what-if-active .node-points {
    cursor: hand;
}

.node-hovered .node-circle {
    transform: scale(1.12);
    fill: url(#hoverGlow);
    filter: brightness(1.3);
}

.node-muted {
    opacity: 0.55;
}

.node-selected .node-circle {
    transform: scale(1.35);
    fill: url(#hoverGlow);
    filter: brightness(1.3) drop-shadow(0 0 6px currentColor);
}

.node-dimmed {
    opacity: 0.25;
}

.link-line {
    transition: opacity 0.25s ease, stroke-width 0.2s ease, stroke 0.25s ease;
    filter: brightness(1.1);
}

.link-dimmed {
    opacity: 0.1;
}

.link-hovered {
    opacity: 1 !important;
    stroke-width: 2px;
}

.link-direction {
    stroke-width: 3;
    stroke-dasharray: 14, 10;
    stroke-linecap: round;
    pointer-events: none;
    animation: flowDirection 0.5s linear infinite;
    filter: brightness(1.2) drop-shadow(0 0 1px currentColor);
}

@keyframes flowDirection {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -24;
    }
}

#node-graph {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    z-index: 1;
}