/* Metadata Section Explorer layout
   Toolbar (44px) + stage (456px) = 500px, the CANVAS_HEIGHT in the .js file.
   At 500px and wider the infobox sits to the right of the network;
   below 500px it moves under the network and the two share the same 456px. */
* { box-sizing: border-box; }

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

main {
    display: block;
    width: 100%;
    border: 1px solid silver;
}

#toolbar {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    background-color: white;
    border-bottom: 1px solid silver;
    font-size: 15px;
    white-space: nowrap;
}

#app-title {
    font-weight: bold;
    font-size: 17px;
    margin-right: auto;
}

#toolbar button {
    font-size: 14px;
    padding: 4px 10px;
    cursor: pointer;
}

#toolbar label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

#stage {
    display: flex;
    height: 454px;
}

#network {
    flex: 1 1 auto;
    min-width: 0;
    height: 454px;
    background-color: aliceblue;
    border-right: 1px solid silver;
}

#infobox {
    flex: 0 0 36%;
    height: 454px;
    overflow-y: auto;
    padding: 10px 12px;
    background-color: white;
    font-size: 14px;
    line-height: 1.4;
}

#infobox h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
}

#infobox .swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: -1px;
}

#infobox .kv {
    margin: 3px 0;
}

#infobox .kv b {
    color: navy;
    font-weight: normal;
}

#infobox pre {
    background: whitesmoke;
    border: 1px solid gainsboro;
    border-radius: 4px;
    padding: 6px;
    margin: 4px 0;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

#infobox .req { color: darkgreen; font-weight: bold; }
#infobox .opt { color: dimgray; font-weight: bold; }
#infobox .right { color: darkgreen; font-weight: bold; }
#infobox .wrong { color: firebrick; font-weight: bold; }
#infobox .muted { color: dimgray; }

#infobox button {
    font-size: 14px;
    padding: 4px 10px;
    margin-top: 6px;
    cursor: pointer;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.legend-box {
    width: 34px;
    height: 16px;
    border: 2px solid gray;
    border-radius: 3px;
    background: white;
}

.legend-box.dashed { border-style: dashed; }

/* Tooltips from vis-network */
div.vis-tooltip {
    max-width: 260px;
    white-space: normal !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 639px) {
    #app-title { display: none; }
    #toolbar { font-size: 14px; gap: 8px; }
    #toolbar button { font-size: 13px; padding: 4px 8px; }
}

@media (max-width: 499px) {
    #stage { flex-direction: column; }
    #network {
        flex: none;
        height: 262px;
        border-right: none;
        border-bottom: 1px solid silver;
    }
    #infobox {
        flex: none;
        height: 192px;
        font-size: 13px;
    }
}

/* Smaller navigation buttons on narrow screens so they cover less of the graph */
@media (max-width: 499px) {
    div.vis-network div.vis-navigation div.vis-button {
        transform: scale(0.75);
    }
}
