/*
 * Bootstrap 5 compatibility layer for the Bootstrap 4.3.1 stylesheet.
 *
 * The app loads Bootstrap 4.3.1 (css/bootstrap/bootstrap.min.css), but newer pages were written with Bootstrap 5
 * class names, which 4.3.1 does not define. Without this file those classes do nothing: spacing and gutters
 * disappear, selects are unstyled and "Loading..." text shows next to spinners.
 *
 * This file defines only the Bootstrap 5 classes the pages actually use, with Bootstrap 5's values, and must load
 * after bootstrap.min.css (see Components/App.razor). Bootstrap 4 classes keep working unchanged.
 * When the app moves to Bootstrap 5, delete this file.
 *
 * Spacer scale (as in Bootstrap): 0 = 0, 1 = .25rem, 2 = .5rem, 3 = 1rem, 4 = 1.5rem, 5 = 3rem.
 */

/* ---- Margin start/end (Bootstrap 4: ml-* / mr-*) ---- */
.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }
.me-auto { margin-right: auto !important; }

/* ---- Padding start/end (Bootstrap 4: pl-* / pr-*) ---- */
.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: .25rem !important; }
.ps-2 { padding-left: .5rem !important; }
.ps-3 { padding-left: 1rem !important; }
.ps-4 { padding-left: 1.5rem !important; }
.ps-5 { padding-left: 3rem !important; }

.pe-0 { padding-right: 0 !important; }
.pe-1 { padding-right: .25rem !important; }
.pe-2 { padding-right: .5rem !important; }
.pe-3 { padding-right: 1rem !important; }
.pe-4 { padding-right: 1.5rem !important; }
.pe-5 { padding-right: 3rem !important; }

/* ---- Gap (flex and grid containers) ---- */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* ---- Row gutters (g-*): horizontal and vertical space between columns, on .row only ---- */
.row.g-0 { margin-top: 0; margin-left: 0; margin-right: 0; }
.row.g-0 > * { margin-top: 0; padding-left: 0; padding-right: 0; }
.row.g-1 { margin-top: -.25rem; margin-left: -.125rem; margin-right: -.125rem; }
.row.g-1 > * { margin-top: .25rem; padding-left: .125rem; padding-right: .125rem; }
.row.g-2 { margin-top: -.5rem; margin-left: -.25rem; margin-right: -.25rem; }
.row.g-2 > * { margin-top: .5rem; padding-left: .25rem; padding-right: .25rem; }
.row.g-3 { margin-top: -1rem; margin-left: -.5rem; margin-right: -.5rem; }
.row.g-3 > * { margin-top: 1rem; padding-left: .5rem; padding-right: .5rem; }
.row.g-4 { margin-top: -1.5rem; margin-left: -.75rem; margin-right: -.75rem; }
.row.g-4 > * { margin-top: 1.5rem; padding-left: .75rem; padding-right: .75rem; }
.row.g-5 { margin-top: -3rem; margin-left: -1.5rem; margin-right: -1.5rem; }
.row.g-5 > * { margin-top: 3rem; padding-left: 1.5rem; padding-right: 1.5rem; }

/* ---- Text alignment and floats (Bootstrap 4: text-left/right, float-left/right) ---- */
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.float-start { float: left !important; }
.float-end { float: right !important; }

/* ---- Font weight and size ---- */
.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fs-1 { font-size: calc(1.375rem + 1.5vw) !important; }
.fs-2 { font-size: calc(1.325rem + .9vw) !important; }
.fs-3 { font-size: calc(1.3rem + .6vw) !important; }
.fs-4 { font-size: calc(1.275rem + .3vw) !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

/* ---- Screen-reader-only text (Bootstrap 4: sr-only); hides the "Loading..." label inside spinners ---- */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---- Forms: label and select (Bootstrap 4: custom-select) ----
   Page and container rules that already style .form-select (for example .main-container-multimage and the
   scoped FeeCollection / MIS search styles) are more specific and still win. */
.form-label {
    margin-bottom: .5rem;
}

.form-select {
    display: block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem 2.25rem .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
}

.form-select:disabled {
    background-color: #e9ecef;
}

.form-select[multiple],
.form-select[size]:not([size="1"]) {
    height: auto;
    padding-right: .75rem;
    background-image: none;
}

.form-select-sm {
    height: calc(1.5em + .5rem + 2px);
    padding-top: .25rem;
    padding-bottom: .25rem;
    padding-left: .5rem;
    font-size: .875rem;
}

.form-select-lg {
    height: calc(1.5em + 1rem + 2px);
    padding-top: .5rem;
    padding-bottom: .5rem;
    padding-left: 1rem;
    font-size: 1.25rem;
}
