/*!
 * Bootstrap 4 to 5 Compatibility Layer
 * Use this in DNN portals/modules while migrating
 * Ensures BS4 classes still render correctly under BS5
 */

/* -----------------------------
   1. Forms
--------------------------------*/

/* BS4: .form-group → Removed in BS5 */
.form-group {
  margin-bottom: 1rem;
}

/* BS4: .form-row → Removed, use .row */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}
.form-row > .col,
.form-row > [class*="col-"] {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

/* BS4: .form-inline → Removed */
.form-inline {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}
.form-inline .form-control {
  display: inline-block;
  width: auto;
  vertical-align: middle;
}

/* BS4: .custom-select → replaced by .form-select */
.custom-select,
select.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='none' stroke='%23343a40' stroke-width='1.5' d='M0 0l2 2 2-2'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    appearance: none;
}

/* BS4: .custom-file → Removed, BS5 uses .form-control[type=file] */
.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: calc(2.25rem + 2px);
  margin-bottom: 0;
}
.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(2.25rem + 2px);
  margin: 0;
  opacity: 0;
}
.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}

/* BS4: .custom-control → Removed */
.custom-control {
  position: relative;
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5rem;
}
.custom-control-input {
  position: absolute;
  left: 0;
  z-index: -1;
  width: 1rem;
  height: 1.25rem;
  opacity: 0;
}
.custom-control-label {
  position: relative;
  margin-bottom: 0;
  vertical-align: top;
}
.custom-control-label::before {
  position: absolute;
  top: 0.25rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  content: "";
  background-color: #fff;
  border: 1px solid #adb5bd;
}
.custom-control-label::after {
  position: absolute;
  top: 0.25rem;
  left: -1.5rem;
  display: block;
  width: 1rem;
  height: 1rem;
  content: "";
  background: no-repeat 50%/50% 50%;
}

/* Custom Checkbox */
/*.custom-checkbox .custom-control-label::before {
  border-radius: 0.25rem;
}
.custom-checkbox .custom-control-label::after {
  border-radius: 0.25rem;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='m6.564.75-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #0d6efd;
  border-color: #0d6efd;
}*/

/* Override BS5 form-check-input for custom controls */
/*.custom-control .form-check-input:checked {
  border-color: transparent !important;
  background-color: transparent !important;
}*/

/* Custom Radio */
/*.custom-radio .custom-control-label::before {
  border-radius: 50%;
}
.custom-radio .custom-control-label::after {
  border-radius: 50%;
}
.custom-radio .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #0d6efd;
  border-color: #0d6efd;
}*/

