/* ------------------------------------------------------------------ */
/*  Virus Language Online Compiler & Playground - Design System System */
/* ------------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #07090e;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(26, 38, 66, 0.85);
    --border-color: rgba(56, 189, 248, 0.15);
    --border-highlight: rgba(34, 211, 238, 0.4);
    
    --primary: #10b981;       /* Emerald / Bio hazard green */
    --primary-glow: rgba(16, 185, 129, 0.35);
    --secondary: #06b6d4;     /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.35);
    --accent: #8b5cf6;        /* Virus purple */
    --danger: #ef4444;        /* Error red */
    --warning: #f59e0b;       /* Warning amber */

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.2);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
    color: var(--text-main);
    font-family: var(--font-ui);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

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

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Select dropdown */
.select-wrapper {
    position: relative;
}

select.preset-select {
    appearance: none;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 36px 8px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

select.preset-select:hover {
    border-color: var(--border-highlight);
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
    pointer-events: none;
}

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: var(--border-highlight);
}

/* Main IDE Layout Grid */
.ide-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 900px) {
    .ide-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        overflow-y: auto;
    }
}

/* Panels */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.panel-title span.badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Code Editor Area */
.editor-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.line-numbers {
    padding: 16px 8px;
    background: rgba(7, 9, 14, 0.4);
    border-right: 1px solid var(--border-color);
    color: var(--text-dim);
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    min-width: 42px;
}

textarea.code-editor {
    flex: 1;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.5;
    padding: 16px;
    resize: none;
    white-space: pre;
    tab-size: 4;
}

/* Right Panel Tabs (Console / AST / Tokens) */
.tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--secondary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: var(--font-code);
    font-size: 13px;
}

.tab-content.active {
    display: block;
}

/* Console Terminal View */
#console-output {
    line-height: 1.6;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-stdout {
    color: #34d399; /* Green text */
}

.log-stderr {
    color: #f87171; /* Red text */
}

.log-system {
    color: #38bdf8; /* Cyan text */
    font-style: italic;
}

/* AST & Token Visualizer */
pre.code-block {
    background: rgba(7, 9, 14, 0.6);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: #a7f3d0;
    overflow-x: auto;
}

/* Footer status bar */
.statusbar {
    padding: 8px 24px;
    background: rgba(7, 9, 14, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.dot.busy {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

/* Interactive Input Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--secondary);
    box-shadow: 0 0 30px var(--secondary-glow);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 360px;
    max-width: 90%;
}

.modal-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--secondary);
}

.modal-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.modal-card input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(7, 9, 14, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-code);
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
}

.modal-card input:focus {
    border-color: var(--secondary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
