/* DWScript Playground Styles */

:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #dddddd;
    --accent-blue: #0066cc;
    --accent-blue-hover: #0052a3;
    --accent-green: #28a745;
    --accent-red: #dc3545;
    --shadow: rgba(0, 0, 0, 0.1);
    --editor-bg: #ffffff;
    --output-bg: #1e1e1e;
    --output-text: #d4d4d4;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --text-primary: #cccccc;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border-color: #3e3e42;
    --accent-blue: #0e639c;
    --accent-blue-hover: #1177bb;
    --accent-green: #4ec9b0;
    --accent-red: #f48771;
    --shadow: rgba(0, 0, 0, 0.4);
    --editor-bg: #1e1e1e;
    --output-bg: #1e1e1e;
    --output-text: #d4d4d4;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.version {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.github-link {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.github-link:hover {
    background: var(--bg-tertiary);
}

/* Toolbar */
.toolbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Select */
.select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Status Bar */
.status-bar {
    background: var(--accent-blue);
    color: white;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    flex-shrink: 0;
}

.status-bar.ready {
    background: var(--accent-green);
}

.status-bar.error {
    background: var(--accent-red);
}

.status-bar.loading {
    background: var(--accent-blue);
}

/* Main Container */
.container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Panels */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-editor {
    flex: 1;
    min-width: 300px;
}

.panel-output {
    flex: 1;
    min-width: 300px;
}

.panel-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.panel-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.panel-info {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Editor Container */
.editor-container {
    flex: 1;
    overflow: hidden;
}

/* Output Container */
.output-container {
    flex: 1;
    overflow-y: auto;
    background: var(--output-bg);
    color: var(--output-text);
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    padding: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.output-container:empty::before {
    content: '// Output will appear here...';
    color: var(--text-muted);
    font-style: italic;
}

/* Output line types */
.output-line {
    margin-bottom: 4px;
}

.output-error {
    color: #f48771;
    font-weight: 500;
}

.output-warning {
    color: #dcdcaa;
}

.output-info {
    color: #4ec9b0;
}

.output-success {
    color: #4ec9b0;
}

/* Resizer */
.resizer {
    width: 4px;
    background: var(--border-color);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s;
}

.resizer:hover,
.resizer.active {
    background: var(--accent-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .resizer {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .btn span {
        display: none;
    }
}

/* Scrollbar Styling */
.output-container::-webkit-scrollbar {
    width: 10px;
}

.output-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.output-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.output-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Selection */
::selection {
    background: var(--accent-blue);
    color: white;
}
