:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --bg-color: #f5f5f5;
    --text-color: #212529;
    --border-color: #dee2e6;
    --editor-bg: #ffffff;
    --editor-text: #212529;
    --error-color: #dc3545;
}

.dark-theme {
    --bg-color: #1e1e1e;
    --text-color: #f8f9fa;
    --border-color: #495057;
    --editor-bg: #2d2d2d;
    --editor-text: #f8f9fa;
    --primary-color: #5d7bff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--dark-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: bold;
}

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn.primary {
    background-color: var(--primary-color);
}

.btn.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--editor-bg);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    z-index: 1000;
    display: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.tabs {
    display: flex;
    background-color: var(--dark-color);
    padding: 0 1rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    background-color: var(--editor-bg);
    color: var(--text-color);
    border-radius: 4px 4px 0 0;
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.panels {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.panel {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
}

.panel.active {
    display: flex;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--editor-bg);
    border-bottom: 1px solid var(--border-color);
    min-height: 40px;
}

.editor-header span {
    font-weight: 500;
    font-size: 0.9rem;
}

.error-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.error-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--error-color);
    cursor: pointer;
    font-size: 0.85rem;
}

.error-list {
    position: absolute;
    background-color: var(--editor-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 1.5rem;
    right: 0;
    min-width: 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.error-item {
    padding: 0.25rem 0;
    color: var(--error-color);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.error-item:last-child {
    border-bottom: none;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.CodeMirror-linenumber {
    padding: 0 0.5rem 0 0.25rem !important;
}

.output-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.code-viewer, .preview-container {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    background-color: var(--editor-bg);
    height: 100%;
}

.code-viewer {
    border-right: 1px solid var(--border-color);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--editor-text);
}

.preview-container {
    display: flex;
    padding: 0;
}

iframe {
    flex: 1;
    border: none;
    background-color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--editor-bg);
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1rem;
}

.setting-group {
    margin-bottom: 1rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-group input[type="text"],
.setting-group input[type="range"],
.setting-group select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--editor-bg);
    color: var(--editor-text);
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}