/*
 * BS3 → BS5 Vendor Compatibility Shim
 *
 * Provides BS3-equivalent styles for third-party libraries (Summernote)
 * that still generate DOM elements with BS3 class names.
 * DO NOT use these classes in new project code — use BS5 equivalents.
 *
 * Step 12 Vendor Plugin Audit:
 *   ✅ bootstrap-datepicker  — jQuery-only, self-namespaced CSS. No changes needed.
 *   ✅ jquery.datetimepicker  — jQuery-only, no Bootstrap dependency. No changes needed.
 *   ✅ jquery.steps            — Self-namespaced .wizard/.tabcontrol CSS. No changes needed.
 *   ✅ chosen.jquery           — jQuery-only. No changes needed.
 *   ✅ jquery.validate         — jQuery-only. Already loaded in all layouts.
 *   🔶 Summernote (BS3 build) — Shimmed below (panel, close, col-xs-*, form-group, etc.).
 *                                Upgrade to summernote-bs5/summernote-lite deferred.
 *   🗑️ bootstrap-switch       — CSS removed from all templates (JS was never loaded/used).
 *   🗑️ bootstrapvalidator     — Dead code. Never loaded or called. Vendor dir can be deleted.
 *   🗑️ bootstrap-wysihtml5    — Dead code. Never loaded or referenced.
 *   🗑️ x-editable             — Not loaded in templates. Shims kept as safety net.
 */

/* ===================================================================
   Summernote Editor — BS3 panel compat
   The Summernote JS (BS3 build) creates elements with class="panel",
   "panel-heading", "panel-body", "panel-default".  These styles ensure
   the editor renders correctly under BS5.
   =================================================================== */

/* Outer editor wrapper: .note-editor.panel */
.note-editor.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #a9a9a9;
    border-radius: 4px;
}
.note-editor.panel.panel-default {
    border-color: #ddd;
}

/* Toolbar: .panel-heading.note-toolbar */
.panel-heading.note-toolbar {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

/* Editable area inheriting .panel-body — already styled by summernote.css,
   but ensure fallback padding */
.note-editor .note-editable.panel-body {
    padding: 10px;
}

/* ===================================================================
   Summernote — BS3 .close button compat
   Summernote dialogs may use BS3 button.close pattern
   =================================================================== */
.note-editor .close,
.note-modal .close {
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .2;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.note-editor .close:hover,
.note-modal .close:hover {
    opacity: .5;
}

/* ===================================================================
   BS3 Float Utilities — Vendor Compat
   Vendor JS (jquery.app.js, datatables.js, rwd-table.js, summernote)
   creates DOM elements with .pull-left / .pull-right and also uses
   them as jQuery selectors.  These definitions ensure those elements
   are styled and selectable.
   Project templates should use BS5 .float-start / .float-end instead.
   =================================================================== */
.pull-left {
    float: left !important;
}
.pull-right {
    float: right !important;
}

/* ===================================================================
   BS3 .center-block — Vendor Compat
   Used across templates, equivalent to BS5 d-block mx-auto.
   =================================================================== */
.center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================================================
   BS3 .img-circle / .img-rounded — Vendor Compat
   Summernote image toolbar uses these class names internally.
   =================================================================== */
.img-circle {
    border-radius: 50%;
}
.img-rounded {
    border-radius: 6px;
}

/* ===================================================================
   BS3 .thumbnail — Vendor Compat
   Used for voucher design images across templates.
   =================================================================== */
.thumbnail {
    display: block;
    padding: 4px;
    line-height: 1.42857143;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border .2s ease-in-out;
    max-width: 100%;
    height: auto;
}

/* ===================================================================
   BS3 Label → Badge compat
   BS3 .label / .label-* are now BS5 .badge / .bg-*
   Some templates still use the BS3 class names.
   =================================================================== */
.label {
    display: inline-block;
    padding: .2em .6em .3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25em;
}
.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; }
.label-block  { display: block; }

/* ===================================================================
   BS3 Form utilities — Vendor Compat
   .form-horizontal is removed in BS5 (no-op now).
   .control-label → .form-label in BS5.
   =================================================================== */
.control-label {
    padding-top: 7px;
    margin-bottom: 0;
    text-align: right;
}

/* ===================================================================
   BS3 Input Group addon — Vendor Compat
   .input-group-addon → .input-group-text in BS5
   =================================================================== */
.input-group-addon {
    display: flex;
    align-items: center;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

/* ===================================================================
   BS3 col-xs-* → BS5 col-*  — Vendor Compat
   Summernote help dialog uses col-xs-6, col-xs-12, col-xs-offset-6.
   BS5 removed the xs prefix; map col-xs-* to col-*.
   =================================================================== */
.col-xs-1  { flex: 0 0 auto; width: 8.33333333%; }
.col-xs-2  { flex: 0 0 auto; width: 16.66666667%; }
.col-xs-3  { flex: 0 0 auto; width: 25%; }
.col-xs-4  { flex: 0 0 auto; width: 33.33333333%; }
.col-xs-5  { flex: 0 0 auto; width: 41.66666667%; }
.col-xs-6  { flex: 0 0 auto; width: 50%; }
.col-xs-7  { flex: 0 0 auto; width: 58.33333333%; }
.col-xs-8  { flex: 0 0 auto; width: 66.66666667%; }
.col-xs-9  { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }
.col-xs-offset-6 { margin-left: 50%; }

/* ===================================================================
   BS3 .form-inline — Vendor Compat
   DataTables BS3 integration adds .form-inline to its wrapper.
   BS5 removed this class; provide equivalent flex layout.
   =================================================================== */
.form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}
.form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}
.form-inline .form-group {
    display: flex;
    flex: 0 0 auto;
    flex-flow: row wrap;
    align-items: center;
    margin-bottom: 0;
}
.form-inline label {
    margin-bottom: 0;
    margin-right: .5rem;
}

