/* void-network.css — Styles for the void network visualization */

.vn-container {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 500px;
    max-height: 900px;
    background: #06060c;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.vn-container .viz-canvas {
    width: 100%;
    height: 100%;
}
.vn-container .viz-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Controls bar (search + filters) */
.vn-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(to bottom, rgba(6,6,12,0.92) 0%, rgba(6,6,12,0.7) 80%, transparent 100%);
    pointer-events: none;
}
.vn-controls > * {
    pointer-events: auto;
}

/* Search */
.vn-search-wrap {
    flex-shrink: 0;
}
.vn-search {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: var(--text, #e0e0e0);
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    width: 160px;
    outline: none;
    transition: border-color 0.15s, width 0.2s;
}
.vn-search:focus {
    border-color: var(--accent, #4a9eff);
    width: 200px;
}
.vn-search::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Category filter buttons */
.vn-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.vn-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 3px;
    color: rgba(255,255,255,0.4);
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.vn-filter-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
}
.vn-filter-btn.vn-filter-active {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}
.vn-filter-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.vn-filter-count {
    opacity: 0.5;
    font-size: 0.55rem;
}

/* Stats line */
.vn-stats {
    position: absolute;
    top: auto;
    bottom: 0.6rem;
    right: 0.75rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.25);
    z-index: 6;
    letter-spacing: 0.04em;
}

/* Floating node labels */
.vn-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}
.vn-label {
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(220, 220, 230, 0.85);
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 6px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.7), 0 1px 2px rgba(0,0,0,0.8);
    transition: opacity 0.15s;
}

/* Info panel (right side overlay) */
.vn-info {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90%;
    height: 100%;
    background: rgba(10, 10, 18, 0.96);
    border-left: 1px solid rgba(74, 158, 255, 0.15);
    padding: 1.25rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    line-height: 1.6;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.vn-info-visible {
    transform: translateX(0);
}

/* Close button */
.vn-info-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.15s;
}
.vn-info-close:hover {
    color: rgba(255,255,255,0.8);
}

