/* MicroSim Schema Structure Map stylesheet
 * =======================================
 * Layout (top to bottom): title, legend, map drawing area, control panel.
 *
 * The map is a two-sided radial tree (a mind map): the root sits in the center,
 * the eight sections surround it, and fields fan outward to the left and right.
 * It needs the full width of the iframe, so the controls sit underneath the map
 * instead of in the right-hand panel of the standard vis-network layout.
 */

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

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

/* ===========================================
   MAIN CONTAINER
   =========================================== */
.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-height: 620px;
    background-color: aliceblue;
    border: 1px solid silver;
}

.title {
    flex: 0 0 auto;
    padding: 8px 10px 2px 10px;
    text-align: center;
    font-size: 22px;
    color: black;
}

/* ===========================================
   LEGEND (one row under the title)
   =========================================== */
.legend {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 14px;
    padding: 2px 10px 4px 10px;
    font-size: 13px;
    color: black;
}

.legend-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.swatch {
    display: inline-block;
    margin-right: 5px;
}

.swatch-section {
    width: 24px;
    height: 13px;
    border-radius: 4px;
    background-color: #1565C0;
}

.swatch-badge {
    padding: 0 5px;
    border-radius: 8px;
    background-color: #FFC107;
    color: black;
    font-size: 10px;
    font-weight: bold;
    line-height: 14px;
}

.swatch-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1565C0;
}

.swatch-required { background-color: #1565C0; }
.swatch-optional { background-color: white; }

.swatch-dashed {
    width: 26px;
    height: 0;
    border-top: 2px dashed #333;
}

/* ===========================================
   NETWORK (takes all remaining height)
   =========================================== */
#network {
    flex: 1 1 auto;
    min-height: 200px;
    width: 100%;
    background-color: aliceblue;
}

/* ===========================================
   NAVIGATION BUTTONS
   One compact row in each bottom corner so the buttons never cover the drawing.
   (vis-network's default is a 75px-tall cluster of 34px buttons.)
   =========================================== */
#network div.vis-navigation div.vis-button {
    width: 28px;
    height: 28px;
    background-size: 24px 24px;
    background-position: 2px 2px;
}
#network div.vis-navigation div.vis-button.vis-left        { left: 8px;   bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-up          { left: 40px;  bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-down        { left: 72px;  bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-right       { left: 104px; bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-zoomOut     { right: 72px; bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-zoomIn      { right: 40px; bottom: 6px; }
#network div.vis-navigation div.vis-button.vis-zoomExtends { right: 8px;  bottom: 6px; }

/* ===========================================
   CONTROL PANEL (white, below the drawing area)
   =========================================== */
.bottom-panel {
    flex: 0 0 142px;
    display: grid;
    grid-template-columns: 180px auto minmax(0, 1fr);
    gap: 12px;
    padding: 8px 10px;
    background-color: white;
    border-top: 1px solid silver;
    min-height: 0;
}

.filter-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-col label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.filter-col input,
.filter-col select {
    width: 100%;
    margin-bottom: 8px;
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: white;
}

.controls-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 2px;
}

.check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.btn {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

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

.count {
    font-size: 12px;
    color: #444;
}

.info-col {
    min-height: 0;
    overflow-y: auto;
    padding: 6px 10px;
    background-color: #F5F9FF;
    border: 1px solid #C5D5E8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.35;
}

.info-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.info-row { margin: 1px 0; overflow-wrap: anywhere; }
.info-key { color: #555; font-weight: bold; }
.info-code { font-family: monospace; font-size: 12px; }
.info-hint { color: #555; }
.info-yes { color: #B71C1C; font-weight: bold; }

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 620px) {
    .title { font-size: 18px; }
    .legend { font-size: 11px; gap: 2px 8px; }
    .bottom-panel { grid-template-columns: 118px auto minmax(0, 1fr); gap: 6px; padding: 6px; }
    .filter-col label { font-size: 11px; }
    .filter-col input, .filter-col select { font-size: 12px; padding: 3px 4px; margin-bottom: 5px; }
    .check { font-size: 11px; white-space: normal; }
    .btn { padding: 4px 6px; font-size: 11px; }
    .info-col { font-size: 12px; padding: 4px 6px; }
}