/* ===================================================================
   BS3 .help-block — Vendor Compat
   BS3 .help-block → BS5 .form-text. Vendor plugins (x-editable,
   bootstrapValidator) may generate .help-block elements.
   =================================================================== */
.help-block {
    display: block;
    margin-top: .25rem;
    color: #6c757d;
    font-size: .875em;
}

/* ===================================================================
   BS3 validation states — Vendor Compat
   BS3 .has-error / .has-success / .has-warning on .form-group
   → BS5 uses .is-invalid / .is-valid on <input> + .invalid-feedback.
   Vendor JS (bootstrapValidator, x-editable) may still toggle these.
   =================================================================== */
.has-error .form-control,
.has-error .form-select {
    border-color: #dc3545;
}
.has-error .form-label,
.has-error .help-block,
.has-error label {
    color: #dc3545;
}
.has-success .form-control,
.has-success .form-select {
    border-color: #198754;
}
.has-warning .form-control,
.has-warning .form-select {
    border-color: #ffc107;
}

/* ===================================================================
   BS3 .form-group — Vendor Compat (Summernote dialogs)
   Summernote's CSS targets .note-dialog .form-group.
   =================================================================== */
.form-group {
    margin-bottom: 1rem;
}

/* ===================================================================
   BS3 .text-left / .text-right — Vendor Compat
   Some vendor JS (DataTables, jquery.app.js) may generate these classes.
   BS5 renamed them to .text-start / .text-end.
   =================================================================== */
.text-left {
    text-align: left !important;
}
.text-right {
    text-align: right !important;
}

/* ===================================================================
   BS3 .table-condensed — Vendor Compat
   DataTables BS3 integration may add this class dynamically.
   BS5 uses .table-sm instead.
   =================================================================== */
.table-condensed > thead > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > th,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > th,
.table-condensed > tfoot > tr > td {
    padding: 0.25rem;
}

/* ===================================================================
   BS3 .center-block — Vendor Compat
   =================================================================== */
/* Already defined above — no-op if present */

/* ===================================================================
   BS3 .img-responsive — Vendor Compat
   BS5 uses .img-fluid instead.
   =================================================================== */
.img-responsive {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ===================================================================
   BS3 .sr-only — Vendor Compat
   BS5 uses .visually-hidden instead.
   =================================================================== */
.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;
}

/* ===================================================================
   BS3 .hidden — Vendor Compat
   BS3 used .hidden { display: none !important; }.
   BS5 removed this class — use .d-none instead in new code.
   This shim exists as a safety net for any vendor JS that may
   still toggle the .hidden class dynamically.
   =================================================================== */
.hidden {
    display: none !important;
}
