/* Observatory dark theme for Dash */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Chakra+Petch:wght@500;600&display=swap');

/* ===== BASE ===== */
body {
    background-color: #0B0E14;
    color: #E2E8F0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    margin: 0;
}

/* ===== DASH 4.0 CSS VARIABLE OVERRIDES (dark theme) ===== */
:root {
    --Dash-Fill-Inverse-Strong: #1A2332;
    --Dash-Fill-Inverse-strong: #1A2332;
    --Dash-Stroke-Strong: #1E293B;
    --Dash-Stroke-Weak: #1E293B;
    --Dash-Fill-Interactive-Strong: #00D4AA;
    --Dash-Fill-Interactive-Weak: rgba(0, 212, 170, 0.08);
    --Dash-Text-Strong: #E2E8F0;
    --Dash-Text-Primary: #E2E8F0;
    --Dash-Text-Weak: #8B9DC3;
    --Dash-Text-Disabled: #4A5568;
    --Dash-Fill-Primary-Hover: rgba(0, 212, 170, 0.04);
    --Dash-Fill-Primary-Active: rgba(0, 212, 170, 0.08);
    --Dash-Fill-Disabled: rgba(255, 255, 255, 0.1);
    --Dash-Shading-Strong: rgba(0, 0, 0, 0.5);
    --Dash-Shading-Weak: rgba(0, 0, 0, 0.3);
}

/* ===== TRANSPARENT RADIO BUTTONS ===== */
.radio-transparent label {
    background: transparent !important;
}

/* ===== LAYOUT SHELL ===== */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
#sidebar {
    width: 300px;
    min-width: 300px;
    background-color: #141922;
    border-right: 1px solid #1E293B;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

#sidebar-header {
    height: 3.75rem;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    border-bottom: 1px solid #1E293B;
    border-left: 2px solid #00D4AA;
    margin: 0 0.75rem 0 0;
    flex-shrink: 0;
}

#sidebar-header a {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: #E2E8F0;
    text-decoration: none;
}

#sidebar-controls {
    padding: 1rem;
    flex: 1;
}

#sidebar-controls label {
    color: #8B9DC3;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

/* ===== NAV LINKS ===== */
.nav-links {
    padding: 0.5rem 0.625rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid #1E293B;
}

.nav-links > * {
    display: block;
}

.nav-links a {
    display: block;
    padding: 0.45rem 1rem;
    border-radius: 4px;
    color: #8B9DC3;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.nav-links a:hover {
    color: #E2E8F0;
    background-color: rgba(0, 212, 170, 0.08);
}

.nav-links a.active {
    color: #E2E8F0;
    background-color: #1E293B;
    border-left: 2px solid #00D4AA;
    padding-left: calc(1rem - 2px);
}

/* ===== HEADER BAR ===== */
#header-bar {
    height: 3.75rem;
    background-color: rgba(11, 14, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1E293B;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    position: fixed;
    top: 0;
    left: 300px;
    right: 0;
    z-index: 50;
}

#page-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #E2E8F0;
    padding-left: 0.75rem;
    border-left: 2px solid #00D4AA;
}

/* ===== MAIN CONTENT ===== */
#main-content {
    margin-left: 300px;
    margin-top: 3.75rem;
    padding: 1.45rem 2rem 2rem;
    flex: 1;
    min-width: 0;
}

/* ===== METRIC CARDS ===== */
.metric-card {
    background-color: #1A2332;
    border: 1px solid #1E293B;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    border-color: rgba(0, 212, 170, 0.25);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.08);
}

.metric-label {
    color: #8B9DC3;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.metric-value {
    color: #E2E8F0;
    font-size: 1.6rem;
    font-weight: 600;
}

