﻿/* =========================================================
   Bootstrap 3 -> Bootstrap 5 migration (compat) helpers
   Add this file AFTER bootstrap.min.css (v5) and BEFORE/AFTER site.css as needed.
   ========================================================= */

/* ---------- Visibility / Responsive visibility ---------- */

/* BS3: .hidden */
.hidden {
    display: none !important;
}

/* BS3: .show — REMOVED. BS5 uses .show contextually (collapse, dropdown, modal, etc.).
   A global .show { display: block !important } conflicts with BS5 components.
   Use .d-block if you need a generic visibility helper. */

/* BS3: hidden-* (approximation using BS5 breakpoints)
   NOTE: BS3 breakpoints differ slightly; verify on key screens. */
.hidden-xs {
    display: none !important;
}

@media (min-width: 576px) {
    .hidden-xs {
        display: initial !important;
    }
}
/* show from sm */

@media (min-width: 576px) and (max-width: 767.98px) {
    .hidden-sm {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hidden-md {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .hidden-lg {
        display: none !important;
    }
}

/* BS3: visible-*-* (basic)
   You may not need these; keep only if your project uses them. */
.visible-xs, .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block {
    display: none !important;
}

@media (max-width: 575.98px) {
    .visible-xs {
        display: block !important;
    }

    .visible-xs-block {
        display: block !important;
    }

    .visible-xs-inline {
        display: inline !important;
    }

    .visible-xs-inline-block {
        display: inline-block !important;
    }
}

.visible-sm, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block {
    display: none !important;
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .visible-sm {
        display: block !important;
    }

    .visible-sm-block {
        display: block !important;
    }

    .visible-sm-inline {
        display: inline !important;
    }

    .visible-sm-inline-block {
        display: inline-block !important;
    }
}

.visible-md, .visible-md-block, .visible-md-inline, .visible-md-inline-block {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .visible-md {
        display: block !important;
    }

    .visible-md-block {
        display: block !important;
    }

    .visible-md-inline {
        display: inline !important;
    }

    .visible-md-inline-block {
        display: inline-block !important;
    }
}

.visible-lg, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block {
    display: none !important;
}

@media (min-width: 992px) {
    .visible-lg {
        display: block !important;
    }

    .visible-lg-block {
        display: block !important;
    }

    .visible-lg-inline {
        display: inline !important;
    }

    .visible-lg-inline-block {
        display: inline-block !important;
    }
}

/* ---------- Float helpers ---------- */

.pull-right {
    float: right !important;
}

.pull-left {
    float: left !important;
}

/* ---------- Text alignment helpers ---------- */

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

/* ---------- Centering helpers ---------- */

.center-block {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ---------- Images ---------- */

.img-responsive {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* ---------- Panels -> Cards (visual compatibility, not markup conversion) ---------- */

.panel {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
    margin-bottom: 1rem;
    background-color: var(--bs-body-bg, #fff);
}

.panel-heading {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-top-left-radius: calc(.375rem - 1px);
    border-top-right-radius: calc(.375rem - 1px);
}

.panel-title {
    margin: 0;
    font-size: 1rem;
}

.panel-body {
    padding: 1rem;
}

.panel-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-bottom-left-radius: calc(.375rem - 1px);
    border-bottom-right-radius: calc(.375rem - 1px);
}

/* Common contextual panels (approx)
   Adjust colors to match your design if needed. */
.panel-default {
    border-color: var(--bs-border-color, #dee2e6);
}

.panel-primary {
    border-color: rgba(13,110,253,.35);
}

.panel-success {
    border-color: rgba(25,135,84,.35);
}

.panel-info {
    border-color: rgba(13,202,240,.35);
}

.panel-warning {
    border-color: rgba(255,193,7,.35);
}

.panel-danger {
    border-color: rgba(220,53,69,.35);
}

/* ---------- Wells ---------- */

.well {
    padding: 1rem;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
}

/* ---------- Thumbnails ---------- */

.thumbnail {
    padding: .25rem;
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
}

    .thumbnail > img,
    .thumbnail a > img {
        max-width: 100%;
        height: auto;
    }

/* ---------- Forms (lightweight compatibility) ---------- */

.form-group {
    margin-bottom: 1rem;
}

/* BS3: .control-label */
.control-label {
    margin-bottom: .5rem;
}

/* BS3: .help-block */
.help-block {
    display: block;
    margin-top: .25rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* ---------- Form-check alignment in .row + col-form-label layouts ---------- */
/* col-form-label adds padding-top: calc(0.375rem + 1px) to align its text
   with the vertical mid-point of a standard form control.  Columns that hold
   radio/checkbox inputs instead of a text input need the same top padding so
   the controls sit on the same baseline as the label. */
.radio-container,
.checkbox-container {
    padding-top: calc(0.375rem + 1px);
    padding-bottom: calc(0.375rem + 1px);
}

.radio-container .form-check,
.checkbox-container .form-check {
    margin-bottom: 0;
}

/* BS3: input sizing */
.input-lg {
    padding: .75rem 1rem !important;
    font-size: 1.25rem !important;
    border-radius: .5rem !important;
}

.input-sm {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    border-radius: .25rem !important;
}

/* BS3: .btn-block */
.btn-block {
    display: block !important;
    width: 100% !important;
}

/* ---------- Labels / Badges ---------- */

.label {
    display: inline-block;
    padding: .35em .6em;
    font-size: .75em;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
}

.label-default {
    background-color: #6c757d;
}

.label-primary {
    background-color: #0d6efd;
}

.label-success {
    background-color: #198754;
}

.label-info {
    background-color: #0dcaf0;
    color: #000;
}

.label-warning {
    background-color: #ffc107;
    color: #000;
}

.label-danger {
    background-color: #dc3545;
}

/* BS3: .badge (BS5 badge exists but markup differs sometimes) */
.badge {
    vertical-align: baseline;
}

/* ---------- Alerts close button (BS3 .close) ---------- */

.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: currentColor;
    opacity: .5;
    text-decoration: none;
}

    .close:hover {
        opacity: .75;
    }

/* ---------- Misc ---------- */

/* BS3/BS4: select.form-control — Bootstrap 5 sets appearance:none on .form-control,
   removing the native dropdown arrow. Restore it using the same chevron as .form-select. */
select.form-control {
    background-image: var(--bs-form-select-bg-img, 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 5 6 6 6-6'/%3e%3c/svg%3e"));
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

select.form-control:disabled {
    background-image: var(--bs-form-select-bg-img, 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 5 6 6 6-6'/%3e%3c/svg%3e"));
    opacity: .6;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: .25rem;
    vertical-align: .25em;
    border-top: .4em solid;
    border-right: .4em solid transparent;
    border-left: .4em solid transparent;
}
.dropdown-item{
    font-size: 14px;
    padding: 3px 20px;
}
.dropdown-header{
    font-size: 12px;
}
.btn-link {
    border-color: transparent;
    background-color: transparent;
}

/* ---------- Buttons ---------- */

/* BS3: .btn-default (removed in BS4+) → secondary look */
.btn-default {
    color: var(--bs-body-color, #212529);
    background-color: var(--bs-body-bg, #fff);
    border-color: var(--bs-border-color, #dee2e6);
}
.btn-default:hover,
.btn-default:focus {
    color: var(--bs-body-color, #212529);
    background-color: #e9ecef;
    border-color: #dee2e6;
}
.btn-default:active,
.btn-default.active {
    background-color: #dee2e6;
    border-color: #ced4da;
}

/* BS3: .btn-xs (removed in BS4+) */
.btn-xs {
    padding: .125rem .375rem;
    font-size: .75rem;
    line-height: 1.5;
    border-radius: .2rem;
}

/* ---------- Glyphicons → Font Awesome mapping ---------- */

.glyphicon {
    display: inline-block;
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'FontAwesome', sans-serif;
    font-style: normal;
    font-weight: 900;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.glyphicon-search::before           { content: "\f002"; }
.glyphicon-plus::before             { content: "\f067"; }
.glyphicon-remove::before           { content: "\f00d"; }
.glyphicon-ok::before               { content: "\f00c"; }
.glyphicon-pencil::before           { content: "\f303"; }
.glyphicon-trash::before            { content: "\f1f8"; }
.glyphicon-cog::before              { content: "\f013"; }
.glyphicon-refresh::before          { content: "\f021"; }
.glyphicon-question-sign::before    { content: "\f059"; }
.glyphicon-exclamation-sign::before { content: "\f06a"; }
.glyphicon-file::before             { content: "\f15b"; }
.glyphicon-folder-open::before      { content: "\f07c"; }
.glyphicon-save::before             { content: "\f0c7"; }
.glyphicon-play::before             { content: "\f04b"; }
.glyphicon-check::before            { content: "\f00c"; }
.glyphicon-arrow-left::before       { content: "\f060"; }
.glyphicon-pushpin::before          { content: "\f08d"; }

/* ---------- Input groups (BS3 compat) ---------- */

.input-group-addon {
    display: flex;
    align-items: center;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color, #212529);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bs-tertiary-bg, #e9ecef);
    border: var(--bs-border-width) solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius);
}

.input-group-btn {
    display: flex;
}
.input-group-btn > .btn {
    border-radius: 0;
}
.input-group-btn:last-child > .btn {
    border-top-right-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
}
.input-group-btn:first-child > .btn {
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
}

/* ---------- BS3 .form-row → BS5 uses .row ---------- */

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}
.form-row > .col,
.form-row > [class*="col-"] {
    padding-right: 5px;
    padding-left: 5px;
}

/* ---------- BS3 progress bar contextual classes ---------- */

.progress-bar-info {
    background-color: var(--bs-info, #0dcaf0) !important;
}
.progress-bar-success {
    background-color: var(--bs-success, #198754) !important;
}
.progress-bar-warning {
    background-color: var(--bs-warning, #ffc107) !important;
}
.progress-bar-danger {
    background-color: var(--bs-danger, #dc3545) !important;
}

/* ---------- BS3 img-circle → rounded-circle ---------- */

.img-circle {
    border-radius: 50% !important;
}

/* ---------- BS3 img-rounded ---------- */

.img-rounded {
    border-radius: .375rem !important;
}
.btn-info, .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active {
    color: #fff;
}
