/* The Summary sub-bar: one thin settings row of a view (Structure, Variant effect, Orthologs, Custom regions), and the
   classes it is made of. Imported by style.css (Summary) and loaded alone by the complex panel's "viewport" layout
   (Helper_Functions/js/complex_panel.js), so the two draw the same bar. */
.summary-subbar { --summary-subbar-h: 2.3125rem; }
/* A view's own settings: one thin row under the command bar, shown only in that view (Structure,
   Variant effect, Orthologs; Custom regions' head is the same height). The panel carries a 1 px
   top border, so its minimum is the head's height plus that border; the row wraps only when the
   width runs out (an embed in a narrow frame), where it is allowed to grow. */
.summary-subbar {
    display: flex;
    align-items: center;
    min-height: calc(var(--summary-subbar-h) + 1px);
    padding: 0.2rem 0.75rem;
    background: var(--bs-body-bg);
}
.summary-subbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}
.summary-subbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}
.summary-subbar-group .summary-cmdbar-kicker {
    white-space: nowrap;
}
/* Variant effect: Functional map | Compare predictors is one choice of two (the segmented control, as Structure's
   PDB | AlphaFold), with the marks that belong to the Functional map side after it, set off by a neutral divider.
   The active segment is filled in the token colour (`.summary-visual-mode-group .btn.active`) and is the mode
   indicator; the marks dim, and their switches are off, while Compare is on. */
.summary-ve-modebox {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.summary-ve-modebox .btn {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}
.summary-ve-marks {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-left: 0.6rem;
    border-left: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
}
.summary-ve-marks > :not(.summary-ve-marks-hint) {
    transition: opacity 0.12s ease;
}
.summary-ve-modebox.is-compare .summary-ve-marks > :not(.summary-ve-marks-hint) {
    opacity: 0.4;
}
.summary-ve-modebox.is-compare .summary-ve-marks .form-check {
    pointer-events: none;
}
.summary-ve-marks-hint {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}
.summary-ve-marks-hint:empty {
    display: none;
}
.summary-subbar-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.3rem 0.1rem;
    background: var(--bs-border-color-translucent, var(--bs-border-color));
}
.summary-subbar .form-check-label {
    font-size: 0.82rem;
    white-space: nowrap;
}
.summary-subbar-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}
.summary-subbar-title .material-symbols-outlined {
    font-size: 1.15rem;
}
.summary-subbar-note {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.summary-subbar .btn-sm,
.summary-subbar .form-select-sm,
.summary-subbar .form-control-sm {
    height: 1.75rem;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.82rem;
    line-height: 1.2;
}
.summary-subbar .btn-sm {
    display: inline-flex;
    align-items: center;
}
.summary-subbar .form-check {
    min-height: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-left: 0;
}
.summary-subbar .form-check .form-check-input {
    float: none;
    margin: 0;
}
.summary-subbar-select {
    width: auto;
    max-width: 17rem;
    min-width: 8rem;
}
#summary-ortholog-level {
    max-width: 14rem;
}
/* Structure's bar holds the most (source, entry, two switches, three chips): the entry picker gives way first,
   so the bar stays one row at 1366 px. */
#summary-structure-pdb-select {
    max-width: 12rem;
}
@media (min-width: 1600px) {
    #summary-structure-pdb-select {
        max-width: 17rem;
    }
}


/* The group label ("Origin", "Colour by"): the .dcv-kicker look, restated (discanvis-dashboard.css is not loaded on Summary). */
.summary-subbar .summary-cmdbar-kicker {
    font-size: var(--dcv-fs-kicker, 0.6875rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
    color: var(--bs-secondary-color);
    align-self: center;
    margin: 0 0.1rem 0 0.25rem;
    white-space: nowrap;
    user-select: none;
}

/* The segmented mode buttons of the sub-bars (`.summary-visual-mode-group`: Structure's PDB | AlphaFold, the View switch): icon and label,
   the inactive segment tinted, not blank. Also the complex panel's Origin and Colour by. (Moved here from style.css, which imports this file.) */
/* Unified Visual mode toggles: inactive outline must never read as “blank white” during heavy Plotly work. */
.summary-visual-mode-group > .btn.btn-outline-primary:not(.active) {
    background-color: rgba(var(--bs-primary-rgb), 0.07);
    border-color: rgba(var(--bs-primary-rgb), 0.42);
    /* Darker than --bs-primary so label + icons stay readable after losing .active (was filled / white text). */
    --bs-btn-color: var(--bs-primary-text-emphasis, #084298);
    color: var(--bs-btn-color);
    opacity: 1;
}
.summary-visual-mode-group > .btn.btn-outline-primary:not(.active) .material-symbols-outlined {
    color: inherit;
    opacity: 1;
}
.summary-visual-mode-group > .btn.btn-outline-primary:not(.active):hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    --bs-btn-color: var(--bs-primary-text-emphasis, #084298);
    color: var(--bs-btn-color);
}
.summary-visual-mode-group--plot-busy > .btn.btn-outline-primary:not(.active) {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    --bs-btn-color: var(--bs-primary-text-emphasis, #084298);
    color: var(--bs-btn-color);
    /* Own compositing layer so the control repaints even when the main thread is busy with Plotly */
    isolation: isolate;
    transform: translateZ(0);
    backface-visibility: hidden;
}
[data-bs-theme="dark"] .summary-visual-mode-group > .btn.btn-outline-primary:not(.active) {
    background-color: rgba(var(--bs-primary-rgb), 0.14);
    border-color: rgba(var(--bs-primary-rgb), 0.45);
    /* Keep body-like contrast on dark (primary alone can read as washed on tinted bg). */
    --bs-btn-color: var(--bs-body-color);
    color: var(--bs-btn-color);
}
[data-bs-theme="dark"] .summary-visual-mode-group > .btn.btn-outline-primary:not(.active):hover {
    --bs-btn-color: var(--bs-body-color);
    color: var(--bs-btn-color);
}
[data-bs-theme="dark"] .summary-visual-mode-group--plot-busy > .btn.btn-outline-primary:not(.active) {
    background-color: rgba(var(--bs-primary-rgb), 0.18);
    --bs-btn-color: var(--bs-body-color);
    color: var(--bs-btn-color);
}

/* A choice made with radio inputs (`input.btn-check` + `label.btn`, as Analysis' settings and VI's form draw them) instead of `.active`:
   the checked label is the filled segment, so the tint above does not cover it. */
.summary-visual-mode-group > .btn-check:checked + .btn.btn-outline-primary:not(.active) {
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
    color: var(--bs-btn-active-color);
}
.summary-visual-mode-group > .btn-check:focus-visible + .btn { box-shadow: var(--bs-btn-focus-box-shadow); }


/* Mode buttons: icon always, label only where there is room. Keeps the bar to
   one line down to tablet widths without hiding what the icons mean. */
.summary-visual-mode-group .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-color: transparent;
}
.summary-visual-mode-group .btn .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
}
.summary-visual-mode-group .btn:not(.active) {
    color: var(--bs-secondary-color);
}
.summary-visual-mode-group .btn.active {
    box-shadow: none;
}
