/**
 * Bootstrap 3 → Bootstrap 5 Compatibility Shim
 *
 * Maps removed/renamed Bootstrap 3.3.7 classes to Bootstrap 5.3.8 equivalents.
 * Load this file immediately AFTER the Bootstrap 5 CSS.
 */

/* ==========================================================================
   Section 1: Grid Offset Aliases
   BS3: col-{breakpoint}-offset-{n}  →  BS5: offset-{breakpoint}-{n}
   ========================================================================== */

.col-sm-offset-1  { margin-left: 8.33333333%; }
.col-sm-offset-2  { margin-left: 16.66666667%; }
.col-sm-offset-3  { margin-left: 25%; }
.col-sm-offset-4  { margin-left: 33.33333333%; }
.col-sm-offset-5  { margin-left: 41.66666667%; }
.col-sm-offset-6  { margin-left: 50%; }
.col-sm-offset-7  { margin-left: 58.33333333%; }
.col-sm-offset-8  { margin-left: 66.66666667%; }
.col-sm-offset-9  { margin-left: 75%; }
.col-sm-offset-10 { margin-left: 83.33333333%; }
.col-sm-offset-11 { margin-left: 91.66666667%; }

.col-md-offset-1  { margin-left: 8.33333333%; }
.col-md-offset-2  { margin-left: 16.66666667%; }
.col-md-offset-3  { margin-left: 25%; }
.col-md-offset-4  { margin-left: 33.33333333%; }
.col-md-offset-5  { margin-left: 41.66666667%; }
.col-md-offset-6  { margin-left: 50%; }
.col-md-offset-7  { margin-left: 58.33333333%; }
.col-md-offset-8  { margin-left: 66.66666667%; }
.col-md-offset-9  { margin-left: 75%; }
.col-md-offset-10 { margin-left: 83.33333333%; }
.col-md-offset-11 { margin-left: 91.66666667%; }

.col-lg-offset-1  { margin-left: 8.33333333%; }
.col-lg-offset-2  { margin-left: 16.66666667%; }
.col-lg-offset-3  { margin-left: 25%; }
.col-lg-offset-4  { margin-left: 33.33333333%; }
.col-lg-offset-5  { margin-left: 41.66666667%; }
.col-lg-offset-6  { margin-left: 50%; }
.col-lg-offset-7  { margin-left: 58.33333333%; }
.col-lg-offset-8  { margin-left: 66.66666667%; }
.col-lg-offset-9  { margin-left: 75%; }
.col-lg-offset-10 { margin-left: 83.33333333%; }
.col-lg-offset-11 { margin-left: 91.66666667%; }

/* ==========================================================================
   Section 2: Panel → Card Mapping
   BS3 panels were removed in BS4+, replaced by cards.
   ========================================================================== */

.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-default {
    border-color: #ddd;
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background-color: #f5f5f5;
    color: #333;
}

.panel-body {
    padding: 15px;
}

.panel-body::after {
    display: table;
    content: "";
    clear: both;
}

.panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
}

/* ==========================================================================
   Section 3: Form Compatibility
   BS3 form classes removed/renamed in BS5.
   ========================================================================== */

.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.form-group {
    margin-bottom: 15px;
}

.control-label {
    padding-top: 7px;
    margin-bottom: 0;
    font-weight: 700;
}

.form-horizontal .control-label {
    text-align: right;
}

.form-control-static {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
    margin-bottom: 0;
    border: none;
    background-color: transparent;
    box-shadow: none;
}

.has-feedback {
    position: relative;
}

.has-feedback .form-control-feedback {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    pointer-events: none;
}

/* ==========================================================================
   Section 4: Button Sizes
   BS3 btn-xs was removed in BS4+.
   ========================================================================== */

.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* ==========================================================================
   Section 5: Utility Classes
   BS3 pull-left/right replaced by float-start/end in BS5.
   ========================================================================== */

.pull-left {
    float: left !important;
}

.pull-right {
    float: right !important;
}

.center-block {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

/* ==========================================================================
   Section 6: Label Component
   BS3 .label → BS5 .badge. Scoped to avoid conflicts with <label> elements.
   ========================================================================== */

span.label,
a.label {
    display: inline;
    padding: 0.2em 0.6em 0.3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25em;
}

span.label:empty,
a.label:empty {
    display: none;
}

.label-default {
    background-color: #777;
}

.label-primary {
    background-color: #337ab7;
}

.label-success {
    background-color: #5cb85c;
}

.label-info {
    background-color: #5bc0de;
}

.label-warning {
    background-color: #f0ad4e;
}

.label-danger {
    background-color: #d9534f;
}

/* ==========================================================================
   Section 7: Screen Reader Utility
   BS3 .sr-only → BS5 .visually-hidden
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ==========================================================================
   Section 8: Glyphicon → Font Awesome Mapping
   BS3 Glyphicons removed in BS4+. Maps used icons to Font Awesome 4.7.
   ========================================================================== */

.glyphicon {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: "FontAwesome";
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.glyphicon-plus::before          { content: "\f067"; }
.glyphicon-eye-open::before      { content: "\f06e"; }
.glyphicon-remove::before        { content: "\f00d"; }
.glyphicon-chevron-left::before  { content: "\f053"; }
.glyphicon-chevron-right::before { content: "\f054"; }
.glyphicon-pencil::before        { content: "\f040"; }
.glyphicon-chevron-up::before    { content: "\f077"; }
.glyphicon-chevron-down::before  { content: "\f078"; }
.glyphicon-time::before          { content: "\f017"; }
.glyphicon-calendar::before      { content: "\f073"; }

/* Generic form-control-feedback glyphicon (no specific icon, just positioning) */
.glyphicon.form-control-feedback::before {
    content: "";
}

/* ==========================================================================
   Section 9: Close Button + Modal Header Ordering
   BS3 .close was removed in BS5 (replaced by .btn-close).
   BS5 modal-header uses flexbox — BS3 markup has close button before title
   in DOM, so we need order:1 to keep it visually on the right.
   ========================================================================== */

.close {
    padding: 0;
    background-color: transparent;
    border: 0;
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

button.close {
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.modal-header .close {
    order: 1;
    margin-left: auto;
    float: none;
}

/* ==========================================================================
   Section 10: Typography Baseline
   BS3 body font-size was 14px; BS5 uses 1rem (16px).
   BS3 line-height was 1.42857143; BS5 uses 1.5.
   ========================================================================== */

body {
    font-size: 14px;
    line-height: 1.42857143;
}

.form-control {
    font-size: 14px;
}

/* ==========================================================================
   Section 11: Read-Only Form Controls
   BS3 styled .form-control[readonly] with a grey background.
   BS5 removed this — readonly inputs look identical to editable ones.
   ========================================================================== */

.form-control[readonly] {
    background-color: #e9ecef;
}

.placeholder {
    background-color: transparent;
}