/* Ready-to-Learn Frontier Simulator
 * =================================
 * Layout: full-height hierarchical (top-down) 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: 200px;
}

.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-learned  { background-color: #43a047; }
.color-ready    { background-color: #ffc107; }
.color-notready { background-color: #cfd8dc; }

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

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

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

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

/* ===========================================
   INFO PANEL (live Ready-to-Learn list)
   =========================================== */
.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 #ffc107;
}

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

.ready-list {
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
}

.ready-list li {
    padding: 4px 8px;
    margin-bottom: 4px;
    background-color: #fff8e1;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.ready-list li.ready-empty {
    background-color: #f5f5f5;
    border-left-color: #bdbdbd;
    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 STYLES
   =========================================== */
@media (max-width: 600px) {
    .title {
        font-size: 14px;
        padding: 4px 8px;
    }

    .legend {
        max-width: 160px;
    }

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

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

    .right-panel {
        width: 190px;
    }

    .ready-list {
        font-size: 12px;
    }
}
