/* SF-Intel Studio — Embedded Demo Styles */
/* Scoped inside .demo-embed */

.demo-embed {
    position: relative;
    border: 1px solid var(--border-strong, #2a2a2e);
    border-radius: 10px;
    overflow: hidden;
    background: #1e1e1e;
    height: 540px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #ccc;
}
.demo-embed ::-webkit-scrollbar { width: 8px; height: 8px; }
.demo-embed ::-webkit-scrollbar-track { background: transparent; }
.demo-embed ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.demo-embed ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Autoplay hint */
.demo-embed .autoplay-hint {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    color: rgba(255,255,255,0.5);
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.4s;
    background: rgba(0,0,0,0.6);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* IDE Root */
.demo-embed #ide-root { display: flex; flex-direction: column; height: 100%; }

/* Header */
.demo-embed #ide-header {
    background: #2d2d2d;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3c3c3c;
    height: 40px;
    flex-shrink: 0;
}
.demo-embed .header-left { display: flex; align-items: center; gap: 12px; }
.demo-embed .header-right { display: flex; align-items: center; gap: 8px; }
.demo-embed .logo {
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.demo-embed .logo img { width: 16px; height: 16px; }
.demo-embed .logo-ver { font-size: 10px; color: #555; font-weight: 400; }
.demo-embed .badge {
    font-size: 11px;
    background: rgba(255,255,255,0.06);
    padding: 2px 10px;
    border-radius: 3px;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    font-family: 'SF Mono', Consolas, monospace;
}
.demo-embed .btn-header {
    background: #3c3c3c;
    border: 1px solid #4a4a4a;
    color: #888;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s;
}
.demo-embed .btn-header:hover { background: #444; color: #ccc; }
.demo-embed .btn-header.active { background: #0e639c; border-color: #1177bb; color: #fff; }
.demo-embed .btn-header svg { width: 14px; height: 14px; fill: currentColor; }

/* Content */
.demo-embed #ide-content { display: flex; flex: 1; overflow: hidden; }

/* Sidebar Nav */
.demo-embed #sidebar-nav {
    width: 44px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    gap: 4px;
    flex-shrink: 0;
}
.demo-embed .nav-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: #666;
    cursor: pointer;
    transition: color 0.15s;
    border-radius: 0;
}
.demo-embed .nav-item:hover { color: #ccc; }
.demo-embed .nav-item.active { color: #fff; border-left-color: #007acc; }
.demo-embed .nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Tree Panel */
.demo-embed #tree-panel {
    width: 260px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.demo-embed .tree-controls { padding: 10px 12px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.demo-embed .tree-search {
    width: 100%;
    background: #3c3c3c;
    border: 1px solid #454545;
    color: #ccc;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.demo-embed .tree-search:focus { border-color: #007acc; background: #333; }
.demo-embed .tree-search::placeholder { color: #666; }
.demo-embed .tab-bar { display: flex; margin-top: 10px; gap: 4px; }
.demo-embed .tab-btn {
    flex: 1;
    font-size: 10px;
    padding: 5px 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.15s;
}
.demo-embed .tab-btn:hover { color: rgba(255,255,255,0.7); }
.demo-embed .tab-btn.active { color: #fff; border-bottom-color: #007acc; }
.demo-embed #file-tree { flex: 1; overflow-y: auto; padding: 4px; }
.demo-embed .tree-item {
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 0;
    transition: background 0.08s;
}
.demo-embed .tree-item:hover { background: rgba(255,255,255,0.04); }
.demo-embed .tree-item.active { background: rgba(0,122,204,0.15); color: #fff; }
.demo-embed .tree-icon {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.demo-embed .icon-cls { color: #e06c75; }
.demo-embed .icon-trig { color: #d19a66; }
.demo-embed .icon-lwc { color: #56b6c2; }

/* Utilities Panel */
.demo-embed #utils-panel {
    width: 260px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: none;
    flex-direction: column;
    flex-shrink: 0;
}
.demo-embed .panel-header {
    padding: 12px 14px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.demo-embed .util-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.08s;
}
.demo-embed .util-item:hover { background: rgba(255,255,255,0.04); }
.demo-embed .util-item.active { background: rgba(0,122,204,0.15); }
.demo-embed .util-item .u-icon { color: #888; display: flex; }
.demo-embed .util-item .u-icon svg { width: 16px; height: 16px; fill: currentColor; }
.demo-embed .util-item .u-name { font-size: 12px; color: #ccc; }
.demo-embed .util-item .u-desc { font-size: 10px; color: #666; }

/* Editor Area */
.demo-embed #editor-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #1e1e1e; }
.demo-embed .editor-tabs {
    height: 32px;
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    flex-shrink: 0;
    overflow-x: auto;
}
.demo-embed .editor-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    font-size: 11px;
    color: #888;
    border-right: 1px solid #2d2d2d;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.1s;
    flex-shrink: 0;
}
.demo-embed .editor-tab:hover { color: #ccc; }
.demo-embed .editor-tab.active { background: #1e1e1e; color: #fff; border-bottom: 1px solid #1e1e1e; margin-bottom: -1px; }
.demo-embed .editor-tab .tab-icon { font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.demo-embed .editor-tab .tab-close { font-size: 14px; margin-left: 6px; opacity: 0; transition: opacity 0.1s; color: #888; }
.demo-embed .editor-tab:hover .tab-close { opacity: 1; }
.demo-embed #monaco-container { flex: 1; overflow: hidden; }

/* SOQL Workspace */
.demo-embed #soql-workspace { display: none; flex: 1; flex-direction: column; overflow: hidden; background: #1e1e1e; }
.demo-embed .soql-header {
    height: 48px;
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}
.demo-embed .soql-header-title { font-size: 11px; font-weight: 600; color: #4facfe; text-transform: uppercase; letter-spacing: 0.8px; }
.demo-embed .soql-header-actions { display: flex; gap: 6px; }
.demo-embed .btn-run {
    background: rgba(39,174,96,0.15);
    border: 1px solid rgba(46,204,113,0.3);
    color: #2ecc71;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.demo-embed .btn-run:hover { background: rgba(39,174,96,0.25); border-color: rgba(46,204,113,0.5); }
.demo-embed .btn-run svg { width: 12px; height: 12px; fill: currentColor; }
.demo-embed #soql-editor { height: 160px; border-bottom: 1px solid #3c3c3c; flex-shrink: 0; }
.demo-embed #soql-results { flex: 1; overflow: auto; padding: 0; }
.demo-embed .results-bar {
    height: 28px;
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}
.demo-embed .results-bar .count { color: #4facfe; font-weight: 600; margin-right: 4px; }
.demo-embed .results-table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: 'SF Mono', Consolas, monospace; }
.demo-embed .results-table th {
    background: #252526;
    color: #888;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    text-align: left;
    border-bottom: 1px solid #3c3c3c;
    position: sticky;
    top: 0;
}
.demo-embed .results-table td { padding: 5px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #ccc; }
.demo-embed .results-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Status Bar */
.demo-embed #status-bar {
    height: 22px;
    background: #007acc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
}
.demo-embed .status-left, .demo-embed .status-right { display: flex; gap: 16px; align-items: center; }
.demo-embed .status-item { display: flex; align-items: center; gap: 4px; }

/* Toast */
.demo-embed #demo-toast {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #ccc;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 999;
    border: 1px solid #444;
}

/* Responsive */
@media (max-width: 1024px) {
    .demo-embed { height: 460px; }
}
@media (max-width: 768px) {
    .demo-embed { display: none; }
    .ide-static { display: block !important; }
    .demo-embed #tree-panel, .demo-embed #utils-panel { width: 200px; }
    .demo-embed #sidebar-nav { width: 36px; }
}
@media (max-width: 480px) {
    .demo-embed #tree-panel, .demo-embed #utils-panel { display: none !important; }
    .demo-embed #sidebar-nav { display: none; }
}
