/* Structural Variations Explorer - vis-network MicroSim
 * =====================================================
 * One 12-node dataset under three layouts (Hierarchy / Cluster / Hybrid).
 * Overlays (title, legend, right panel, band shading) are SIBLINGS of #network.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: aliceblue;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* #network is inset from the top (clears the title bar) and from the
   right (clears the fixed-width right panel) so the graph never renders
   underneath either overlay. #band-shading mirrors the same box so the
   band strips (positioned from network.canvasToDOM coordinates) line up. */
#network {
    position: absolute;
    top: 54px;
    left: 0;
    width: calc(100% - 300px);
    height: calc(100% - 54px);
    background-color: aliceblue;
}

/* Band / cluster background shading - painted behind the graph.
   Individual band strips are injected by JS as .band divs. */
#band-shading {
    position: absolute;
    top: 54px;
    left: 0;
    width: calc(100% - 300px);
    height: calc(100% - 54px);
    pointer-events: none;
    z-index: 1;
}

.band {
    position: absolute;
    left: 0;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    transition: opacity 0.4s;
}

.band-label {
    font-size: 12px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.45);
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.band-blue   { background-color: rgba(33, 150, 243, 0.10); }
.band-green  { background-color: rgba(76, 175, 80, 0.10); }
.band-amber  { background-color: rgba(255, 152, 0, 0.12); }

/* ---------- Title ---------- */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: #1a3a6c;
    background-color: rgba(240, 248, 255, 0.85);
    padding: 4px 12px;
    white-space: nowrap;
    z-index: 10;
}

/* ---------- Legend ---------- */
.legend {
    position: absolute;
    top: 46px;
    left: 10px;
    padding: 8px 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    z-index: 10;
    max-width: 240px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 4px 0;
    font-size: 11px;
    line-height: 1.3;
}

.legend-swatch {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex-shrink: 0;
    border-radius: 50%;
}

.swatch-node {
    background-color: #97c2fc;
    border: 2px solid #2b7ce9;
}

.legend-line {
    width: 22px;
    height: 0;
    margin-right: 6px;
    flex-shrink: 0;
}

.line-primary {
    border-top: 3px solid #2b7ce9;
}

.line-secondary {
    border-top: 2px dashed #b0bec5;
}

/* ---------- Right panel ---------- */
.right-panel {
    position: absolute;
    top: 46px;
    right: 10px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.view-btn {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 2px solid #90caf9;
}

.view-btn:hover {
    background-color: #bbdefb;
}

.view-btn.active {
    background-color: #2196f3;
    color: white;
    border-color: #1976d2;
}

/* ---------- Infobox (trade-off) ---------- */
.infobox {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    border-left: 5px solid #2196f3;
}

.info-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1a3a6c;
}

.info-tradeoff {
    font-size: 12px;
    line-height: 1.55;
    color: #333;
}

.info-tradeoff .good { color: #2e7d32; font-weight: bold; }
.info-tradeoff .bad  { color: #c62828; font-weight: bold; }

/* ---------- Status / help ---------- */
.status-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.status-title {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 12px;
    color: #333;
}

.status-text {
    font-size: 11px;
    line-height: 1.45;
    color: #444;
}

.status-text ul {
    margin-left: 16px;
    margin-top: 4px;
}

.status-text li {
    margin-bottom: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .right-panel {
        width: 190px;
    }
    #network,
    #band-shading {
        width: calc(100% - 210px);
    }
    .legend {
        max-width: 160px;
    }
    .legend-item {
        font-size: 10px;
    }
    .btn {
        font-size: 12px;
        padding: 8px 10px;
    }
    .title {
        font-size: 15px;
    }
}
