.code-editor-container {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #282a36;
    border-bottom: 1px solid #44475a;
}

.code-editor-title {
    font-weight: 600;
    color: #f8f8f2;
    font-size: 0.875rem;
}

.code-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.code-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.code-btn-primary {
    background: #6272a4;
    color: white;
}

.code-btn-primary:hover {
    background: #bd93f9;
}

.code-editor-wrapper {
    position: relative;
}

.code-editor-wrapper .CodeMirror {
    height: auto;
    min-height: 100px;
    max-height: 600px;
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    overflow-y: auto;
}

.code-editor-wrapper .CodeMirror-scroll {
    overflow-y: auto;
    min-height: 100px;
    max-height: 600px;
}

.code-editor-wrapper .CodeMirror-gutters {
    background: #282a36 !important;
}

.preview-container {
    border-top: 1px solid var(--border);
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.preview-tabs {
    display: flex;
    gap: 0.5rem;
}

.preview-tab {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.preview-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.preview-iframe {
    width: 100%;
    height: 350px;
    border: none;
    background: white;
    position: relative;
    z-index: 1;
}

.preview-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: #fff5f5;
    color: #c53030;
    font-size: 0.875rem;
    display: none;
    z-index: 10;
    border-bottom: 1px solid #feb2b2;
}

.preview-error.show {
    display: block;
}