/* Custom Switch */
.custom-switch {
  padding-left: 2.25rem;
}
.custom-switch .custom-control-label::before {
  left: -2.25rem;
  width: 1.75rem;
  pointer-events: all;
  border-radius: 0.5rem;
}
.custom-switch .custom-control-label::after {
  position: absolute;
  top: calc(0.25rem + 2px);
  left: calc(-2.25rem + 2px);
  display: block;
  width: calc(1rem - 4px);
  height: calc(1rem - 4px);
  content: "";
  background-color: #adb5bd;
  border-radius: 0.5rem;
  transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
  background-color: #fff;
  transform: translateX(0.75rem);
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* -----------------------------
   2. Input Groups
--------------------------------*/

/* BS4: .input-group-append / .input-group-prepend → Removed */
.input-group-append,
.input-group-prepend {
  display: flex;
}
.input-group-append .btn,
.input-group-prepend .btn {
  position: relative;
  z-index: 2;
}

/* -----------------------------
   3. Badges & Labels
--------------------------------*/

/* BS4: .badge-pill → use .rounded-pill in BS5 */
.badge-pill {
  padding-right: 0.6em;
  padding-left: 0.6em;
  border-radius: 10rem;
}

/* BS4: Badge color variants */
.badge-primary { background-color: #0d6efd; }
.badge-secondary { background-color: #6c757d; }
.badge-success { background-color: #198754; }
.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #ffc107; color: #000; }
.badge-info { background-color: #0dcaf0; color: #000; }
.badge-light { background-color: #f8f9fa; color: #000; }
.badge-dark { background-color: #212529; }

/* -----------------------------
   4. Utilities (Float, Text, Spacing)
--------------------------------*/

/* BS4: .float-left / .float-right → use .float-start / .float-end */
.float-left { float: left !important; }
.float-right { float: right !important; }

/* BS4: .text-left / .text-right → use .text-start / .text-end */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* BS4: .ml-* / .mr-* / .pl-* / .pr-* → use .ms-* / .me-* / .ps-* / .pe-* */
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.ml-auto { margin-left: auto !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }
.mr-auto { margin-right: auto !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* -----------------------------
   5. Cards
--------------------------------*/

/* BS4: .card-deck → Removed */
.card-deck {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}
.card-deck .card {
  margin: 0 15px 30px;
  flex: 1 0 0%;
}

/* BS4: .card-columns → Removed */
.card-columns {
  column-count: 3;
  column-gap: 1.25rem;
  orphans: 1;
  widows: 1;
}
.card-columns .card {
  display: inline-block;
  width: 100%;
}

/* -----------------------------
   6. Media Object
--------------------------------*/

/* BS4: .media → Removed */
.media {
  display: flex;
  align-items: flex-start;
}
.media-body {
  flex: 1;
}
.media-object {
  flex-shrink: 0;
}

/* -----------------------------
   7. Jumbotron
--------------------------------*/

/* BS4: .jumbotron → Removed */
.jumbotron {
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  background-color: #e9ecef;
  border-radius: 0.375rem;
}
.jumbotron-fluid {
  padding-right: 0;
  padding-left: 0;
  border-radius: 0;
}

/* -----------------------------
   8. Miscellaneous
--------------------------------*/

/* BS4: .btn-block → use .d-grid */
.btn-block {
  display: block;
  width: 100%;
}

/* BS4: .close → replaced by .btn-close */
.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  background: transparent;
  border: 0;
}
.close:hover {
  color: #000;
  text-decoration: none;
  opacity: 0.75;
}

/* BS4: .sr-only → use .visually-hidden */
.sr-only {
  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;
}

/* BS4: .font-weight-* → use .fw-* */
.font-weight-light { font-weight: 300 !important; }
.font-weight-lighter { font-weight: lighter !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-bolder { font-weight: bolder !important; }

/* BS4: .font-italic → use .fst-italic */
.font-italic { font-style: italic !important; }

/* BS4: .rounded-sm / .rounded-lg → use .rounded-1 / .rounded-3 */
.rounded-sm { border-radius: 0.2rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }lute !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;
}

/* BS4: .font-weight-* → use .fw-* */
.font-weight-light { font-weight: 300 !important; }
.font-weight-lighter { font-weight: lighter !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-bolder { font-weight: bolder !important; }

/* BS4: .font-italic → use .fst-italic */
.font-italic { font-style: italic !important; }

/* BS4: .rounded-sm / .rounded-lg → use .rounded-1 / .rounded-3 */
.rounded-sm { border-radius: 0.2rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }t: calc(2.25rem + 2px);
    margin: 0;
    opacity: 0;
  }
  .custom-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(2.25rem + 2px);
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
  }
  
  /* -----------------------------
     2. Input Groups
  --------------------------------*/
  
  /* BS4: .input-group-append / .input-group-prepend → Removed */
  .input-group-append,
  .input-group-prepend {
    display: flex;
  }
  .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
  }
  
  /* -----------------------------
     3. Badges & Labels
  --------------------------------*/
  
  /* BS4: .badge-pill → use .rounded-pill in BS5 */
  .badge-pill {
    padding-right: 0.6em;
    padding-left: 0.6em;
    border-radius: 10rem;
  }
  
  /* -----------------------------
     4. Utilities (Float, Text, Spacing)
  --------------------------------*/
  
  /* BS4: .float-left / .float-right → use .float-start / .float-end */
  .float-left { float: left !important; }
  .float-right { float: right !important; }
  
  /* BS4: .text-left / .text-right → use .text-start / .text-end */
  .text-left { text-align: left !important; }
  .text-right { text-align: right !important; }
  
  /* -----------------------------
     5. Cards
  --------------------------------*/
  
  /* BS4: .card-deck → Removed */
  .card-deck {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
  .card-deck .card {
    margin: 0 15px 30px;
    flex: 1 0 0%;
  }
  
  /* -----------------------------
     6. Media Object
  --------------------------------*/
  
  /* BS4: .media → Removed */
  .media {
    display: flex;
    align-items: flex-start;
  }
  .media-body {
    flex: 1;
  }
  
  /* -----------------------------
     7. Miscellaneous
  --------------------------------*/
  
  /* BS4: .btn-block → use .d-block.w-100 */
  .btn-block {
    display: block;
    width: 100%;
  }
  
  /* BS4: .close → replaced by .btn-close */
  .close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
  }
  .close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
  }
  
a,
.btn-link {
    text-decoration: none;
}

/* === Restore Bootstrap 4 corner radius === */
/*.btn,
.form-control,
.form-select,
.input-group-text,
.badge,
.alert,
.card,
.dropdown-menu,
.pagination .page-link,
.modal-content {
    border-radius: 0.25rem !important;*/ /* BS4 default */
/*}*/

/* Special cases */
.btn-lg,
.form-control-lg,
.form-select-lg {
    border-radius: 0.3rem !important;
}

.btn-sm,
.form-control-sm,
.form-select-sm {
    border-radius: 0.2rem !important;
}

/* Bootstrap 4 to 5 compatibility */


.border-right {
    border-right: 1px solid #dee2e6 !important;
}


/* BS4: Responsive text alignment classes */
.text-sm-left {
    text-align: left !important;
}

.text-sm-right {
    text-align: right !important;
}

.text-sm-center {
    text-align: center !important;
}

@media (min-width: 768px) {
    .text-md-left {
        text-align: left !important;
    }

    .text-md-right {
        text-align: right !important;
    }

    .text-md-center {
        text-align: center !important;
    }
}

@media (min-width: 992px) {
    .text-lg-left {
        text-align: left !important;
    }

    .text-lg-right {
        text-align: right !important;
    }

    .text-lg-center {
        text-align: center !important;
    }
}

@media (min-width: 1200px) {
    .text-xl-left {
        text-align: left !important;
    }

    .text-xl-right {
        text-align: right !important;
    }

    .text-xl-center {
        text-align: center !important;
    }
}

/* Custom fieldset styling */
.mx-admin-fieldset {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mx-admin-fieldset hr {
    margin: 0.5rem 0;
}

.mx-admin-fieldset h5 {
    margin: 0;
    font-weight: 600;
}

/* Modal fixes for BS5 */
.modal-content {
    background-color: #fff !important;
}

.modal-dialog {
    /*max-width: 90vw;*/
    margin: 1.75rem auto;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
/* Fix Bootstrap 5 collapse behavior in DNN */
fieldset.collapse:not(.show),
div.collapse:not(.show) {
    display: none;
}

.tab-pane.active#pnlAdvancedEdit,
.tab-pane.active#pnlAdvancedView {
    display: block !important;
    opacity: 1 !important;
}

.mx-configwindow-wrapper .btn-primary {
    color: white;
}

/* -----------------------------
    Tables
--------------------------------*/
/* BS5: thead th lost bold and top border — restore BS4 behaviour */
table th,
.table th {
    font-weight: 700;
}

.table thead th {
    border-top: 1px solid #dee2e6;
}

/* Fix BS5 alert color cascading into buttons */
.alert .btn-primary {
    color: #fff;
}

/* Highlight active config tab */
#config-tabs .nav-link.active {
    background-color: #fff;
    color: #264dae !important;
    border-radius: 0.25rem;
}

/* Stronger border on save card checkbox */
[id$='pnlSaveCardStripe'] input[type=checkbox] {
    border-color: #6c757d !important;
}

/* -----------------------------*/