/* CSS Variables for theme support */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-card: #333;
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --border-color: #333;
    --accent: #00cc00;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: monospace;
    overflow: hidden;
}

#canvasContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

#container {
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

#editor-container {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30%; 
    border-left: 1px solid var(--border-color);
    min-width: 200px; 
    max-width: calc(100% - 50px);
    box-sizing: border-box;
    pointer-events: auto;
    z-index: 3;
}

#button-panel {
    position: absolute;
    left: -83px;
    top: 10px;
    z-index: 4;

}

.layer-button {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 16px;
    display: block;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

#info-modal {
    display: none;
    position: fixed;
    top: 50px;
    left: 40%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 800px;
    height: calc(100vh - 100px); 
    background-color: rgba(0, 0, 0, 0.9); 
    border: 2px solid #C0C0C0;
    border-radius: 0; 
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
    overflow-y: auto;  
    z-index: 9999;
    color: #C0C0C0;  
    font-family: monospace;
    padding: 20px;
}

#modal-close {
    position: absolute; 
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #C0C0C0;  
    z-index: 10000;
    transition: color 0.3s, transform 0.3s;
}

#modal-close:hover {
    color: #808080;  
    transform: scale(1.1);
}

.feature {
    font-weight: bold;
    margin-top: 10px;
    color: #C0C0C0;  
}
.description {
    margin-left: 20px;
    margin-bottom: 10px;
    color: #A0A0A0;  
}

.CodeMirror {
    height: 100%;
    font-size: 1em;
    overflow: hidden;
    background: var(--bg-primary);
}

.CodeMirror-lines {
    background-color: var(--bg-primary) !important;
}

.CodeMirror-cursor {
    border-left: 1px solid var(--text-secondary) !important;
}

.CodeMirror pre, .CodeMirror span {
    color: var(--text-secondary) !important;
}

.CodeMirror-scroll {
    overflow-y: hidden;
}

.CodeMirror-vscrollbar {
    display: none;
}

.CodeMirror-code pre {
    white-space: nowrap;
}


.CodeMirror-code > div:nth-child(odd) {
    background-color: var(--bg-primary) !important;
}

.CodeMirror-code > div:nth-child(even) {
    background-color: var(--bg-secondary) !important;
}

.CodeMirror-gutters {
    background: var(--bg-card) !important;
    border-right: none;
}

.CodeMirror-linenumber {
    padding: 0 5px;
    color: var(--accent) !important;
}


.CodeMirror-selected {
    background-color: rgba(49, 77, 121, 0.5) !important;
}

#custom-scrollbar {
    position: absolute;
    left: -30px;
    top: 0;
    height: 100%;
    width: 30px;
    background: var(--bg-secondary);
    z-index: 1;
}

#scroll-thumb {
    position: absolute;
    width: 100%;
    height: 30px;
    background: #666;
    border-radius: 5px;
    cursor: pointer;
}

#resize-handle {
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
}

#highlight-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 15px;
    background-color: var(--accent);
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
}

#render-limit-container {
    position: absolute;
    left: -45px;
    z-index: 4;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#render-limit {
    width: 20px;
    transform: rotate(180deg);
    height: 200px;
}

#render-limit-display {
    background-color: rgba(0, 0, 0, 0.5);
    color: silver;
    border: 1px solid silver;
    border-radius: 5px;
    font-size: 14px;
    padding: 2px 5px;
    width: auto;
    -moz-appearance: textfield;
    width: 75px; 
    margin-top: 5px;
}

#speed-slider-container {
    position: absolute;
    left: 487px;
    top: 0;
    height: 200px;
    z-index: 4;
}

#speed-slider {
    writing-mode: bt-lr;
    writing-mode: vertical-lr; 
    height: 200px;
    width: 20px;
}

#horizontal-controls {
    position: absolute;
    display: flex;
    flex-direction: row-reverse;
    left: -530px;
    gap: 10px;
    align-items: center;
}

 #buildPlateX {
    width: 50px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: silver;
    font-size: 14px;
    padding: 0 8px;
    border-radius: 5px;
    border: 1px solid silver;
}

 #buildPlateY {
    width: 50px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: silver;
    font-size: 14px;
    padding: 0 8px;
    border-radius: 5px;
    border: 1px solid silver;
}

#searchInput {
    width: 150px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: silver;
    font-size: 14px;
    padding: 0 8px;
    border-radius: 5px;
    border: 1px solid silver;
}

#nextResult, #prevResult {
    width: 40px;
    padding: 10px;
    margin: 0;
}

#nextResult, #prevResult {
    display: flex;
    justify-content: center;
    align-items: center;
}

#info-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 400px;
    background: rgba(0, 0, 0, 0);
    color: #fff;
    border-radius: 5px;
    font-family: monospace;
    z-index: 100;
}

.info-section {
    padding: 10px;
    border-bottom: 1px solid #333;
}

.info-section:last-child {
    border-bottom: none;
}

.current-line {
    color: #b5e853;
    word-wrap: break-word;
    font-size: 14px;
}

.command-info {
    font-size: 12px;
    height: 60px;
    color: #ddd;
}

.command-info .name {
    color: #66d9ef;
    margin: 5px 0;
}

.command-info .description {
    color: #e6db74;
    font-style: italic;
}

.state-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 10px;
    font-size: 12px;
}

.state-info .label {
.state-info .label {
    color: #66d9ef;
    text-align: right;
}

.state-info .value {
    color: #b5e853;
}