/* app/styles/layout.css */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#top-bar {
    height: var(--header-height);
    background: rgba(30, 30, 30, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--md-sys-spacing-4);
    flex-shrink: 0;
}

#main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#sidebar {
    width: var(--sidebar-width);
    background-color: var(--md-sys-color-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--md-sys-spacing-4);
    flex-shrink: 0;
    transition: width 0.2s ease;
    border-right: 1px solid var(--md-sys-color-outline);
    overflow: hidden;
}

#sidebar.expanded {
    width: var(--sidebar-expanded-width);
    align-items: stretch;
}

.sidebar-panel {
    width: var(--left-sidebar-width);
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#left-panel-content {
    min-width: 150px;
    max-width: 600px;
    transition: width 0.2s;
}

#editor-container {
    flex: 1;
    height: 100%;
    min-width: 0;
}

#right-sidebar {
    overflow-y: auto; overflow-x: visible;
    width: 250px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-left: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: width 0.2s;
}

#ai-auxiliary-panel {
    width: 350px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-left: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: width 0.2s;
}

#right-sidebar.collapsed {
    width: 30px !important;
}

#bottom-panel {
    height: var(--footer-height);
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-top: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
}

#panel-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#status-bar {
    height: 22px;
    background: #111215 !important;
    color: #eeeeee !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-body-medium);
    flex-shrink: 0;
    border-top: 1px solid transparent;
    position: relative;
}

#status-bar span {
    color: #eeeeee !important;
}

#status-bar #app-version {
    color: #94a3b8 !important;
}

#status-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-tertiary) 100%);
}

/* Specific view wrappers */
.view-content {
    display: none;
    flex: 1;
    padding: var(--md-sys-spacing-4);
    overflow-y: auto;
    height: calc(100% - 40px);
    padding-bottom: 20px;
}

.view-content.active {
    display: flex;
    flex-direction: column;
}

.panel-content {
    display: none;
    height: 100%;
    padding: var(--md-sys-spacing-4);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: var(--md-sys-typescale-body-large);
    overflow-y: auto;
    background-color: var(--md-sys-color-surface);
    box-sizing: border-box;
}

.panel-content.active {
    display: block;
}

/* Utilities / Structural Enhancements */
.resizer {
    width: 6px;
    cursor: ew-resize;
    background: var(--md-sys-color-outline);
    transition: background 0.2s;
    z-index: 1000;
}
.resizer:hover {
    background: var(--md-sys-color-primary);
}
.resizer.horizontal {
    height: 6px;
    cursor: ns-resize;
    width: 100%;
    background: var(--md-sys-color-outline);
    transition: background 0.2s;
    z-index: 1001;
}
.resizer.horizontal:hover {
    background: var(--md-sys-color-primary);
}

body.resizing { cursor: ew-resize !important; }

/* Sidepanel Mode Overrides */
html.sidepanel-mode #sidebar {
    /* Optional: hide or slim down */
}

html.sidepanel-mode #top-bar {
    height: auto !important;
    flex-direction: column !important;
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-2) !important;
}

html.sidepanel-mode #bottom-panel {
    /* Adjust height if needed */
}

html.sidepanel-mode #status-bar {
    font-size: var(--md-sys-typescale-body-small) !important;
    padding: 0 var(--md-sys-spacing-2) !important;
}

html.sidepanel-mode .sidebar-panel,
html.sidepanel-mode #right-sidebar {
    display: flex;
}
html.sidepanel-mode .resizer {
    background: var(--md-sys-color-outline-variant);
}

/* RAM Indicator Styles */
.ram-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--md-sys-color-on-primary);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ram-icon {
    font-size: 13px !important;
    vertical-align: middle;
}

.ram-btn {
    background: rgba(255, 255, 255, 0.25);
    color: var(--md-sys-color-on-primary);
    border: none;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    outline: none;
    margin-left: 4px;
}

.ram-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ram-btn:active {
    transform: scale(0.95);
}

/* Premium Docs Search Interface Styles */
.docs-search-container {
    padding: 10px var(--md-sys-spacing-4);
    background: rgba(40, 42, 54, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

#docs-search {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8f8f2;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

#docs-search::placeholder {
    color: #6272a4;
    font-style: italic;
}

#docs-search:focus {
    border-color: #bd93f9;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(189, 147, 249, 0.25);
}

.docs-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--md-sys-spacing-4);
}

.docs-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.docs-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(189, 147, 249, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 12px rgba(189, 147, 249, 0.1);
}

.param-badge {
    display: inline-block;
    background: rgba(139, 233, 253, 0.08) !important;
    border: 1px solid rgba(139, 233, 253, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: #8be9fd;
    font-family: 'Consolas', 'Courier New', monospace;
    transition: background 0.2s;
}

.param-badge:hover {
    background: rgba(139, 233, 253, 0.15) !important;
}

.docs-btn-copy, .docs-btn-insert {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.docs-btn-copy {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8f8f2;
}

.docs-btn-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.docs-btn-insert {
    background: rgba(25, 127, 230, 0.15) !important;
    border: 1px solid rgba(25, 127, 230, 0.4) !important;
    color: #58a6ff !important;
}

.docs-btn-insert:hover {
    background: rgba(25, 127, 230, 0.3) !important;
    border-color: #58a6ff !important;
    transform: scale(1.02);
}

.docs-btn-insert:active {
    transform: scale(0.98);
}

/* Vertical Console Panel Overrides */
#bottom-panel.vertical {
    width: var(--footer-width, 350px);
    height: 100% !important;
    border-top: none !important;
    border-left: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
}

#bottom-panel.vertical #console-output.active {
    flex-direction: column !important;
}

#bottom-panel.vertical #console-execution-panel {
    height: 80% !important;
    flex: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    width: 100% !important;
}

#bottom-panel.vertical #console-log-history {
    height: 20% !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

#bottom-resizer.vertical {
    width: 6px !important;
    height: 100% !important;
    cursor: ew-resize !important;
}

.panel-actions button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

#top-bar-timer {
    margin-left: 24px;
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

#top-bar-timer.timer-running {
    display: inline-flex !important;
    color: var(--md-sys-color-success);
    background: rgba(80, 250, 123, 0.08);
    border: 1px solid rgba(80, 250, 123, 0.2);
}

#top-bar-timer.timer-paused {
    display: inline-flex !important;
    color: #ffb86c;
    background: rgba(255, 184, 108, 0.08);
    border: 1px solid rgba(255, 184, 108, 0.2);
}

#active-workspace-icon svg {
    width: 13px !important;
    height: 13px !important;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}



