:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --toolbar-bg: #f5f5f5;
    --border-color: #e0e0e0;
    --button-bg: #ffffff;
    --button-hover: #f0f0f0;
    --output-bg: #f8f8f8;
    --output-text: #333333;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #1e1e1e;
    --text-color: #ffffff;
    --toolbar-bg: #2d2d2d;
    --border-color: #404040;
    --button-bg: #2d2d2d;
    --button-hover: #404040;
    --output-bg: #2d2d2d;
    --output-text: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#editor-container {
    flex: 1;
    border: 1px solid #ccc;
}

.toolbar {
    display: flex;
    padding: 8px;
    background-color: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    gap: 16px;
    transition: background-color 0.3s, border-color 0.3s;
}

.output-container {
    height: 200px;
    overflow: auto;
    padding: 10px;
    background-color: #f8f8f8;
    border-top: 1px solid #ccc;
}

#output {
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 18px;
}

button {
    padding: 6px 12px;
    background-color: var(--button-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--button-hover);
}

button i {
    font-size: 14px;
}

button.running {
    background-color: #2196F3;
    color: white;
}

button.running i {
    animation: spin 1s linear infinite;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#share-button {
    background-color: #9c27b0;
    color: white;
}

#share-button:hover {
    background-color: #7b1fa2;
}

#share-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.shortcut {
    margin-left: 8px;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 12px;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-size-control label {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 14px;
}

.font-size-control select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--button-bg);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-control select:hover {
    border-color: var(--button-hover);
}

.font-size-control select:focus {
    outline: none;
    border-color: #4CAF50;
}

.save-status, .run-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 14px;
}

.save-status i, .run-status i {
    font-size: 16px;
}

.save-status.saving {
    color: #2196F3;
    opacity: 1;
}

.save-status.saving i {
    animation: spin 1s linear infinite;
}

.save-status.error {
    color: #f44336;
    opacity: 1;
}

.run-status.running {
    color: #2196F3;
    opacity: 1;
}

.run-status.running i {
    animation: spin 1s linear infinite;
}

.run-status.error {
    color: #f44336;
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notification styles */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.toast.show {
    opacity: 1;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--button-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--button-hover);
}

.theme-toggle i {
    font-size: 16px;
}

[data-theme="dark"] .theme-toggle i {
    color: #ffd700;
}

.output-container {
    background-color: var(--output-bg);
    border-top: 1px solid var(--border-color);
    padding: 16px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

#output {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    color: var(--output-text);
    margin: 0;
    transition: color 0.3s;
}