/*
 * Bootstrap 3 → 5 compatibility shim
 * Restores removed/renamed classes used throughout this app's templates.
 */

/* ─── Grid (BS3 col-md-* used in a few templates) ───────────────────────── */
/* BS5 keeps col-md-* but requires .row to be a flex container, which it is.
   The only missing piece is col-md-offset-* (renamed to offset-md-* in BS5). */
.col-md-offset-1 {
    margin-left: 8.33333%;
}
.col-md-offset-2 {
    margin-left: 16.66667%;
}
.col-md-offset-3 {
    margin-left: 25%;
}
.col-md-offset-4 {
    margin-left: 33.33333%;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

/* btn-block: removed in BS5 */
.btn-block {
    display: block;
    width: 100%;
}
.btn-block + .btn-block {
    margin-top: 5px;
}

/* btn-default: removed in BS5 (maps to btn-secondary) */
.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

/* btn-medium: custom class used in this app — same size as btn-sm */
.btn-medium {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* ─── Input group ────────────────────────────────────────────────────────── */

/* input-group-btn: replaced by direct flex children in BS5 */
.input-group-btn {
    display: flex;
    align-items: stretch;
    white-space: nowrap;
}
.input-group-btn > .btn {
    position: relative;
    border-radius: 0;
}
.input-group-btn:first-child > .btn {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-left: -1px;
}

/* ─── Dropdown ───────────────────────────────────────────────────────────── */

/* dropdown-menu-right: renamed to dropdown-menu-end in BS5 */
.dropdown-menu-right {
    right: 0;
    left: auto;
}

/* caret: removed in BS5 */
.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */

/* form-horizontal: removed in BS5 */
.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
    align-items: center;
}
.form-horizontal .control-label {
    padding-top: 7px;
    text-align: right;
}

/* control-group: BS2-era class still used here, equivalent to form-group */
.control-group {
    margin-bottom: 15px;
}

/* .checkbox wrapper: BS3-style indented checkbox layout */
.checkbox {
    position: relative;
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}
.checkbox label {
    min-height: 20px;
    padding-left: 20px;
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}
.checkbox input[type='checkbox'] {
    position: absolute;
    margin-top: 4px;
    margin-left: -20px;
}

/* form-control-inline: custom app class — inline-sized form control */
.form-control-inline {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}

/* ─── Panel ──────────────────────────────────────────────────────────────── */

.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-default {
    border-color: #ddd;
}
.panel-default > .panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}
.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}
.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
}
.panel-body {
    padding: 15px;
}
.panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}
.panel-group {
    margin-bottom: 20px;
}
.panel-group .panel {
    margin-bottom: 0;
    border-radius: 4px;
}
.panel-group .panel + .panel {
    margin-top: 5px;
}

/* ─── Jumbotron ──────────────────────────────────────────────────────────── */

.jumbotron {
    padding: 30px 15px;
    margin-bottom: 30px;
    background-color: #eee;
    border-radius: 6px;
}
.jumbotron h1,
.jumbotron .h1 {
    color: inherit;
}
@media screen and (min-width: 768px) {
    .jumbotron {
        padding: 48px 60px;
    }
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

/* .close button: still in markup on some older pages */
.modal-header .close {
    padding: 0;
    background: transparent;
    border: 0;
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    opacity: 0.2;
    cursor: pointer;
}
.modal-header .close:hover {
    opacity: 0.5;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

/* BS3 used "active in" to show a tab pane; BS5 uses "active show" */
.tab-pane.active.in {
    display: block;
}
