* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0d1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

header {
    padding: 12px 0;
    border-bottom: 1px solid #30363d;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #58a6ff, #1f6feb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #8b949e;
    font-size: 14px;
}

.lang-btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: #30363d;
    border-color: #58a6ff;
}

.main {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 16px 0;
    min-height: 0;
}

.editor-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    background: #161b22;
    border-radius: 8px;
    border: 1px solid #30363d;
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
    flex-wrap: wrap;
}

.toolbar button {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.toolbar button:hover {
    background: #30363d;
    border-color: #58a6ff;
}

#runBtn {
    background: #238636;
    border-color: #2ea043;
    font-weight: 600;
}

#runBtn:hover {
    background: #2ea043;
}

.examples-label {
    color: #8b949e;
    font-size: 13px;
    margin-left: 12px;
}

.examples {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.example-btn {
    background: #1c2333;
    border: 1px solid #30363d;
    color: #58a6ff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover {
    background: #2d3a50;
    border-color: #58a6ff;
}

#codeInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 15px;
    padding: 16px;
    resize: none;
    outline: none;
    line-height: 1.7;
    tab-size: 4;
}

.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #161b22;
    border-radius: 8px;
    border: 1px solid #30363d;
    overflow: hidden;
    min-width: 300px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
    font-size: 13px;
    color: #8b949e;
}

#clearOutputBtn {
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 16px;
}

#clearOutputBtn:hover {
    color: #f85149;
}

#terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    overflow-y: auto;
    background: transparent;
    position: relative;
}

#output {
    flex: 1;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e6edf3;
    min-height: 50px;
}

#output .prompt {
    color: #58a6ff;
}

#output .error {
    color: #f85149;
}

#input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #30363d;
}

#input-line .prompt {
    color: #58a6ff;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e6edf3;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    outline: none;
    padding: 4px 0;
}

footer {
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid #30363d;
    font-size: 13px;
    color: #8b949e;
}

footer a {
    color: #58a6ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

@media (max-width: 800px) {
    .main {
        flex-direction: column;
    }
    .output-section {
        min-height: 200px;
        flex: 1;
    }
    .editor-section {
        flex: 2;
    }
}