/* Studio Layout overrides for 3-column UI */

.studio-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-color);
    overflow: hidden;
    display: block;
    /* Override index.css body flex layout */
    /* App-like feel, no whole-page scrolling */
}

.studio-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    max-width: 100%;
    /* Ensure it does not overflow */
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    /* Stop all overflows at the root */
}

.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.studio-layout {
    display: flex;
    flex: 1;
    gap: 16px;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    /* Important for flex children to scroll */
}

/* LEFT SIDEBAR */
.left-sidebar {
    width: 260px;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* MIDDLE EDITOR */
.middle-editor {
    flex: 1;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.editor-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 16px 0;
    gap: 8px;
    overflow-x: auto;
}

.editor-tabs .tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-tabs .tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    border-color: var(--glass-border);
}

.editor-content {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    overflow: hidden;
    min-width: 0;
    /* Prevent content from breaking out */
}

.code-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: monospace;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.5;
}

/* RIGHT SIDEBAR */
.right-sidebar {
    width: 300px;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* Accordions */
.accordion {
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.accordion summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
    outline: none;
}

.accordion summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-tab-item {
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
}

.sidebar-tab-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-tab-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    font-weight: 600;
}

/* CodeMirror overrides */
.cm-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    outline: none !important;
}

.cm-editor .cm-scroller {
    font-family: monospace;
    overflow: auto;
    padding: 16px;
    /* Add padding here instead of .editor-content */
}