/**
 * Sidebar Layout Component
 *
 * NOTE: Navigation styles (.nav-sidebar .nav-link) are defined in style.css
 * This file only contains layout structure - DO NOT duplicate nav styles here.
 *
 * CSS Variables used (defined in style.css):
 *   --sidebar-width, --sidebar-active-bg, --sidebar-hover-bg, etc.
 */

/* ==================== LAYOUT CONTAINER ==================== */
.sidebar-layout {
    display: flex;
    gap: var(--space-lg, 24px);
    min-height: 0;
    height: auto;
    align-items: flex-start;
}

.sidebar-layout.sidebar-right {
    flex-direction: row-reverse;
}

/* ==================== SIDEBAR ==================== */
.sidebar-container {
    flex: 0 0 var(--sidebar-width-left, var(--sidebar-width, 220px));
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-shell {
    min-width: 0;
}

.sidebar-nav-body {
    padding: var(--space-xs, 8px);
}

.sidebar-nav-shell-flat {
    background: transparent;
}

.sidebar-nav-shell-flat .nav-sidebar {
    width: 100%;
}

.sidebar-nav {
    flex: 0 0 var(--sidebar-width-left, var(--sidebar-width, 220px));
    position: sticky;
    top: 0;
    height: fit-content;
    max-height: 100%;
    overflow-y: auto;
}

.sidebar-layout.sidebar-right .sidebar-nav {
    flex: 0 0 var(--sidebar-width-right, var(--sidebar-width, 220px));
}

.sidebar-nav.sidebar-wide {
    flex: 0 0 var(--sidebar-width-app, 280px);
}

.sidebar-nav.sidebar-narrow {
    flex: 0 0 var(--sidebar-width-narrow, 240px);
}

/* ==================== MAIN CONTENT ==================== */
.sidebar-main {
    flex: 1;
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* Content inside sidebar-main that should scroll */
.sidebar-main-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ==================== SECTION PANELS ==================== */
.section-panel {
    display: none;
}

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

/* ==================== QUICK STATS BOX ==================== */
.sidebar-stats {
    margin-top: var(--space-md, 16px);
}

.sidebar-stats .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm, 8px);
}

.sidebar-stats .stat-label {
    color: var(--color-text-muted, var(--gray-500));
}

.sidebar-stats .stat-value {
    font-weight: 600;
}

/* ==================== ANALYSIS HUB SIDEBAR HELPERS ==================== */
.analysis-task-label {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.analysis-current-task {
    max-width: 100%;
    overflow: hidden;
}

.analysis-current-task-name {
    max-width: calc(100% - 50px);
}

.analysis-current-task-type {
    font-size: 0.65rem;
}

.analysis-run-hint-badge {
    font-size: 0.6rem;
}

/* ==================== LEGACY ANALYSIS PAGE HELPERS ==================== */
.drcbc-task-select {
    width: auto;
}

.drcbc-progress {
    height: 24px;
}

.drcbc-progress-log {
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
}

.drcbc-error-message {
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.drcbc-utility-value {
    width: 80px;
}

.drcbc-utility-progress {
    height: 12px;
}

.drcbc-empty-icon {
    color: #dee2e6;
    font-size: 4rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .sidebar-layout {
        flex-direction: column;
    }

    .sidebar-layout.sidebar-right {
        flex-direction: column;
    }

    .sidebar-nav,
    .sidebar-container {
        position: static;
        flex: none;
        max-height: none;
    }
}
