/* DAG Cycle Detector - vis-network MicroSim Stylesheet
 * ====================================================
 * Layout: full-height network graph with absolute-positioned overlays.
 * Overlays (title, legend, right-panel) are siblings of #network and float
 * on top with z-index; they never consume layout space.
 */

/* ===========================================
   RESET & BASE STYLES
   =========================================== */
* {
    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: aliceblue;
    padding: 4px 12px;
    white-space: nowrap;
    z-index: 10;
}

/* ===========================================
   LEGEND (Upper Left)
   =========================================== */
.legend {
    position: absolute;
    top: 10px;
    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 black;
    flex-shrink: 0;
}

.color-green { background-color: #4caf50; }
.color-red { background-color: #f44336; }

/* dashed-edge swatch in legend */
.legend-swatch {
    width: 16px;
    height: 0;
    margin-right: 6px;
    border-top: 2px dashed #9e9e9e;
    flex-shrink: 0;
}

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

/* ===========================================
   CONTROL BUTTONS
   =========================================== */
.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: 10px 16px;
    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:not(:disabled) {
    background-color: #1976d2;
}

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

.btn-danger {
    background-color: #e53935;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c62828;
}

.btn-danger:disabled {
    background-color: #ef9a9a;
    cursor: not-allowed;
}

/* ===========================================
   INFO PANEL (DAG status + badge)
   =========================================== */
.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.12);
    border: 2px solid #4caf50;
    transition: border-color 0.25s;
}

.info-panel.cycle {
    border-color: #e53935;
}

/* colored pill badge */
.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.badge-valid {
    background-color: #4caf50;
}

.badge-cycle {
    background-color: #e53935;
}

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

.info-content {
    font-size: 12.5px;
    line-height: 1.6;
    color: #222;
}

/* ===========================================
   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: 14px;
        padding: 4px 8px;
    }

    .legend {
        padding: 4px 6px;
    }

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

    .right-panel {
        width: 200px;
    }

    .controls {
        padding: 8px 10px;
    }

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

    .info-content {
        font-size: 11.5px;
    }
}
