:root {
    --top-bar-height: 48px;
    --info-panel-width: 370px;
    --info-panel-margin: 12px;
    --info-panel-padding: 12px;
    --console-height: 330px;
    --rounded-corners: 5px;
}

body[data-theme="light"] {
    --bg: rgb(239, 241, 245);
    --fg: rgb(76, 79, 105);
    --top-bar-bg: rgb(220, 224, 232);
    --top-bar-fg: rgb(76, 79, 105);
    --bottom-bar-bg: rgb(220, 224, 232);
    --bottom-bar-fg: rgb(76, 79, 105);
    --panel-bg: rgb(204, 208, 218);
    --border: rgb(220, 224, 232);
    --editor-bg: rgb(239, 241, 245);
    --console-bg: rgb(188, 192, 204);
    --run-button: rgb(4, 165, 229);
    --run-button-hover: rgb(30, 102, 245);
    --button: rgb(239, 241, 245);
    --button-hover: rgb(230, 233, 239);
    --button-disabled: rgb(204, 208, 218);
    --button-disabled-text: rgb(156, 160, 176);
    --memory-loc-hover: rgb(172, 176, 190);
    --show-pc-loc: rgb(221, 120, 120);
    --show-pc-loc-hover: rgb(220, 138, 120);
    --bit-enabled-bg: rgb(221, 120, 120);
    --shadow: rgb(204, 208, 218);
    --exit-button: rgb(221, 120, 120);
    --exit-button-hover: rgb(220, 138, 120););
}

body[data-theme="dark"] {
    --bg: rgb(36, 39, 58);
    --fg: rgb(202, 211, 245);
    --top-bar-bg: rgb(41, 44, 60);
    --top-bar-fg: rgb(202, 211, 245);
    --bottom-bar-bg: rgb(35, 38, 52);
    --bottom-bar-fg: rgb(198, 208, 245);
    --panel-bg: rgb(48, 52, 70);
    --border: rgb(65, 69, 89);
    --editor-bg: rgb(41, 44, 60);
    --console-bg: rgb(54, 58, 79);
    --run-button: rgb(73, 77, 100);
    --run-button-hover: rgb(54, 58, 79);
    --button: rgb(91, 96, 120);
    --button-hover: rgb(54, 58, 79);
    --button-disabled: rgb(128, 135, 162);
    --button-disabled-text: rgb(91, 96, 120);
    --memory-loc-hover: rgb(24, 25, 38);
    --show-pc-loc: rgb(237, 135, 150);
    --show-pc-loc-hover: rgb(238, 153, 160);
    --bit-enabled-bg: rgb(237, 135, 150);
    --modal-background:
    --shadow: rgb(30, 32, 48);
    --exit-button: rgb(237, 135, 150);
    --exit-button-hover: rgb(238, 153, 160);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: var(--fg);
    transition:
        color 0.2s,
        background-color 0.2s,
        box-shadow 0.2s;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar,
.bottom-bar {
    height: var(--top-bar-height);
    background: var(--top-bar-bg);
    color: var(--top-bar-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-left: 18px;
    padding-right: 18px;
}

#logo {
    height: calc(var(--top-bar-height) - 18px);
    padding-right: 12px;
}

.top-bar-right {
    display: flex;
    margin-left: auto;
    align-items: center;
    gap: 12px;
}

.top-link {
    color: var(--panel-bg);
}

.top-link:hover {
    color: green;
}

.theme-select {
    background: var(--panel-bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    padding: 4px 8px;
    float: right;
    min-width: 80px;
}

.theme-select:hover {
    background-color: var(--console-bg);
}

.bottom-bar {
    background-color: var(--bottom-bar-bg);
    color: var(--bottom-bar-fg);
    height: 30px;
    border-top: 1px solid var(--border);
}

.ide {
    flex: 1;
    display: flex;
    overflow: hidden;
    background-color: var(--bg);
}

.editor {
    flex: 1;
    resize: none;
    outline: none;
    padding: 12px;
    margin: 12px;
    margin-right: 6px;
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    font-family: monospace;
    font-size: 14px;
    background-color: var(--editor-bg);
    overflow-x: scroll;
    white-space: nowrap;
}

.panel-item {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    outline: none;
    margin-top: 12px;
}

.panel-buttons {
    border: none;
}

.registers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /*padding-top: 12px;
    padding-bottom: 12px;*/
    font-family: monospace;
    font-size: 11pt;
    /*padding-left: 8px;*/
}

.reg-listing {
    display: flex;
    align-items: center;
    text-align: center;
    /*margin: 3px;*/
    border: 1px solid var(--border);
    /*margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 12px;*/
}

.reg-label {
    border-right: 1px solid var(--border);
    padding-left: 3px;
    padding-right: 3px;
    background-color: var(--console-bg);
}

.reg-info {
    align-items: center;
    text-align: center;
    padding-left: 19px; /* Because the text wont actually align? */
}

.nzp-info {
    align-items: center;
    text-align: center;
    padding-left: 7px;
    padding-right: 7px;
    border-right: 1px solid var(--border);
}

.bit-enabled {
    background-color: var(--bit-enabled-bg);
    color: var(--bg);
}

#haltValue {
    text-align: center;
    align-items: center;
    padding-left: 1px;
    width: 67px;
    border-bottom-right-radius: var(--rounded-corners);
}

