/* Dependency Role Explorer - vis-network MicroSim
 * ===============================================
 * Layout: full-height network canvas with absolute-positioned overlays.
 * Overlays (title, legend, right panel) are SIBLINGS of #network, never
 * children - vis-network erases the innerHTML of its container.
 */

/* ===========================================
   RESET & BASE
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===========================================
   CONTAINER & NETWORK CANVAS
   =========================================== */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

#network {
    width: 100%;
    height: 100%;
    background-color: aliceblue;
}

/* ===========================================
   TITLE (top center)
   =========================================== */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: black;
    background-color: aliceblue;
    padding: 4px 12px;
    white-space: nowrap;
    z-index: 10;
}

/* ===========================================
   LEGEND (upper left)
   =========================================== */
.legend {
    position: absolute;
    top: 44px;
    left: 10px;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 3px 0;
    font-size: 11px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid #1b3b5f;
    flex-shrink: 0;
}

.color-node { background-color: #a9d0f5; }
.color-gold { background-color: #ffd54f; border-color: #b8860b; }

/* ===========================================
   RIGHT PANEL (controls + info)
   =========================================== */
.right-panel {
    position: absolute;
    top: 44px;
    right: 10px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

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

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

.btn-primary {
    background-color: #2196f3;
    color: white;
}

.btn-primary:hover { background-color: #1976d2; }

.btn-primary.active {
    background-color: #b8860b;
}

.btn-primary.active:hover { background-color: #9c7209; }

.btn-secondary {
    background-color: #757575;
    color: white;
}

.btn-secondary:hover { background-color: #616161; }

/* ===========================================
   INFO PANEL (edge role readout)
   =========================================== */
.info-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid #2196f3;
}

.info-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 13px;
    color: #1976d2;
}

.info-content {
    font-size: 12px;
    line-height: 1.6;
}

.info-content .role-line {
    margin: 4px 0;
}

.info-content .role-label {
    font-weight: bold;
}

.role-dependent { color: #c0392b; }
.role-prerequisite { color: #1e7e34; }

.info-placeholder {
    color: #888;
    font-style: italic;
}

/* ===========================================
   STATUS / HELP PANEL
   =========================================== */
.status-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 13px;
}

.status-text {
    font-size: 11px;
    line-height: 1.5;
}

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

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

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 600px) {
    .title { font-size: 14px; padding: 4px 8px; }
    .legend { padding: 4px 6px; }
    .legend-item { font-size: 10px; }
    .legend-color { width: 12px; height: 12px; }
    .right-panel { width: 200px; }
    .btn { padding: 7px 10px; font-size: 12px; }
}
