/*
 * Bootstrap 5 state compatibility.
 *
 * The Bootstrap JavaScript was upgraded to v5 (bootstrap.bundle.min.js, jQuery-free),
 * but the stylesheet stays Bootstrap 3 to preserve the app's heavily-customized
 * appearance with zero visual regression. BS5's JS toggles a few component state
 * classes that differ from BS3's (BS3 used `.in`, BS5 uses `.show`). These rules
 * bridge just those states so BS5-driven tooltips and dropdowns display correctly
 * on top of the BS3 stylesheet. Loaded right after bootstrap.css.
 */

/* Dropdowns: BS5 toggles `.show`; BS3 CSS only shows via inline display. */
.dropdown-menu.show {
    display: block;
}

/* Tooltips: BS5 markup is `.tooltip.show` with `.tooltip-arrow` (BS3 used `.in`
   and `.tooltip-arrow`). Keep BS3's look, just honour the BS5 shown state. */
.tooltip.show {
    opacity: 0.9;
}
.tooltip .tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
}

/* Fade utility: BS5 uses `.fade.show` for the visible state. */
.fade.show {
    opacity: 1;
}

/* Collapse: BS5 uses `.collapse.show` (BS3 used `.collapse.in`). */
.collapse.show {
    display: block;
}

/* The button-group markup was renamed data-toggle="buttons" -> data-bs-toggle="buttons"
   for BS5's data-api, but BS3's rule hiding the radio/checkbox inputs keyed off the
   old attribute. Re-add it under the new attribute so the inputs stay hidden inside
   the styled button labels (the .active toggle is handled by bootstrap-jquery-bridge.js). */
[data-bs-toggle="buttons"] > .btn > input[type="radio"],
[data-bs-toggle="buttons"] > .btn > input[type="checkbox"] {
    display: none;
}

/* BS5 re-theme Phase B (TEMPORARY — delete in Phase D): the BS3 `.label` badge
   -> BS5 `.badge` + `.text-bg-*`. This lives here (after bootstrap.css) rather than
   in bs5-forward-compat.css because BS3 also defines `.badge` (the pill counter,
   unused in this app) — loading after lets these rules win. Values copied verbatim
   from bootstrap.css .label* rules. */
.badge {
    display: inline;
    min-width: 0;                 /* neutralise BS3 .badge min-width:10px */
    padding: .2em .6em .3em;
    font-size: 75%;
    font-weight: bold;
    line-height: 1;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    background-color: transparent; /* BS3 .label had none; .text-bg-* set the colour */
    border-radius: .25em;
}
.badge:empty {
    display: none;
}
.text-bg-secondary { background-color: #999999; }  /* was .label-default */
.text-bg-success   { background-color: #5cb85c; }
.text-bg-info      { background-color: #5bc0de; }
.text-bg-danger    { background-color: #d9534f; }
