/* Node Styling Property Playground - vis-network MicroSim
   ======================================================= */

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

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

/* Container holds the graph (left) and the control panel (right) ----- */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Network canvas occupies the LEFT 55% ------------------------------- */
#network {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background-color: aliceblue;
}

/* Title -------------------------------------------------------------- */
.title {
    position: absolute;
    top: 8px;
    left: 27.5%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: bold;
    color: #1a3a6c;
    background-color: rgba(240, 248, 255, 0.85);
    padding: 3px 10px;
    white-space: nowrap;
    z-index: 10;
}

/* Control panel occupies the RIGHT 45% ------------------------------- */
.control-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    overflow-y: auto;
    padding: 12px 14px;
    background-color: #ffffff;
    border-left: 1px solid #d6e0ea;
    z-index: 10;
}

.panel-heading {
    font-size: 15px;
    font-weight: bold;
    color: #1a3a6c;
    margin-bottom: 10px;
}

/* Individual controls ------------------------------------------------ */
.ctl {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 9px;
}

.ctl select,
.ctl input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 5px 6px;
    font-size: 12px;
    font-weight: normal;
    border: 1px solid #bbb;
    border-radius: 4px;
    background-color: #fff;
}

.ctl input[type="color"] {
    display: block;
    margin-top: 4px;
    width: 56px;
    height: 28px;
    padding: 0;
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.range-wrap input[type="range"] {
    flex: 1;
}

.range-val {
    min-width: 30px;
    text-align: right;
    font-weight: normal;
    font-size: 12px;
    color: #555;
}

.ctl-check {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctl-check input {
    width: auto;
    margin: 0;
}

/* Disabled controls (not applicable to current shape) ---------------- */
.ctl.disabled {
    opacity: 0.45;
}

.ctl.disabled select,
.ctl.disabled input {
    cursor: not-allowed;
    background-color: #f0f0f0;
}

/* Live JSON preview -------------------------------------------------- */
.json-heading {
    margin-top: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: bold;
    color: #1a3a6c;
    border-top: 1px solid #e0e6ec;
    padding-top: 8px;
}

.json-preview {
    background-color: #1e2430;
    color: #d6e2f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11.5px;
    line-height: 1.45;
    padding: 10px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* Responsive: stack the panel below the canvas on narrow screens ----- */
@media (max-width: 720px) {
    .container {
        height: auto;
    }
    #network {
        position: static;
        width: 100%;
        height: 320px;
    }
    .title {
        left: 50%;
    }
    .control-panel {
        position: static;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #d6e0ea;
    }
}