.vn-info-header h3 {
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
    color: var(--text, #e0e0e0);
    padding-right: 2rem;
}
.vn-info-cat {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    display: inline-block;
    margin-right: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vn-info-conf {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    color: var(--text-dim, #888);
    padding: 0.1em 0.5em;
    border: 1px solid var(--border, #333);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Score display */
.vn-info-score {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 1rem 0;
}
.vn-info-score-num {
    font-family: var(--font-mono, monospace);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text, #e0e0e0);
    line-height: 1;
}
.vn-info-score-den {
    font-size: 1rem;
    color: var(--text-dim, #888);
    font-weight: 400;
}
.vn-info-risk {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Score bars */
.vn-info-bars {
    margin: 0.75rem 0;
}
.vn-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
}
.vn-bar-label {
    width: 110px;
    flex-shrink: 0;
    font-size: 0.72rem;
    color: var(--text-dim, #888);
}
.vn-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.vn-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.vn-bar-val {
    width: 28px;
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    color: var(--text-dim, #888);
}

.vn-info-text {
    margin: 0.75rem 0;
    color: var(--text, #e0e0e0);
}
.vn-info-section {
    margin: 0.75rem 0;
    color: var(--text-dim, #aaa);
    font-size: 0.8rem;
    line-height: 1.6;
}
.vn-info-section strong {
    color: var(--text, #e0e0e0);
}
.vn-info-section ul {
    margin: 0.4rem 0;
    padding-left: 1rem;
}
.vn-info-section li {
    margin: 0.3rem 0;
}
.vn-info-notes {
    font-style: italic;
    color: var(--accent, #4a9eff);
    border-left: 2px solid var(--accent, #4a9eff);
    padding-left: 0.75rem;
}
.vn-coupling-score {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: var(--text-dim, #888);
}

/* Legend (bottom left overlay) */
.vn-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(10, 10, 18, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.65rem 0.85rem;
    font-size: 0.65rem;
    color: var(--text-dim, #888);
    z-index: 5;
    max-width: 200px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.vn-legend-title {
    font-family: var(--font-mono, monospace);
    color: var(--accent, #4a9eff);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}
.vn-legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.2rem 0;
}
.vn-legend-dot {
    display: inline-block;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Info panel metadata tags */
.vn-info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0.75rem;
}
.vn-info-tag {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.6);
    padding: 0.15em 0.5em;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Axis labels in cluster/dynamics views */
.vn-axis-label {
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(74, 158, 255, 0.7);
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 0 8px rgba(0,0,0,0.9);
    transition: opacity 0.15s;
}
.vn-axis-label.vn-axis-tick {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0;
    text-transform: none;
}

/* Legend subtitle */
.vn-legend-subtitle {
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
    margin-bottom: 0.15rem;
}

/* Hover tooltip */
.vn-tooltip {
    position: absolute;
    z-index: 12;
    background: rgba(10, 10, 18, 0.95);
    border: 1px solid rgba(74, 158, 255, 0.25);
    border-radius: 5px;
    padding: 0.5rem 0.7rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: var(--text, #e0e0e0);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    white-space: nowrap;
    line-height: 1.5;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.vn-tooltip-hint {
    color: rgba(255,255,255,0.3);
    font-size: 0.58rem;
}

/* Harms section */
.vn-info-harms {
    background: rgba(255, 68, 68, 0.06);
    border-left: 2px solid rgba(255, 68, 68, 0.4);
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
}

/* Recommendations section */
.vn-info-recs {
    background: rgba(61, 220, 132, 0.06);
    border-left: 2px solid rgba(61, 220, 132, 0.4);
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
}
.vn-info-recs ul {
    margin: 0.4rem 0 0;
    padding-left: 1rem;
}
.vn-info-recs li {
    margin: 0.4rem 0;
    line-height: 1.5;
}
.vn-rec-text {
    color: var(--text, #e0e0e0);
}
.vn-rec-tag {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 0.55rem;
    color: #3ddc84;
    background: rgba(61, 220, 132, 0.1);
    border: 1px solid rgba(61, 220, 132, 0.2);
    border-radius: 2px;
    padding: 0.05em 0.35em;
    margin-left: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* Scrollbar */
.vn-info::-webkit-scrollbar {
    width: 4px;
}
.vn-info::-webkit-scrollbar-track {
    background: transparent;
}
.vn-info::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.vn-info::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .vn-container {
        height: 65vh;
        min-height: 400px;
    }
    .vn-controls {
        padding: 0.4rem 0.5rem;
        gap: 0.3rem;
    }
    .vn-search {
        width: 120px;
        font-size: 0.7rem;
    }
    .vn-search:focus {
        width: 140px;
    }
    .vn-filter-btn {
        font-size: 0.55rem;
        padding: 0.15rem 0.35rem;
    }
    .vn-view-btn {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
    }
    .vn-info {
        width: 100%;
        max-width: 100%;
        height: 55%;
        top: auto;
        bottom: 0;
        right: 0;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid rgba(74, 158, 255, 0.15);
    }
    .vn-info-visible {
        transform: translateY(0);
    }
    .vn-legend {
        max-width: 170px;
        font-size: 0.58rem;
        padding: 0.5rem 0.65rem;
    }
    .vn-stats {
        font-size: 0.55rem;
    }
}

/* ========== View Toggle ========== */
.vn-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.vn-view-btn {
    background: var(--bg-card, #151520);
    border: none;
    color: var(--text-dim, #888);
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.03em;
}
.vn-view-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text, #e0e0e0);
}
.vn-view-btn.vn-view-active {
    background: var(--accent, #4a9eff);
    color: #fff;
    font-weight: 600;
}

/* ========== Scorecard View ========== */
.vn-scorecard {
    background: var(--bg-card, #151520);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

/* Scorecard controls bar */
.vn-sc-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(6,6,12,0.6);
    border-bottom: 1px solid var(--border, #333);
}
.vn-sc-search {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: var(--text, #e0e0e0);
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    width: 180px;
    outline: none;
    transition: border-color 0.15s;
}
.vn-sc-search:focus {
    border-color: var(--accent, #4a9eff);
}
.vn-sc-search::placeholder {
    color: rgba(255,255,255,0.3);
}
.vn-sc-sort,
.vn-sc-filter-cat,
.vn-sc-filter-conf {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: var(--text, #e0e0e0);
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
    outline: none;
    cursor: pointer;
}
.vn-sc-sort option,
.vn-sc-filter-cat option,
.vn-sc-filter-conf option {
    background: #151520;
    color: var(--text, #e0e0e0);
}

/* Summary strip */
.vn-sc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.6rem 1rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: var(--text-dim, #888);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.vn-sc-summary-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.vn-sc-summary-num {
    font-weight: 700;
    color: var(--text, #e0e0e0);
    font-size: 0.85rem;
}

/* Scorecard table */
.vn-sc-table {
    width: 100%;
}

/* Row */
.vn-sc-row {
    display: grid;
    grid-template-columns: 2.2rem 1fr 5.5rem 4.5rem 6rem;
    align-items: center;
    gap: 0;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.12s;
}
.vn-sc-row:hover {
    background: rgba(255,255,255,0.03);
}
.vn-sc-row-header {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: default;
    padding: 0.5rem 1rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.vn-sc-row-header:hover {
    background: transparent;
}

/* Score badge */
.vn-sc-score {
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1;
}

/* Name + category cell */
.vn-sc-name {
    font-size: 0.85rem;
    color: var(--text, #e0e0e0);
    font-weight: 500;
}
.vn-sc-cat {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.5rem;
}

/* Mini bars for sub-scores */
.vn-sc-bars {
    display: flex;
    gap: 2px;
    align-items: center;
}
.vn-sc-mini-bar {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    opacity: 0.85;
    position: relative;
}
.vn-sc-mini-bar-label {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono, monospace);
    font-size: 0.5rem;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
    display: none;
}
.vn-sc-row:hover .vn-sc-mini-bar-label {
    display: block;
}

/* Confidence badge */
.vn-sc-conf {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

/* Risk label */
.vn-sc-risk {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: right;
}

/* Expandable detail */
.vn-sc-detail {
    display: none;
    padding: 0.75rem 1rem 1rem 3.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(6,6,12,0.4);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-dim, #aaa);
    animation: vn-sc-expand 0.2s ease-out;
}
@keyframes vn-sc-expand {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 600px; }
}
.vn-sc-detail.vn-sc-detail-open {
    display: block;
}
.vn-sc-detail-bars {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0 0.75rem;
}
.vn-sc-detail-bar {
    flex: 1;
}
.vn-sc-detail-bar-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.2rem;
}
.vn-sc-detail-bar-track {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.vn-sc-detail-bar-fill {
    height: 100%;
    border-radius: 3px;
}
.vn-sc-detail-bar-val {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    color: var(--text-dim, #888);
    margin-top: 0.15rem;
}
.vn-sc-detail p {
    margin: 0.4rem 0;
}
.vn-sc-detail strong {
    color: var(--text, #e0e0e0);
}
.vn-sc-detail ul {
    margin: 0.3rem 0;
    padding-left: 1rem;
}
.vn-sc-detail li {
    margin: 0.25rem 0;
}
.vn-sc-detail-harms {
    background: rgba(255,68,68,0.06);
    border-left: 2px solid rgba(255,68,68,0.4);
    padding: 0.4rem 0.6rem;
    border-radius: 0 4px 4px 0;
    margin: 0.5rem 0;
}
.vn-sc-detail-recs {
    background: rgba(61,220,132,0.06);
    border-left: 2px solid rgba(61,220,132,0.4);
    padding: 0.4rem 0.6rem;
    border-radius: 0 4px 4px 0;
    margin: 0.5rem 0;
}
.vn-sc-detail-connections {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Category group headers in "By Category" sort */
.vn-sc-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vn-sc-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Responsive scorecard */
@media (max-width: 768px) {
    .vn-view-toggle {
        width: 100%;
    }
    .vn-view-btn {
        flex: 1;
        text-align: center;
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    .vn-sc-controls {
        gap: 0.4rem;
        padding: 0.5rem 0.65rem;
    }
    .vn-sc-search {
        width: 100%;
    }
    .vn-sc-sort,
    .vn-sc-filter-cat,
    .vn-sc-filter-conf {
        flex: 1;
        min-width: 0;
        font-size: 0.65rem;
    }
    .vn-sc-row {
        grid-template-columns: 2rem 1fr 5rem;
        padding: 0.5rem 0.65rem;
    }
    .vn-sc-bars,
    .vn-sc-conf {
        display: none;
    }
    .vn-sc-detail {
        padding-left: 2rem;
    }
}
