/* Workspace-specific — body needs to fill viewport */
body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.problem-nav select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 13px;
    min-width: 200px;
    cursor: pointer;
    outline: none;
}
.problem-nav select:focus { border-color: var(--accent-blue); }
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
}
.btn-small:hover { color: var(--text-primary); }

/* --- Workspace --- */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-top {
    flex: 1;
    display: flex;
    min-height: 0;
}

.workspace-bottom {
    height: 200px;
    min-height: 80px;
    display: flex;
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

/* --- Resize Handle (horizontal, between top and bottom) --- */
.resize-handle-h {
    height: 4px;
    background: var(--border);
    cursor: ns-resize;
    flex-shrink: 0;
    transition: background 0.15s;
}
.resize-handle-h:hover,
.resize-handle-h.active { background: var(--accent-blue); }

/* --- Resize Handle (vertical, between panels) --- */
.resize-handle-v {
    width: 4px;
    background: var(--border);
    cursor: ew-resize;
    flex-shrink: 0;
    transition: background 0.15s;
}
.resize-handle-v:hover,
.resize-handle-v.active { background: var(--accent-blue); }

/* --- Panels --- */
.panel {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    flex-shrink: 0;
    user-select: none;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}

/* --- Graph Panel --- */
.panel-graph {
    flex: 1;
    min-width: 200px;
}

.component-palette {
    display: flex;
    gap: 4px;
}

.palette-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}
.palette-btn:hover {
    background: var(--border);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

#graph-canvas {
    flex: 1;
    width: 100%;
    display: block;
    cursor: grab;
}

/* --- Description Panel --- */
.panel-description {
    width: 280px;
    min-width: 180px;
    border-right: 1px solid var(--border);
}

/* --- Code Panel --- */
.panel-code {
    width: 380px;
    min-width: 200px;
    border-left: 1px solid var(--border);
}

.code-tabs {
    display: flex;
    gap: 2px;
}

.code-tab {
    padding: 3px 10px;
    font-size: 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}
.code-tab.active {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
    font-weight: 600;
}
.code-tab:hover:not(.active) { background: var(--border); }

#editor-container {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* --- Bottom Panels --- */
.bottom-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.bottom-section + .bottom-section {
    border-left: 1px solid var(--border);
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 8px;
}
.placeholder-text i { font-size: 20px; }
.placeholder-text p { font-size: 12px; }

/* --- Problem description --- */
#problem-description {
    font-size: 13px;
    line-height: 1.6;
}
#problem-description h1 { font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }
#problem-description h2 { font-size: 14px; margin: 14px 0 6px; color: var(--text-primary); }
#problem-description h3 { font-size: 13px; margin: 10px 0 4px; color: var(--text-primary); }
#problem-description p { margin-bottom: 6px; color: var(--text-secondary); }
#problem-description code {
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
}
#problem-description pre {
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 6px 0;
}
#problem-description pre code { background: none; padding: 0; }
#problem-description ul { padding-left: 18px; margin-bottom: 6px; }
#problem-description li { margin-bottom: 2px; color: var(--text-secondary); }

/* --- Test Results --- */
.test-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    margin-bottom: 3px;
    font-size: 12px;
}
.test-item.pass {
    background: rgba(63, 185, 80, 0.08);
    color: var(--accent-green);
}
.test-item.fail {
    background: rgba(248, 81, 73, 0.08);
    color: var(--accent-red);
}
.test-item .test-icon { font-size: 12px; flex-shrink: 0; }
.test-item .test-name { flex: 1; }
.test-item .test-error {
    font-size: 11px;
    color: var(--accent-red);
}

.test-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
}
.test-summary.all-pass { border-left: 3px solid var(--accent-green); }
.test-summary.has-fail { border-left: 3px solid var(--accent-red); }

/* --- Console --- */
.console-output {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}
.console-output .log-entry {
    padding: 1px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.3);
}
.console-output .log-time {
    color: var(--text-muted);
    margin-right: 8px;
}
.console-output .log-error { color: var(--accent-red); }
.console-output .log-info { color: var(--accent-blue); }
