/* Collapsible JSON Tree highlights */
.json-tree-node {
    margin-left: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
}
.json-tree-label {
    display: inline-flex;
    align-items: center;
    cursor: default;
}
.json-tree-label.collapsible {
    cursor: pointer;
}
.json-tree-label.collapsible:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.json-tree-toggle {
    font-size: 14px !important;
    color: #6272a4;
    margin-right: 2px;
    user-select: none;
    transition: transform 0.2s;
}
.json-tree-key {
    color: #8be9fd;
}
.json-tree-val.string {
    color: #f1fa8c;
    word-break: break-all;
}
.json-tree-val.number {
    color: #bd93f9;
}
.json-tree-val.boolean {
    color: #ffb86c;
}
.json-tree-val.null {
    color: #6272a4;
}
.json-tree-val.empty {
    color: #f8f8f2;
}
.json-tree-brackets {
    color: #f8f8f2;
}
.json-tree-count {
    color: #6272a4;
    font-size: 8px;
    margin-left: 6px;
    font-style: italic;
}
.json-tree-children {
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    padding-left: 4px;
}
.json-tree-brackets-close {
    color: #f8f8f2;
}

/* Layout separation for Console outputs */
#console-output {
    overflow: hidden !important;
}

#console-output.active {
    display: flex !important;
    padding: 0 !important;
    flex-direction: row;
    height: 100%;
}

#console-execution-panel {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#console-log-history {
    width: 380px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 12px;
    height: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.05);
}

/* Actions area and mini buttons */
.meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.exec-mini-btn {
    background: transparent;
    border: none;
    color: #6272a4; /* Muted Dracula grey */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.exec-mini-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #8be9fd; /* Cyan hover */
}

.exec-mini-btn:active {
    transform: scale(0.9);
}

.exec-mini-btn .material-icons {
    font-size: 13px !important;
}

.exec-mini-btn.success {
    color: #50fa7b !important; /* Green feedback success */
}

.details-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

/* Responsive vertical stack on narrower viewports */
@media (max-width: 680px) {
    #console-output.active {
        flex-direction: column !important;
    }
    
    #console-execution-panel {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    #console-log-history {
        width: 100% !important;
        height: 140px !important;
        flex-shrink: 0;
    }
}

/* HTML viewer classes */
.html-viewer-container {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}

.html-viewer-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.html-tab {
    background: transparent;
    border: none;
    color: #8be9fd;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.html-tab:hover {
    background: rgba(255, 255, 255, 0.04);
}

.html-tab.active {
    background: #1e1e1e;
    color: #ff79c6;
    border-bottom: 1px solid #1e1e1e;
}

.html-viewer-panes {
    padding: 0;
}

.html-pane {
    display: none;
}

.html-pane.active {
    display: block;
}

.html-pane.source pre, .html-pane.raw pre {
    margin: 0;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    max-height: 300px;
    background: #1e1e1e;
    color: #f8f8f2;
}

.html-pane.preview {
    background: #fff;
    padding: 0;
}

.preview-sandbox {
    background: #ffffff;
    color: #333333;
    padding: 15px;
    border-radius: 0;
    max-height: 400px;
    overflow-y: auto;
    font-family: system-ui, -apple-system, sans-serif;
}
