/* Bootstrap 5 migration overrides */

/* Keep .container at Bootstrap 4 max-widths. BS5 added the xxl breakpoint
   which widens .container to 1320px on screens >= 1400px; BS4 capped at 1140px.
   Only the xxl step is overridden, so the smaller breakpoints stay untouched. */
@media (min-width: 1400px) {
    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-xxl {
        max-width: 1140px;
    }
}

/* Navbar dropdown menus stay absolute (BS4 behavior). In a navbar without
   .navbar-expand-*, BS5 makes .dropdown-menu position:static, so opening it
   reflows the navbar and shifts the right-aligned user text sideways. */
.navbar-nav .dropdown-menu {
    position: absolute;
}

/* BS5 underlines links by default; BS4 did not. Restore BS4: no underline,
   underline only on hover. */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons rendered as links (.btn on an <a>, e.g. admin "Add", "View", "Edit"
   actions) are controls, not content - never underline, including on hover/focus.
   Higher specificity (a.btn) beats the global `a:hover` rule above regardless of
   source order. */
a.btn,
a.btn:hover,
a.btn:focus {
    text-decoration: none;
}

/* Nav links and dropdown items are navigation, not content - never underline. */
.nav-link:hover,
.nav-link:focus,
.dropdown-item:hover,
.dropdown-item:focus {
    text-decoration: none;
}

/* BS5 scopes .navbar-brand sizing/color to CSS vars defined on .navbar, so a
   .navbar-brand used outside a navbar (the admin sidebar brand in myapp3) loses
   its font-size, padding and color and renders small/black. Restore the BS4
   hardcoded values. */
.navbar-brand {
    display: inline-block;
    padding-top: .3125rem;
    padding-bottom: .3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    line-height: inherit;
    white-space: nowrap;
    color: #007bff;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #0056b3;
    text-decoration: none;
}

/* Footer links: no underline by default, underline on hover. The higher
   specificity beats page-level `a:hover { text-decoration: none }` rules
   (e.g. standards/show) so footer hover is consistent everywhere. */
footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* BS5 shrank .list-group-item padding (.5rem 1rem) vs BS4 (.75rem 1.25rem).
   Restore BS4 padding so the sidebar menu / lists keep their vertical spacing. */
.list-group-item {
    padding: .75rem 1.25rem;
}

/* Sidebar (hamburger) menu links underline on hover. Higher specificity beats
   page-level `a:hover { text-decoration: none }` rules (e.g. standards/show)
   so hover is consistent with the main page. */
.list-group-item a:hover {
    text-decoration: underline;
}

/* Tom Select "Select All / Select None" toolbar, restoring bootstrap-select's
   old data-actions-box. Pinned at the top of the dropdown above the options. */
.ts-dropdown .ts-actions-box {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem .75rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.ts-dropdown .ts-actions-box button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--bs-link-color, #0d6efd);
    font-size: .875rem;
    cursor: pointer;
}

.ts-dropdown .ts-actions-box button:hover {
    text-decoration: underline;
}
