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

body {
    font-family: 'Computer Modern Serif', 'Latin Modern Roman', 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.5;
}

#container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    border-top: 4px solid #000000;
    border-bottom: 2px solid #000000;
    padding: 30px 0;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    font-weight: normal;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.7;
}

#main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
}

#editor-section,
#output-section {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    font-family: 'Computer Modern Sans', 'Latin Modern Sans', 'Helvetica', 'Arial', sans-serif;
}

#toolbar label {
    font-weight: normal;
    font-size: 14px;
}

#args-display {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #cccccc;
    margin-bottom: 10px;
}

#args-display label {
    font-weight: normal;
    font-size: 14px;
    white-space: nowrap;
}

#args-display-value {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #cccccc;
    background: #f5f5f5;
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', 'Menlo', 'Ubuntu Mono', 'Roboto Mono', monospace;
    color: #000000;
    cursor: default;
}

#args-display-value:focus {
    outline: none;
}

#examples {
    padding: 6px 12px;
    border: 1px solid #000000;
    background: #ffffff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

#examples:hover {
    background: #000000;
    color: #ffffff;
}

.btn {
    padding: 6px 16px;
    border: 1px solid #000000;
    background: #ffffff;
    font-size: 14px;
    font-family: inherit;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #999999;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #ffffff;
    color: #000000;
}

.btn-success {
    background: #ffffff;
    color: #000000;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

#code-editor {
    flex: 1;
    font-family: 'SF Mono', 'Consolas', 'Menlo', 'Ubuntu Mono', 'Roboto Mono', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #000000;
    resize: none;
    line-height: 1.4;
    background: #ffffff;
}

#code-editor:focus {
    outline: none;
    border-width: 3px;
    padding: 11px;
}

#tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #000000;
}

.tab {
    padding: 8px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: normal;
    font-family: 'Computer Modern Sans', 'Latin Modern Sans', 'Helvetica', 'Arial', sans-serif;
    color: #666666;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab:hover {
    color: #000000;
    border-bottom-color: #cccccc;
}

.tab.active {
    color: #000000;
    border-bottom-color: #000000;
    border-bottom-width: 3px;
    font-weight: normal;
}

.output-pane {
    display: none;
    flex: 1;
    font-family: 'SF Mono', 'Consolas', 'Menlo', 'Ubuntu Mono', 'Roboto Mono', monospace;
    font-size: 13px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #000000;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-pane.active {
    display: block;
}

.output-pane:empty::before {
    content: 'Output will appear here...';
    color: #999999;
}

#error-output {
    color: #000000;
}

footer {
    text-align: center;
    padding: 30px 20px 20px 20px;
    margin-top: 40px;
    border-top: 1px solid #000000;
    color: #666666;
    font-size: 13px;
}

footer p {
    margin: 8px 0;
}

footer a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid #000000;
}

footer a:hover {
    color: #666666;
    border-bottom-color: #666666;
}

/* Toolbar separators */
.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #cccccc;
    margin: 0 4px;
}

/* Modal dialogs */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom: 1px solid #000000;
    padding-bottom: 10px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

.modal-content input[type="text"],
#args-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #000000;
    font-family: 'SF Mono', 'Consolas', 'Menlo', 'Ubuntu Mono', 'Roboto Mono', monospace;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-content input[type="text"]:focus,
#args-input:focus {
    outline: none;
    border-width: 2px;
    padding: 7px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

#programs-list, #files-list {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.program-item, .file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #000000;
    margin-bottom: 8px;
}

.program-item:hover, .file-item:hover {
    background: #f5f5f5;
}

.program-name, .file-name {
    font-family: 'SF Mono', 'Consolas', 'Menlo', 'Ubuntu Mono', 'Roboto Mono', monospace;
    font-weight: bold;
}

.program-actions, .file-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* File tabs */
.file-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #000000;
}

.file-tab {
    padding: 8px 16px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: normal;
    font-family: 'Computer Modern Sans', 'Latin Modern Sans', 'Helvetica', 'Arial', sans-serif;
    color: #666666;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.file-tab:hover {
    color: #000000;
    border-bottom-color: #cccccc;
}

.file-tab.active {
    color: #000000;
    border-bottom-color: #000000;
    border-bottom-width: 3px;
}

.file-pane {
    display: none;
}

.file-pane.active {
    display: block;
}

.file-pane-header {
    border-bottom: 1px solid #cccccc;
}

.save-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.save-input-group input {
    flex: 1;
    margin-bottom: 0;
}

.file-pane-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #cccccc;
    display: flex;
    gap: 10px;
}

/* Responsive design */
@media (max-width: 1024px) {
    #main-content {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 640px) {
    #container {
        padding: 20px 10px;
    }

    header {
        padding: 20px 0;
    }

    header h1 {
        font-size: 1.8em;
    }

    #toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #examples,
    .btn {
        width: 100%;
    }
}
