/* ── Playground Styles ── */

.playground-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
}

/* Navigation */
.playground-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #1a1a2e;
    margin-bottom: 2rem;
}

.playground-nav .nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: 700;
}

.playground-nav .nav-title {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
}

.playground-nav .nav-back {
    color: #667eea;
    text-decoration: none;
}

.playground-nav .nav-back:hover {
    text-decoration: underline;
}

/* Main Layout */
.playground-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 250px);
    min-height: 500px;
}

/* Editor Section */
.editor-section {
    display: flex;
    flex-direction: column;
    background: #12121f;
    border-radius: 12px;
    border: 1px solid #1e1e34;
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: #1a1a2e;
    border-bottom: 1px solid #1e1e34;
}

.editor-title {
    color: #8888aa;
    font-weight: 600;
    font-size: 0.9rem;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.editor-actions .btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1.2rem;
    background: #1a1a2e;
    border-top: 1px solid #1e1e34;
    font-size: 0.75rem;
    color: #444466;
}

.key-hint {
    color: #444466;
}

.key-hint kbd {
    background: #0a0a0f;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #667eea;
}

/* CodeMirror */
.CodeMirror {
    flex: 1;
    height: auto !important;
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #0a0a0f !important;
}

.CodeMirror-gutters {
    background: #0a0a0f !important;
    border-right: 1px solid #1a1a2e !important;
}

.CodeMirror-linenumber {
    color: #444466 !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #667eea !important;
}

/* Output Section */
.output-section {
    display: flex;
    flex-direction: column;
    background: #12121f;
    border-radius: 12px;
    border: 1px solid #1e1e34;
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: #1a1a2e;
    border-bottom: 1px solid #1e1e34;
}

.output-title {
    color: #8888aa;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
}

.status-badge.idle {
    background: #1a1a2e;
    color: #444466;
}

.status-badge.running {
    background: #667eea;
    color: #fff;
}

.status-badge.success {
    background: #27c93f;
    color: #fff;
}

.status-badge.error {
    background: #ff5f56;
    color: #fff;
}

#output-container {
    flex: 1;
    padding: 1rem 1.2rem;
    overflow: auto;
    background: #0a0a0f;
}

#output-content {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.output-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1.2rem;
    background: #1a1a2e;
    border-top: 1px solid #1e1e34;
    font-size: 0.75rem;
    color: #444466;
}

.execution-time {
    color: #444466;
}

.exit-code {
    color: #444466;
}

/* Examples */
.examples-section {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid #1a1a2e;
}

.examples-section h3 {
    color: #8888aa;
    font-weight: 600;
    margin-bottom: 1rem;
}

.examples-grid {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.example-btn {
    background: #1a1a2e;
    color: #8888aa;
    border: 1px solid #1e1e34;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.example-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .playground-main {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .editor-section,
    .output-section {
        min-height: 300px;
    }
    
    .playground-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .editor-actions {
        flex-wrap: wrap;
    }
}
