* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    font-family: "Fira Code", "Courier New", monospace;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    color: #ccc;
}

.header {
    background: #252526;
    color: #eee;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
}

.header button {
    background: #007acc;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.container {
    display: flex;
    flex: 1 1 0%;
    min-height: 0;
    min-width: 0;
    height: calc(100vh - 90px);
    /* header+tabs */
    width: 100vw;
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #232323;
    border-bottom: 1px solid #333;
}

.tabs .tab {
    background: none;
    border: none;
    color: #ccc;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 15px;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border 0.2s, color 0.2s;
}

.tabs .tab.active {
    color: #fff;
    border-bottom: 2px solid #007acc;
    font-weight: bold;
}

.editor-area {
    flex-basis: 50%;
    height: 100%;
    flex-shrink: 0;
    width: auto;
    display: block;
}

#editor {
    flex-basis: 50%;
    height: 100%;
    flex-shrink: 0;
    width: auto;
}

#output {
    flex-basis: 50%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    width: 100% !important;
    background: #1e1e1e;
    padding: 12px;
    overflow-y: auto;
    color: #dcdcaa;
    border-left: 1px solid #333;
    font-family: "Fira Code", monospace;
    font-size: 14px;
    white-space: pre-wrap;
    box-sizing: border-box;
}

.CodeMirror {
    height: 100%;
    width: 100% !important;
    font-size: 14px;
    background: #1e1e1e;
    color: #d4d4d4;
    min-width: 0;
    min-height: 0;
    height: 100%;
    width: 100% !important;
    box-sizing: border-box;
}

/* Warna background dan font untuk masing-masing editor */
#editor-html+.CodeMirror {
    background: #1e2233 !important;
    color: #4ec9b0 !important;
}

#editor-js+.CodeMirror {
    background: #1e1e1e !important;
    color: #b5cea8 !important;
}

#editor-css+.CodeMirror {
    background: #23211f !important;
    color: #d7ba7d !important;
}

.resizer {
    width: 6px;
    cursor: col-resize;
    background-color: #444;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    .editor-area,
    .CodeMirror,
    #output {
        width: 100% !important;
        height: 50vh;
        min-height: 0;
    }

    #output {
        border-left: none;
        border-top: 1px solid #333;
    }

    .resizer {
        height: 6px;
        width: 100%;
        cursor: row-resize;
    }
}

@media (max-width: 500px) {
    .container {
        height: auto;
    }

    .editor-area,
    .CodeMirror,
    #output {
        font-size: 12px;
        height: 40vh;
    }
}