:root {
    --bg-color: #1e1e1e;
    --text-color: #f8f8f8;
    --header-bg: #252526;
    --editor-bg: #1e1e1e;
    --editor-header-bg: #252526;
    --editor-header-text: #569cd6;
    --border-color: #474747;
    --console-bg: #1e1e1e;
    --console-text: #cccccc;
    --button-bg: #0e639c;
    --button-hover: #1177bb;
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --text-color: #333333;
    --header-bg: #e0e0e0;
    --editor-bg: #ffffff;
    --editor-header-bg: #e0e0e0;
    --editor-header-text: #0078d7;
    --border-color: #d1d1d1;
    --console-bg: #ffffff;
    --console-text: #333333;
    --button-bg: #0078d7;
    --button-hover: #0066bb;
}

* {
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: var(--header-bg);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

button,
select {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: var(--button-bg);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

button:hover {
    background: var(--button-hover);
}

select {
    background: var(--editor-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 5px;
}

.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.left,
.right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.left {
    width: 50%;
    min-width: 300px;
    overflow: hidden;
}

.right {
    flex: 1;
    min-width: 300px;
    overflow: hidden;
}

.editor-wrapper {
    display: flex;
    flex-direction: column;
    height: 33.33%;
    border-bottom: 1px solid var(--border-color);
}

.editor-header {
    padding: 5px 10px;
    background: var(--editor-header-bg);
    color: var(--editor-header-text);
    font-weight: bold;
    display: flex;
    align-items: center;
}

.CodeMirror {
    height: 100% !important;
    font-size: 14px;
    background: var(--editor-bg);
    color: var(--text-color);
}

.output-header,
.console-header {
    padding: 5px 10px;
    background: var(--editor-header-bg);
    color: var(--editor-header-text);
    font-weight: bold;
    display: flex;
    align-items: center;
}

iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

#console {
    height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: var(--console-bg);
    color: var(--console-text);
    font-family: monospace;
    border-top: 1px solid var(--border-color);
    white-space: pre-wrap;
}

.resizer {
    width: 10px;
    background: var(--border-color);
    cursor: col-resize;
    transition: background 0.2s;
}

.resizer:hover {
    background: var(--button-bg);
}

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }

    .left,
    .right {
        width: 100%;
        min-width: auto;
    }

    .resizer {
        width: 100%;
        height: 10px;
        cursor: row-resize;
    }
}