/* ==========================================================
   CHART NAVIGATION CONTROLS — Single Source of Truth
   Zoom In/Out · Previous/Next · Reset
   ========================================================== */

/* ── Container ── */
.floating-chart-nav {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 100;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* ── Hover reveal ── */
.chart-container:hover .floating-chart-nav,
.floating-chart-nav:focus-within {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Button group ── */
.floating-btn-group {
    display: flex;
    align-items: center;
    background: var(--ui-panel);
    border: 1px solid var(--ui-panel-border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    overflow: hidden;
}

.floating-btn-group .divider {
    width: 1px;
    height: 16px;
    background: var(--ui-panel-border);
    opacity: 0.6;
}

/* ── Shared button reset ── */
.floating-chart-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ui-fg);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    margin: 0;
    padding: 0;
}

/* ── Standalone reset button ── */
.floating-chart-nav button.standalone-btn {
    background: var(--ui-panel);
    border: 1px solid var(--ui-panel-border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* ── Hover / active states ── */
.floating-chart-nav button:hover {
    background: var(--ui-button-hover);
    color: var(--chart-axis-fg);
}

.floating-chart-nav button.standalone-btn:active {
    transform: scale(0.95);
}

/* ── Icon inherit colour ── */
.floating-chart-nav button svg {
    pointer-events: none;
    color: inherit;
}

/* ==========================================================
   Responsive Overrides
   ========================================================== */

/* Touch devices — always visible */
@media (hover: none) {
    .floating-chart-nav {
        opacity: 0.7;
        visibility: visible;
        pointer-events: auto;
    }
    .chart-container:hover .floating-chart-nav {
        opacity: 1;
    }
    .floating-chart-nav:active {
        opacity: 1;
    }
}

/* ==========================================================================
   RESPONSIVE OVERRIDES FOR PANE WIDTHS (.nav-size-medium / .nav-size-small)
   ========================================================================== */

/* ---- Medium Mode ---- */
.floating-chart-nav.nav-size-medium {
    gap: 4px;
    padding: 3px;
}
.floating-chart-nav.nav-size-medium button {
    width: 26px;
    height: 26px;
}
.floating-chart-nav.nav-size-medium .floating-btn-group,
.floating-chart-nav.nav-size-medium button.standalone-btn {
    border-radius: 6px;
}
.floating-chart-nav.nav-size-medium button svg {
    transform: scale(0.85);
}
.floating-chart-nav.nav-size-medium .floating-btn-group .divider {
    height: 12px;
}

/* ---- Small / Extra-Compact Mode ---- */
.floating-chart-nav.nav-size-small {
    gap: 3px;
    padding: 2px;
}
.floating-chart-nav.nav-size-small button {
    width: 20px;
    height: 20px;
}
.floating-chart-nav.nav-size-small .floating-btn-group,
.floating-chart-nav.nav-size-small button.standalone-btn {
    border-radius: 4px;
}
.floating-chart-nav.nav-size-small button svg {
    transform: scale(0.7);
}
.floating-chart-nav.nav-size-small .floating-btn-group .divider {
    height: 10px;
}

/* ==========================================================
   CHART HEADER — permanent bar below the application toolbar
   ========================================================== */

#chart-header {
    position: absolute;
    top: var(--topbar-h, 50px);
    left: 44px;
    right: 46px;
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--ui-panel, #1e222d);
    border-bottom: 1px solid var(--ui-panel-border, #2a2e39);
    z-index: 100;
    user-select: none;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ── Left: instrument display name + OHLC ── */
.chart-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chart-header-symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-fg, #d1d4dc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-header-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #26a69a;
    box-shadow: 0 0 4px rgba(38,166,154,0.6);
    flex-shrink: 0;
}

.chart-header-dot.inactive {
    background: #ef5350;
    box-shadow: 0 0 4px rgba(239,83,80,0.5);
}

/* ── OHLC values ── */
.chart-header-ohlc {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ui-fg, #d1d4dc);
    white-space: nowrap;
}

.ch-header-ohlc-label {
    color: #000000;
    font-size: 13px;
    font-weight: 600;
    margin-right: 1px;
}

.ch-header-ohlc-val {
    font-weight: 600;
}

.ch-header-h {
    color: #26a69a;
}

.ch-header-l {
    color: #ef5350;
}

.ch-header-chg-pos {
    color: #26a69a;
}

.ch-header-chg-neg {
    color: #ef5350;
}

/* Separator between O/H/L/C — adds group spacing */
.ch-header-sep {
    color: var(--ui-muted, #787b86);
    opacity: 0.35;
    margin: 0 6px;
}

/* ── Timezone label (far right, after OHLC) ── */
.chart-header-tz {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: #000000;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    user-select: none;
}
