/* Theory-to-Practice Concept Map - vis-network MicroSim
 * =====================================================
 * Two-tier hierarchical map: theory circles on top, practice squares below.
 * Side panel sits at right; stacks below the network under 640px.
 * Overlays 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 {
    width: 100%;
    height: 100%;
    background-color: aliceblue;
}

/* ---------- 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: 230px;
}

.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: 2px solid #333;
}

.swatch-theory {
    background-color: #97c2fc;
    border-color: #2b7ce9;
    border-radius: 50%;
}

.swatch-practice {
    background-color: #ffd54f;
    border-color: #f5a623;
    border-radius: 3px;
}

.swatch-secondary {
    background-color: #e0e0e0;
    border-color: #9e9e9e;
    border-radius: 3px;
}

.legend-line {
    width: 22px;
    height: 0;
    margin-right: 6px;
    flex-shrink: 0;
    border-top: 3px solid #607d8b;
}

/* ---------- Side panel ---------- */
.side-panel {
    position: absolute;
    top: 46px;
    right: 10px;
    width: 300px;
    max-height: calc(100% - 60px);
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-top: 5px solid #2196f3;
    z-index: 10;
}

.side-title {
    font-weight: bold;
    font-size: 15px;
    color: #1a3a6c;
    margin-bottom: 8px;
}

.side-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-theory {
    background-color: #e3f2fd;
    color: #1565c0;
}

.badge-practice {
    background-color: #fff3d6;
    color: #b8860b;
}

.badge-secondary {
    background-color: #eeeeee;
    color: #616161;
}

.side-body {
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.side-body .side-def {
    font-style: italic;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.side-body .side-connects {
    margin-top: 10px;
    font-size: 12px;
    color: #444;
}

.side-body .side-connects strong {
    color: #1565c0;
}

.side-placeholder {
    color: #777;
    font-size: 13px;
    line-height: 1.6;
}

/* ---------- Responsive: stack side panel below network under 640px ---------- */
@media (max-width: 640px) {
    .container {
        height: auto;
    }
    #network {
        height: 60vh;
        min-height: 340px;
    }
    .side-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 8px;
        border-top: 5px solid #2196f3;
    }
    .legend {
        max-width: 170px;
    }
    .legend-item {
        font-size: 10px;
    }
    .title {
        font-size: 15px;
    }
}
