/* CSS file for the 'output' part: the entire webview in VSCode or the right hand
 * side of the webpage on play.tinygo.org. */

/* Area at the top with all the devices */

.simulator {
    position: relative;
    display: flex;
    flex-direction: column;
}

.simulator .schematic {
    position: relative;
    overflow: hidden;
    width: 100%;
    flex-grow: 1;
}
.simulator.compiling .schematic {
    opacity: 0.7;
}
.simulator.no-schematic .schematic {
    display: none;
}

.simulator .schematic-buttons {
    position: absolute;
    right: 0;
    top: 1px;
    z-index: 1;
}
.simulator .schematic-button {
    display: inline-block;
    width: 32px;
    height: 32px;
    padding: 0;
    color: white;
    line-height: 1;
    font-size: 24px;
    text-align: center;
    background-color: rgba(150, 150, 150, 0.5);
    border: none;
    border-radius: 3px;
    opacity: 0.3;
    transition: opacity 150ms;
}
.simulator .schematic-button:hover,
.simulator .schematic-button:disabled {
    opacity: 1;
}
.simulator .schematic-button img {
    filter: invert(1); /* make white instead of black */
    width: 24px;
    padding-bottom: 2px;
}
.simulator.paused .button-img-pause,
.simulator:not(.paused) .button-img-play {
    display: none; /* hide the other button image */
}

.simulator .board-container {
    position: absolute;
    filter: drop-shadow(0 0 6px #777c);
}
.simulator .board-container > .background {
    fill: transparent;
}
.simulator .board-container.selected > .background {
    outline: 1.7px dashed gray;
}
.simulator.compiling .board-container {
    pointer-events: none;
}

.simulator .pin-hover-dot {
    r: 1px; /* actually: 1mm */
    fill: #080;
}
.simulator [data-pin]:not(:hover) .pin-hover-dot {
    visibility: hidden;
}

.simulator .hover-connection {
    filter: brightness(1.4);
}

.simulator .wire {
    stroke: #008800;
    stroke-width: 1mm;
    stroke-linecap: round;
}
.simulator .wire:hover {
    stroke-width: 1.5mm;
}
.simulator .wire.selected {
    stroke: #009900;
    stroke-width: 1.5mm;
}
.simulator.adding-wire .wire {
    /* ignore clicks on other wires (they only get in the way) */
    pointer-events: none;
}
.simulator.compiling .wire {
    pointer-events: none;
}

/* Tooltip for pin names */
.simulator .schematic-tooltip {
    position: absolute;
    border: 1px solid var(--vscode-editorHoverWidget-border, #454545);
    padding: 2px 8px;
    font-size: 12px;
    color: var(--vscode-editorHoverWidget-foreground, #cccccc);
    background: var(--vscode-editorHoverWidget-background, #252526);
    box-shadow: 0 2px 8px var(--vscode-widget-shadow, rgb(0 0 0 / 36%));
    pointer-events: none;
}
.simulator .schematic-tooltip:not(.visible) {
    opacity: 0;
}
.simulator .schematic-tooltip:after {
    content: "";
    position: absolute;
    display: block;
    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    border: solid var(--vscode-editorHoverWidget-border, #454545);
    border-width: 0px 1px 1px 0px;
    background: var(--vscode-editorHoverWidget-background, #252526);
}

/* Terminal at the bottom of the screen */

.simulator .terminal {
    width: 100%;
    line-height: calc(var(--vscode-editor-font-size, 13px) + 5px);
    font-size: var(--vscode-editor-font-size, 13px);
    resize: none;
    padding: 0 20px;
    border: 0;
    background: transparent;
    font-family: var(--vscode-editor-font-family, monospace);
}
.simulator .terminal::selection {
    background: var(--vscode-terminal-selectionBackground, rgba(255, 255, 255, 0.3));
}
.simulator .terminal.error {
    color: var(--vscode-terminal-ansiBrightRed, #f55);
}

/* Properties tab at the bottom */

.simulator .panel-properties > .content {
    padding: 0 20px;
    overflow: auto;
    display: grid;
    grid-template-columns: auto minmax(auto, 100%);
    column-gap: 1ch;
    align-content: start;
    line-height: 1.5;
    height: inherit;
}

.simulator .panel-properties .ledstrip {
    display: flex;
}
.simulator .panel-properties .ledstrip-channel {
    text-align: right;
    width: 4ch;
    /* line under the number that graphically indicates the percent the channel is on */
    background-position: bottom right;
    background-size: 4ch 2px;
    background-repeat: repeat-x;
}

/* Add parts tab */

.simulator .panel-add {
    padding: 0 20px;
    display: grid;
    grid-template-columns: auto minmax(auto, 100%) auto auto;
    column-gap: 1ch;
    align-content: start;
}

.simulator.adding-part .panel-add {
    opacity: 0.5;
    pointer-events: none;
}

.simulator .panel-add .part-image {
    filter: drop-shadow(0 0 6px #777c);
    border: 0;
    width: 10mm;
    height: 10mm;
}
