/* ═══════════════════════════════════════════════════════════════
   NEXUS GRAPH — Force-Directed Visualization
   ═══════════════════════════════════════════════════════════════ */

:root {
    --node-thought: #00d4aa;
    --node-question: #c9a227;
    --node-answer: #27c96a;
    --node-artifact: #a227c9;
    --node-default: #8899aa;
    --link-color: #1a4a4a;
    --glow-intensity: 0.6;
}

/* Container */
#graph-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    overflow: hidden;
}

#graph {
    width: 100%;
    height: 100%;
}

/* Legend */
.graph-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--teal);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--silver-dim);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.thought {
    background: var(--node-thought);
    box-shadow: 0 0 10px var(--node-thought);
}

.legend-dot.question {
    background: var(--node-question);
    box-shadow: 0 0 10px var(--node-question);
}

.legend-dot.answer {
    background: var(--node-answer);
    box-shadow: 0 0 10px var(--node-answer);
}

.legend-dot.artifact {
    background: var(--node-artifact);
    box-shadow: 0 0 10px var(--node-artifact);
}

/* Tooltip */
.graph-tooltip {
    position: absolute;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--teal);
    color: var(--silver);
    font-family: var(--font-body);
    font-size: 0.85rem;
    max-width: 300px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
}

.graph-tooltip.visible {
    opacity: 1;
}

.graph-tooltip .tooltip-type {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.graph-tooltip .tooltip-type.thought {
    color: var(--node-thought);
}

.graph-tooltip .tooltip-type.question {
    color: var(--node-question);
}

.graph-tooltip .tooltip-type.answer {
    color: var(--node-answer);
}

.graph-tooltip .tooltip-type.artifact {
    color: var(--node-artifact);
}

.graph-tooltip .tooltip-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.graph-tooltip .tooltip-author {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--silver-dim);
}

/* Loading */
.graph-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--silver-dim);
}

.graph-loading .logo-glyph {
    display: block;
    font-size: 3rem;
    color: var(--cyan);
    margin-bottom: 1rem;
}

.graph-loading .pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.graph-loading.hidden {
    display: none;
}

/* Node styling via D3 */
.node {
    cursor: pointer;
    transition: r 0.2s;
}

.node:hover {
    r: 12;
}

.link {
    stroke: var(--link-color);
    stroke-opacity: 0.6;
}

/* Nav active state */
.nav-links a.active {
    color: var(--cyan);
}