/* ============================================================
   css/mp/network.css — Cooperation network styles within
                         MP profile (Phase 2).
                         NOT the parliament network graph
                         (that is css/network.css).
   ============================================================ */

/* ── Rank list ───────────────────────────────────────────── */
.network-rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.network-rank-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.network-rank-item:hover {
    border-color: var(--gradient-start);
    background: var(--hover-bg);
}

.rank-number {
    min-width: 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    text-align: right;
}

.rank-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-party {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--border-default);
    color: var(--text-primary);
}

.rank-party.party-kok   { background: #006288; color: white; }
.rank-party.party-sdp   { background: #ff5a5a; color: white; }
.rank-party.party-ps    { background: #6fb4fc; color: #1e293b; }
.rank-party.party-kesk  { background: #099327; color: white; }
.rank-party.party-vihr  { background: #8fce29; color: #1e293b; }
.rank-party.party-vas   { background: #e22a73; color: white; }
.rank-party.party-rkp   { background: #ffdc5d; color: #1e293b; }
.rank-party.party-kd    { background: #923de8; color: white; }
.rank-party.party-liike { background: #cf83c8; color: white; }
.rank-party.party-tv    { background: #7a7a7a; color: white; }

.rank-count {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.rank-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    vertical-align: middle;
    margin-right: 3px;
}

/* ── Network legend ──────────────────────────────────────── */
.network-legend {
    display: flex;
    gap: 1.2rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.5rem;
}

.legend-solid::before {
    content: '───';
    margin-right: 4px;
    color: #94a3b8;
    font-weight: 700;
}

.legend-dashed::before {
    content: '- - -';
    margin-right: 4px;
    color: #94a3b8;
    font-weight: 700;
}

/* ── D3 graph container ──────────────────────────────────── */
#network-graph svg {
    display: block;
    width: 100%;
}

#network-graph .network-node circle {
    transition: fill 0.2s;
}

#network-graph .network-node:hover circle {
    fill: var(--gradient-start, #3b82f6);
    opacity: 0.85;
}