/* ===== HEADINGS ===== */
h1 {
    color: #E2E8F0;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

h2 {
    color: #E2E8F0;
    font-weight: 600;
    border-bottom: 1px solid #1E293B;
    padding-bottom: 0.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

h3 {
    color: #8B9DC3;
    font-weight: 600;
    margin-top: 1.5rem;
    font-size: 1rem;
}

/* ===== DIVIDERS ===== */
hr {
    border: none;
    border-top: 1px solid #1E293B;
    margin: 1.5rem 0;
}

/* ===== PLOTLY CHART CONTAINERS ===== */
.chart-container {
    border: 1px solid #1E293B;
    border-radius: 8px;
    padding: 0.25rem;
    margin-bottom: 1rem;
    background-color: #0F1318;
}

/* ===== AG GRID DARK THEME ===== */
.ag-theme-alpine-dark {
    --ag-background-color: #0F1318;
    --ag-header-background-color: #1A2332;
    --ag-header-foreground-color: #8B9DC3;
    --ag-foreground-color: #E2E8F0;
    --ag-row-hover-color: #1A2332;
    --ag-odd-row-background-color: #141922;
    --ag-border-color: #1E293B;
    --ag-secondary-foreground-color: #8B9DC3;
    --ag-header-column-separator-display: none;
    --ag-font-family: 'Source Sans 3', sans-serif;
    --ag-font-size: 13px;
    --ag-header-font-size: 12px;
    --ag-header-font-weight: 600;
    --ag-cell-horizontal-padding: 10px;
    --ag-row-height: 32px;
    --ag-header-height: 36px;
    --ag-selected-row-background-color: rgba(0, 212, 170, 0.15);
    --ag-range-selection-border-color: #00D4AA;
    --ag-input-focus-border-color: #00D4AA;
    --ag-pagination-active-color: #00D4AA;
}

.ag-theme-alpine-dark .ag-header-cell-text {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ag-theme-alpine-dark .ag-cell-label-container {
    gap: 6px;
    justify-content: flex-end;
}

.ag-theme-alpine-dark .ag-header-cell-label {
    flex-grow: 0;
}

.ag-theme-alpine-dark .ag-right-aligned-header .ag-header-cell-filter-button {
    order: 1;
}

.ag-theme-alpine-dark .ag-right-aligned-header .ag-sort-indicator-icon {
    padding-left: 0;
    padding-right: var(--ag-spacing);
}

.ag-theme-alpine-dark .ag-header-cell-filter-button {
    opacity: 0.4;
    transition: opacity 0.15s ease;
    --ag-icon-size: 12px;
}

.ag-theme-alpine-dark .ag-header-cell-filter-button:hover {
    opacity: 1;
}

.ag-theme-alpine-dark .ag-paging-panel {
    color: #8B9DC3;
}

.ag-theme-alpine-dark .ag-floating-filter-input input,
.ag-theme-alpine-dark .ag-text-field-input {
    background-color: #141922;
    color: #E2E8F0;
    border-color: #1E293B;
}

.ag-theme-alpine-dark .ag-floating-filter-input input:focus,
.ag-theme-alpine-dark .ag-text-field-input:focus {
    border-color: #00D4AA;
}

.ag-theme-alpine-dark a {
    color: #00D4AA;
    text-decoration: none;
}

.ag-theme-alpine-dark a:hover {
    color: #33E0BF;
    text-decoration: underline;
}

/* ===== GO BUTTON ===== */
.go-btn {
    background-color: #1A2332;
    color: #00D4AA;
    border: 1px solid rgba(0, 212, 170, 0.25);
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.go-btn:hover {
    background-color: #00D4AA;
    color: #0B0E14;
    border-color: #00D4AA;
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
}

/* ===== LINKS ===== */
a {
    color: #00D4AA;
    text-decoration: none;
}

a:hover {
    color: #33E0BF;
    text-decoration: underline;
}

/* ===== SUCCESS / INFO BOXES ===== */
.alert-success {
    background-color: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.25);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #00D4AA;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #3B82F6;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #EF4444;
    margin-bottom: 1rem;
}

/* Radio / checkbox option labels should not inherit uppercase/block from sidebar labels */
#sidebar-controls label.dash-options-list-option {
    text-transform: none;
    display: flex;
    align-items: center;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0B0E14;
}

::-webkit-scrollbar-thumb {
    background: #1E293B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2D3B50;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #sidebar {
        display: none;
    }
    #header-bar {
        left: 0;
    }
    #main-content {
        margin-left: 0;
    }
}

/* ===== ORBIT 3D WIDGET ===== */
#orbit-3d-container {
    flex: 1;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: #0F1318;
    position: relative;
}
.orbit-controls {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto;
}
.orbit-controls-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Source Sans 3', sans-serif;
}
.orbit-controls-btns button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    line-height: 1;
}
.orbit-controls-btns button:hover {
    background: rgba(0, 212, 170, 0.2);
    color: #00D4AA;
    border-color: rgba(0, 212, 170, 0.4);
}
.orbit-help {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Source Sans 3', sans-serif;
    pointer-events: none;
}

/* ===== ORBIT ELEMENTS TABLE ===== */
.orbit-elements-table td {
    padding: 3px 12px 3px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.orbit-elements-table tr:last-child td {
    border-bottom: none;
}
