/* Concept-to-Content Viewer - vis-network MicroSim
 * =================================================
 * Two-panel layout: graph (left) + content card (right), with a fixed search
 * bar on top. Panels stack vertically below 700px. The graph panel is a
 * positioned wrapper whose only vis-network child is #network; the legend is a
 * sibling overlay, never a child of #network.
 */

/* ===========================================
   RESET & BASE
   =========================================== */
* {
    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;
    display: flex;
    flex-direction: column;
}

/* ===========================================
   TITLE
   =========================================== */
.title {
    flex: 0 0 auto;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: black;
    padding: 8px 12px 2px;
}

/* ===========================================
   SEARCH BAR (fixed at top)
   =========================================== */
.search-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px 14px;
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #d5e3f0;
}

.search-label {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.search-wrap {
    flex: 1 1 220px;
    min-width: 180px;
}

#concept-search {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 2px solid #2196f3;
    border-radius: 6px;
    outline: none;
}

#concept-search:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.2);
}

.toggle-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.toggle-inline input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===========================================
   PANELS (graph + card)
   =========================================== */
.panels {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 10px;
    min-height: 0; /* allow children to shrink inside flex */
}

/* ---- Graph panel (left) ---- */
.graph-panel {
    position: relative;
    flex: 1 1 60%;
    min-width: 0;
    background-color: #ffffff;
    border: 1px solid #d5e3f0;
    border-radius: 8px;
    overflow: hidden;
}

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

.legend {
    position: absolute;
    top: 8px;
    left: 8px;
    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;
    color: #333;
}

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

.color-selected  { background-color: #f1c40f; }
.color-prereq    { background-color: #2f7ed8; }
.color-dependent { background-color: #27ae60; }
.color-neutral   { background-color: #c8c8c8; }

/* ---- Content card panel (right) ---- */
.card-panel {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.content-card {
    background-color: #ffffff;
    border: 2px solid #2196f3;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.card-eyebrow {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1976d2;
    margin-bottom: 8px;
}

.card-placeholder {
    font-size: 13px;
    color: #888;
    font-style: italic;
    line-height: 1.5;
}

.card-concept {
    font-size: 18px;
    font-weight: bold;
    color: #1a3a6c;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid #eef3f8;
    font-size: 13px;
}

.card-key {
    color: #666;
    font-weight: bold;
    flex-shrink: 0;
}

.card-val {
    color: #222;
    text-align: right;
}

.card-prereq-row .card-val {
    color: #1565c0;
    font-weight: bold;
}

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

.btn-jump {
    width: 100%;
    margin-top: 12px;
    background-color: #2196f3;
    color: white;
}

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

.jump-note {
    margin-top: 6px;
    font-size: 11px;
    color: #999;
    font-style: italic;
    text-align: center;
}

.card-caption {
    background-color: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #5d4037;
}

/* ===========================================
   RESPONSIVE - stack panels vertically below 700px
   =========================================== */
@media (max-width: 700px) {
    .panels {
        flex-direction: column;
    }

    .graph-panel {
        flex: 1 1 auto;
        min-height: 260px;
    }

    .card-panel {
        flex: 0 0 auto;
    }

    .title {
        font-size: 15px;
    }
}