.memory-table {
    display: flex;
    flex-direction: column;
    /*height: 50%;*/
    font-family: monospace;
    font-size: 13px;
}

.memory-header {
    display: grid;
    grid-template-columns: 8ch 8ch 8ch 12ch 8ch;
    background: var(--console-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
    border-top-left-radius: var(--rounded-corners);
    border-top-right-radius: var(--rounded-corners);
}

.memory-header > div {
    padding: 4px 6px;
    font-weight: bold;
}

.memory-body {
    flex: 1;
    overflow-y: auto;
}

.memory-row {
    display: grid;
    grid-template-columns: 8ch 8ch 8ch 12ch 8ch;
    border-bottom: 1px solid var(--border);
}

.memory-row > div {
    padding: 0px 6px 0px 6px;
    white-space: nowrap;
    border-left: 1px solid var(--border);
}

.memory-row:hover {
    background: var(--memory-loc-hover);
}

.memory-body {
    position: relative;
    height: 100%;
    overflow-y: auto;
    font-family: monospace;
}

.scroll-spacer {
    height: calc(65536 * 20px); /* TOTAL_ROWS * ROW_HEIGHT */
}

.row-viewport {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    will-change: transform;
}

.memory-row {
    height: 20px;
    line-height: 20px;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    transition:
        color 0s,
        background-color 0s;
}

.mem-pc-loc {
    background-color: var(--show-pc-loc);
}

.mem-pc-loc > div {
    color: var(--bg);
}

.mem-pc-loc:hover {
    background-color: var(--show-pc-loc-hover);
}

#inputStream:disabled {
    border-color: var(--border);
    cursor: default;
}

/*.console {
    min-height: 0;
    color: var(--fg);
}*/

.console {
    flex: 1;
    outline: none;
    /*position: absolute;*/
    resize: none;
    border: none;
    width: calc(var(--info-panel-width) - var(--info-panel-margin) * 2);
    min-height: 0;
    border-radius: var(--rounded-corners);
    background-color: var(--console-bg);
    padding: 5px;
    z-index: 0;
    color: var(--fg);
    margin-bottom: var(--info-panel-margin);
}

.invisible {
    /*color: red;
    background: transparent2px solid;
    z-index: 1;*/
    visibility: hidden;
}

.info-panel {
    width: var(--info-panel-width);
    background: var(--panel-bg);
    padding-left: var(--info-panel-padding);
    padding-right: var(--info-panel-padding);
    margin: var(--info-panel-margin);
    margin-left: 6px;
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    display: grid;
    grid-template-rows: auto auto auto 3fr auto 2fr;
}

.memory-table,
.console,
.innerConsole {
    min-height: 0;
    overflow: auto;
}

.button {
    min-width: 50px;
    height: 27px;
    border-color: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    background-color: var(--button);
    transition: 0.1s;
    color: var(--fg);
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    align-items: center;
    font-size: 10pt;
}

.button:hover {
    background-color: var(--button-hover);
}

.button:disabled {
    background-color: var(--button-disabled);
    color: var(--button-disabled-text);
    cursor: not-allowed;
    border-color: var(--fg);
}

