/* Orphan & Disconnected Subgraph Explorer
 * =======================================
 * Layout: full-height force-directed network with overlay panels.
 * Overlays are ABSOLUTE-positioned siblings of #network (never children),
 * because vis-network erases the innerHTML of its container div.
 */

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

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

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

#network {
    width: 100%;
    height: 100vh;
    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: rgba(240, 248, 255, 0.85);
    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;
    max-width: 210px;
}

.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 black;
    flex-shrink: 0;
}

.color-blue   { background-color: #2196f3; }
.color-red    { background-color: #f44336; }
.color-orange { background-color: #ff9800; }

/* ===========================================
   RIGHT PANEL (Controls & Info)
   =========================================== */
.right-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 270px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    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: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

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

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

.btn-primary:disabled {
    background-color: #ffab91;
    cursor: not-allowed;
}

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

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

/* ===========================================
   INFO / DIAGNOSIS PANEL
   =========================================== */
.info-panel {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 6px 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 .diagnosis {
    margin-top: 6px;
    font-weight: bold;
}

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

/* State accent colors applied to the info panel border + title */
.info-panel.state-main   { border-left-color: #2196f3; }
.info-panel.state-main   .info-title { color: #1976d2; }
.info-panel.state-orphan { border-left-color: #f44336; }
.info-panel.state-orphan .info-title { color: #c62828; }
.info-panel.state-cluster{ border-left-color: #ff9800; }
.info-panel.state-cluster .info-title { color: #e65100; }

/* ===========================================
   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 STYLES
   =========================================== */
@media (max-width: 600px) {
    .title {
        font-size: 13px;
        padding: 4px 8px;
    }

    .legend {
        padding: 4px 6px;
        max-width: 160px;
    }

    .legend-item {
        font-size: 9px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .right-panel {
        width: 190px;
    }

    .btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}
