/* Monty Playground - Minimal WASM-only Styles */

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

:root {
    --bg: #0a0a0a;
    --surface: #111113;
    --surface-2: #18181b;
    --border: #27272a;
    --primary: #10b981;
    --text: #fafafa;
    --text-muted: #71717a;
    --error: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}
.logo:hover { color: var(--primary); }
.logo-icon { font-size: 24px; }
.logo-text { font-weight: 600; font-size: 16px; }

.badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    padding: 3px 6px;
    background: var(--primary);
    color: #000;
    border-radius: 4px;
    font-weight: 600;
}

select {
    font-family: inherit;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.btn {
    font-family: inherit;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: #34d399; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 2px 8px; font-size: 11px; }

/* Main */
.main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
}

.panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}
.panel:last-child { border-right: none; }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.panel-content { flex: 1; overflow: auto; }

#editor { width: 100%; height: 100%; }

.output {
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.output-line { margin-bottom: 2px; white-space: pre-wrap; }
.output-result { color: var(--primary); }
.output-info { color: var(--text-muted); }
.output-error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--error);
    margin: 4px 0;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}
.status-left { display: flex; align-items: center; gap: 6px; }
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
}
.status-dot.running { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.error { background: var(--error); }
.status-right a { color: var(--text-muted); text-decoration: none; }
.status-right a:hover { color: var(--text); }

@keyframes pulse { 50% { opacity: 0.4; } }

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading-content { text-align: center; }
.loading-spinner {
    width: 32px; height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error State */
.error-container {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}
.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--error);
    margin-bottom: 16px;
}
.error-message {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap;
    margin-bottom: 24px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* Mobile */
@media (max-width: 768px) {
    .main { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .panel { border-right: none; border-bottom: 1px solid var(--border); }
    .header { flex-wrap: wrap; gap: 8px; }
    .header-center { order: 3; width: 100%; }
}
