/* Node and Edge Data Explorer - vis-network layout
   Network in the left 2/3, JSON data panel in the right 1/3.
   The data panel moves below the network under 600px. */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: aliceblue;
    color: #1f2937;
    font-size: 14px;
}

main { display: block; padding: 6px 8px; }

/* ---------- toolbar ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    background: white;
    border: 1px solid silver;
    border-radius: 6px;
    padding: 5px 8px;
}

.group { display: flex; align-items: center; gap: 4px; }

input[type="text"] {
    font-size: 14px;
    padding: 4px 6px;
    width: 130px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
}

select { font-size: 14px; padding: 3px 2px; max-width: 150px; }

button {
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

button:hover { background: #1d4ed8; }
button:disabled { background: #cbd5e1; border-color: #cbd5e1; color: #64748b; cursor: not-allowed; }
button.secondary { background: #f1f5f9; color: #1f2937; border-color: #64748b; }
button.secondary:hover { background: #e2e8f0; }
button[aria-pressed="true"] { background: #b45309; border-color: #92400e; }

button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.layout-toggle {
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-toggle legend { float: left; font-weight: bold; margin-right: 4px; }
.layout-toggle label { cursor: pointer; white-space: nowrap; }

/* ---------- work area ---------- */
.work {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.net-col {
    width: 66.67%;
    display: flex;
    flex-direction: column;
}

#network {
    width: 100%;
    height: 400px;
    background: white;
    border: 1px solid silver;
    border-radius: 6px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    font-size: 12px;
    color: #334155;
    padding: 3px 2px 0 2px;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: -2px;
    border: 1.5px solid #334155;
}

.dot.diagram { background: #bfdbfe; border-color: #1d4ed8; }
.dot.library { background: #bbf7d0; border-color: #15803d; }
.dot.feature { background: #fde68a; border-color: #b45309; }
.dot.new     { background: #e9d5ff; border-color: #7e22ce; }

.data-panel {
    width: 33.33%;
    background: white;
    border: 1px solid silver;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.panel-title { font-weight: bold; font-size: 14px; color: #1e3a8a; }

#json-view {
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    line-height: 1.35;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 5px;
    padding: 6px 8px;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 120px;
}

#json-view .k { color: #93c5fd; }
#json-view .s { color: #fcd34d; }
#json-view .n { color: #86efac; }

.note { font-size: 13px; color: #334155; line-height: 1.35; }

.status {
    font-size: 13px;
    line-height: 1.35;
    background: #fef3c7;
    color: #78350f;
    border-radius: 5px;
    padding: 5px 7px;
}

.status:empty { display: none; }

/* vis-network hover tooltip for edges */
div.vis-tooltip {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
    background: #1f2937 !important;
    color: white !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 5px 8px !important;
}

@media (max-width: 599px) {
    .work { flex-direction: column; }
    .net-col, .data-panel { width: 100%; }
    #network { height: 320px; }
}
