/* ARCHITECTURE: Dark theme overrides and container styles for Bokeh charts
   WHY: BokehJS default styling conflicts with SOL dark theme — these overrides
        ensure charts blend seamlessly with the census dashboard
   TRADEOFF: !important overrides for Bokeh's inline styles vs visual consistency */

/* ============================================
   Chart Containers
   ============================================ */

.bokeh-chart-container {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 8px;
    margin: 8px 0;
    position: relative;
    min-height: 100px;
}

.bokeh-chart-container .bk-root {
    /* Prevent Bokeh from adding its own background */
    background: transparent !important;
}

/* ============================================
   Loading State
   ============================================ */

.bokeh-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: #71717a;
    font-size: 13px;
}

.bokeh-chart-loading.hidden {
    display: none;
}

.bokeh-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: bokeh-spin 0.6s linear infinite;
}

@keyframes bokeh-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Chart Toggle Button (vitals panel header)
   ============================================ */

.bokeh-chart-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #71717a;
    background: transparent;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bokeh-chart-toggle:hover {
    color: #06b6d4;
    border-color: #06b6d4;
}

.bokeh-chart-toggle.active {
    color: #06b6d4;
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.08);
}

/* ============================================
   Panel Selector (lab panel pills)
   ============================================ */

.bokeh-panel-selector {
    display: flex;
    gap: 4px;
    padding: 4px 4px 8px;
    flex-wrap: wrap;
}

.bokeh-panel-pill {
    padding: 3px 10px;
    font-size: 11px;
    color: #71717a;
    background: transparent;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bokeh-panel-pill:hover {
    color: #d4d4d8;
    border-color: #52525b;
}

.bokeh-panel-pill.active {
    color: #06b6d4;
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.08);
}

/* ============================================
   Trends Panel
   ============================================ */

.bokeh-trends-panel {
    padding: 8px;
}

/* ============================================
   Problem Dashboard Button
   ============================================ */

.bokeh-dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    font-size: 10px;
    color: #71717a;
    background: transparent;
    border: 1px solid #333;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bokeh-dashboard-btn:hover {
    color: #a855f7;
    border-color: #a855f7;
}

/* ============================================
   Bokeh Theme Overrides (dark mode)
   ============================================ */

/* Toolbar */
.bk-toolbar {
    background: #0a0a0a !important;
}

.bk-toolbar-button {
    color: #71717a !important;
}

.bk-toolbar-button:hover {
    color: #d4d4d8 !important;
}

.bk-toolbar-button.bk-active {
    color: #06b6d4 !important;
}

/* Tooltip */
.bk-tooltip {
    background-color: #18181b !important;
    border: 1px solid #3f3f46 !important;
    color: #d4d4d8 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.bk-tooltip > div > div {
    color: #a1a1aa !important;
}

/* Legend */
.bk-legend {
    background-fill-color: #0a0a0a !important;
}

/* Error/empty state */
.bokeh-chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #ef4444;
    font-size: 13px;
    text-align: center;
}

.bokeh-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #52525b;
    font-size: 13px;
    font-style: italic;
}
