:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --success: #10b981;
    --error: #ef4444;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Vibrant Animated Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: pulse-bg 15s ease-in-out infinite alternate;
}

@keyframes pulse-bg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 1;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f8fafc, #8b5cf6, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge.safe {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.wasm {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    animation: fadeIn 1s ease-out 0.2s both;
}

@media (max-width: 800px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.panel:hover {
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.panel-header {
    background: rgba(15, 23, 42, 0.6);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #f8fafc;
}

.btn {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

textarea {
    flex-grow: 1;
    width: 100%;
    min-height: 400px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.5;
    background: transparent;
    color: var(--text);
    border: none;
    resize: vertical;
}

textarea:focus {
    outline: none;
}

/* Modern MacOS Terminal Styles */
.terminal-panel {
    background: rgba(15, 23, 42, 0.85);
}

.terminal-header {
    background: rgba(2, 6, 23, 0.5);
    justify-content: flex-start;
}

.mac-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.mac-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}
.mac-btn.close { background: #ff5f56; }
.mac-btn.minimize { background: #ffbd2e; }
.mac-btn.maximize { background: #27c93f; }

.terminal-title {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-left: auto;
    margin-right: auto;
    transform: translateX(-25px); /* balance out mac buttons */
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 400px;
    max-height: 600px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.term-line {
    word-break: break-all;
    white-space: pre-wrap;
    margin-bottom: 4px;
}

.term-line.cmd { color: #38bdf8; font-weight: bold; }
.term-line.dim { color: #64748b; }
.term-line.success { color: #10b981; font-weight: bold; }
.term-line.error { color: #ef4444; font-weight: bold; }
.term-line.json-out { color: #f59e0b; }

footer {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