.run-button {
    background-color: var(--run-button);
    border-color: var(--run-button);
}

.run-button:hover {
    background-color: var(--run-button-hover);
    border-color: var(--button-hover);
}

.run-button:disabled {
    background-color: var(--button-disabled);
    color: var(--button-disabled-text);
}

.run-button:disabled:hover {
    border-color: var(--fg);
}

.context-menu-button {
    max-width: 30px;
    min-width: 30px;
    align-items: left;
}

.stream:disabled {
    resize: none;
    width: 142px;
    outline: none;
    margin: none;
    background-color: var(--console-bg);
    color: var(--fg);
    overflow-x: scroll;
}

.icon {
    max-height: 16px;
    max-width: 14px;
    color: var(--fg);
    text-align: center;
}

.modal {
    /*display: ;*/
    position: absolute;
    float: bottom;
    /*visibility: hidden;*/
    z-index: 1;
    border: 1px solid var(--border);
    border-radius: var(--rounded-corners);
    /*padding: 12px;*/
    background-color: var(--bg);
    margin-left: 50vw;
    margin-top: 50vh;
    box-shadow: 5px 5px 5px var(--shadow);
    /*overflow-y: scroll;*/
    min-height: 30vh;
    min-width: 300px;
    visibility: hidden;
}

.modal#asmErrorModal {
    display: grid;
    grid-template-rows: auto auto;
}

.modal#asmErrorModal > #asmModalBar {
    border: 1px solid var(--border);
    border-top-left-radius: var(--rounded-corners);
    border-top-right-radius: var(--rounded-corners);
    /*padding-left: 100px;
    padding-right: 100px;*/
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px;
    height: fit-content;
    background-color: var(--top-bar-bg);
}

#asmModalBar > #errorQuantity {
    float: left;
}

#errorCloseButton {
    margin-left: auto;
    height: 13px;
    width: 13px;
    border-radius: 100%;
    border: 1px solid var(--exit-button);
    background-color: var(--exit-button);
    transition: background-color 0.05s, border-color 0.05s;
    margin-right: 3px;
}

#errorCloseButton:hover {
    background-color: var(--exit-button-hover);
    border-color: var(--exit-button-hover);
}

/*
Source - https://stackoverflow.com/a/4407335
Posted by Blowsie, modified by community. See post 'Timeline' for change history
Retrieved 2026-01-29, License - CC BY-SA 4.0
*/

.no-select {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

/*
    For note on how I did syntax highlighting in the
    previous version, I have left the HTML and CSS commented out
    until I reimplement it.
*/ /*
body {
    background-color: #2a2e2c;
    color:antiquewhite;
}

div#buttons {
    display: flex;
    width: 300px;
    height: 25px;
    margin: 30px;
    text-align: center;
    position: absolute;
    border-radius: 12px;
}

div > button#run-button {
    background-color: #50EBB7;
    border: #50EBB7;
    border-radius: 3px;
    width: 60px;
    margin-left: 3px;
}

div > button#debug-button {
    background-color: tomato;
    border: tomato;
    border-radius: 3px;
    width: 60px;
    margin-left: 3px;
}

#editing, #highlighting {
    /* Both elements need the same text and space styling so they are directly on top of each other */ /*
    margin: 30px;
    padding: 15px;
    border: 0;
    width: calc(100% - 32px);
    height: calc(100 - 32px);
    border: black solid 3px;
    margin-top: 90px;
}

#editing, #highlighting, #highlighting * {
    /* Also add text styles to highlighting tokens */ /*
    font-size: 13pt;
    font-family: monospace;
    line-height: 20pt;
}

textarea#editing, pre#highlighting {
    position: absolute;
    top: 0;
    left: 0;
    height: 90%;
    width: 80%;
}

textarea#editing {
    z-index: 1;
    color: transparent;
    background: transparent;
    caret-color: white;
    resize: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: scroll;
}

#highlighting {
    z-index: 0;
}

#highlighted-content {
    color: #ebe1ca;
}

code > span#highlight-instruction {
    color: #EBC054;
}

code > span#highlight-directive {
    color: #cf54eb;
}

code > span#highlight-register {
    color: #50EBB7;
}

code > span#highlight-comment {
    color: #909996;
}

code > span#highlight-string {
    color: #c2b07e;
}*/
