:root {
    /* Color Palette - Obsidian Deep with Emerald Accent */
    --bg-app: #030712;
    --bg-pane: rgba(17, 24, 39, 0.7);
    --bg-header: rgba(3, 7, 18, 0.8);
    --bg-footer: rgba(3, 7, 18, 0.9);
    --border-main: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --accent-primary: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --accent-text: #34d399;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* System Tokens */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --header-height: 64px;
    --footer-height: 32px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-ui);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* App Structure */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
}

/* Header & Navigation */
header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-main);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
}

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

.logo-container {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-main);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-container:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: rotate(5deg) scale(1.05);
}

.app-logo {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pro-badge {
    font-size: 0.6rem;
    background: var(--accent-primary);
    color: var(--bg-app);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.brand-text .highlight {
    background: linear-gradient(to right, var(--accent-primary), #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text .tagline {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.primary-actions, .secondary-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 42px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-ui);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #059669);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
    width: 42px;
    padding: 0;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 0.5rem;
    gap: 0.5rem;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-pane);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pane-header {
    height: 40px;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-main);
}

.pane-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pane-title i {
    width: 14px;
    height: 14px;
}

.pane-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Editor Container */
#editor-container {
    flex: 1;
    width: 100%;
}

/* Resizer */
.resizer {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.3s;
    border-radius: 2px;
}

.resizer:hover, .resizer.active {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Output Console */
#output-pane {
    background: #010409;
}

#output-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

#output-content div {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-break: break-all;
}

.out-stdout { color: #e5e7eb; }
.out-stderr, .out-error { 
    color: #fca5a5; 
    background: rgba(239, 68, 68, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid var(--danger);
}
.out-system { color: var(--accent-text); font-style: italic; }

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-dim);
    gap: 1rem;
}

.empty-state i {
    width: 48px;
    height: 48px;
    opacity: 0.2;
}

/* Footer */
footer {
    height: var(--footer-height);
    background: var(--bg-footer);
    border-top: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.footer-segment {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.green { background: var(--accent-primary); box-shadow: 0 0 8px var(--accent-primary); }
.status-dot.orange { background: var(--warning); animation: pulse 1.5s infinite; }

.v-divider {
    width: 1px;
    height: 12px;
    background: var(--border-main);
}

/* Loader Overlay */
#loader-overlay {
    position: fixed;
    inset: 0;
    background: #030712;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.spinner-outer {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    position: relative;
    margin-bottom: 2rem;
}

.spinner-inner {
    position: absolute;
    inset: -2px;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loader-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#loader-subtext {
    color: var(--text-dim);
    font-size: 0.875rem;
}

/* Background Blurs */
.bg-blur {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    opacity: 0.15;
}

.blur-1 {
    top: -10%;
    right: -10%;
    background: var(--accent-primary);
}

.blur-2 {
    bottom: -10%;
    left: -10%;
    background: #3b82f6;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    .resizer {
        height: 4px;
        width: 100%;
        cursor: row-resize;
    }
    .brand-text .tagline {
        display: none;
    }
    .toolbar span {
        display: none;
    }
}

