/**
 * Adianti Framework - Bootstrap 5 Compatibility Layer
 * Purpose: Migrate Bootstrap 3 classes to Bootstrap 5 for AdminLTE v4 theme
 * Created: 2026-08-20
 * Version: 1.0
 */

/* ============================================================
   BOOTSTRAP 3 → BOOTSTRAP 5 CLASS MAPPING
   ============================================================ */

/** Grid System **/
/* col-xs-* removed in Bootstrap 5 */
[class*="col-xs-"] {
    width: auto;
}

.col-xs-1 { width: 8.333333%; }
.col-xs-2 { width: 16.666667%; }
.col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.333333%; }
.col-xs-5 { width: 41.666667%; }
.col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.333333%; }
.col-xs-8 { width: 66.666667%; }
.col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.333333%; }
.col-xs-11 { width: 91.666667%; }
.col-xs-12 { width: 100%; }

.col-xs-offset-1 { margin-left: 8.333333%; }
.col-xs-offset-2 { margin-left: 16.666667%; }
.col-xs-offset-3 { margin-left: 25%; }
.col-xs-offset-4 { margin-left: 33.333333%; }
.col-xs-offset-5 { margin-left: 41.666667%; }
.col-xs-offset-6 { margin-left: 50%; }
.col-xs-offset-7 { margin-left: 58.333333%; }
.col-xs-offset-8 { margin-left: 66.666667%; }
.col-xs-offset-9 { margin-left: 75%; }
.col-xs-offset-10 { margin-left: 83.333333%; }
.col-xs-offset-11 { margin-left: 91.666667%; }

/* Pull-left and pull-right (floats) */
.pull-left {
    float: left !important;
}

.pull-right {
    float: right !important;
}

.float-left {
    float: left !important;
}

.float-right {
    float: right !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* Hidden classes */
.hidden-xs {
    display: none !important;
}

@media (min-width: 576px) {
    .hidden-xs {
        display: block !important;
    }
}

.hidden-sm {
    display: block !important;
}

@media (max-width: 767.98px) {
    .hidden-sm {
        display: none !important;
    }
}

.hidden-md {
    display: block !important;
}

@media (max-width: 991.98px) {
    .hidden-md {
        display: none !important;
    }
}

/* ============================================================
   COMPONENT COMPATIBILITY
   ============================================================ */

/** Labels and Badges **/
.label {
    display: inline-block;
    padding: .25em .6em .3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
    color: #fff;
}

.label-default {
    background-color: #6c757d;
}

.label-default[href]:hover,
.label-default[href]:focus {
    background-color: #5a6268;
}

.label-primary {
    background-color: #007bff;
}

.label-primary[href]:hover,
.label-primary[href]:focus {
    background-color: #0056b3;
}

.label-success {
    background-color: #28a745;
}

.label-success[href]:hover,
.label-success[href]:focus {
    background-color: #1e7e34;
}

.label-info {
    background-color: #17a2b8;
}

.label-info[href]:hover,
.label-info[href]:focus {
    background-color: #0c5460;
}

.label-warning {
    background-color: #ffc107;
}

.label-warning[href]:hover,
.label-warning[href]:focus {
    background-color: #e0a800;
}

.label-danger {
    background-color: #dc3545;
}

.label-danger[href]:hover,
.label-danger[href]:focus {
    background-color: #bd2130;
}

/** Panels → Cards **/
.panel {
    border-radius: initial;
    background: #fff;
    min-height: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    border: 1px solid rgba(0,0,0,.125);
}

.panel-default {
    border-color: rgba(0,0,0,.125);
    background-color: #fff;
}

.panel-default > .panel-heading {
    color: #333;
    background-color: #f9f9f9;
    border-color: rgba(0,0,0,.125);
}

.panel-heading {
    display: flex;
    align-items: center;
    padding: .75rem 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0,0,0,.125);
    background-color: #f9f9f9;
}

.panel-heading:first-child {
    border-radius: calc(.25rem - 1px) calc(.25rem - 1px) 0 0;
}

.panel-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.panel-footer {
    padding: .75rem 1.25rem;
    background-color: #f9f9f9;
    border-top: 1px solid rgba(0,0,0,.125);
}

.panel-footer:last-child {
    border-radius: 0 0 calc(.25rem - 1px) calc(.25rem - 1px);
}

.panel-primary {
    border-color: #007bff;
}

.panel-primary > .panel-heading {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.panel-success {
    border-color: #28a745;
}

.panel-success > .panel-heading {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.panel-info {
    border-color: #17a2b8;
}

.panel-info > .panel-heading {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.panel-warning {
    border-color: #ffc107;
}

.panel-warning > .panel-heading {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;
}

.panel-danger {
    border-color: #dc3545;
}

.panel-danger > .panel-heading {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/** Table compatibility **/
.table-hover > tbody > tr:hover {
    background-color: #f5f5f5;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.02);
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border: 1px solid #dee2e6;
}

/** DataGrid compatibility **/
table.tdatagrid_table {
    box-shadow: none;
    border-radius: 0;
    width: 100%;
}

.tdatagrid_head {
    background-color: #f9f9f9;
}

.tdatagrid_head tr td {
    height: 34px;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.tdatagrid_body tr td {
    height: 30px;
    border-bottom: 1px solid #dee2e6;
}

.tdatagrid_body tr td input {
    height: 24px;
    margin: 0;
    padding: 0px 3px;
}

.tdatagrid_body tr:hover {
    background-color: rgba(0,0,0,.02);
}

/** Breadcrumbs **/
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: #e9ecef;
    border-radius: .25rem;
}

.breadcrumb-item {
    display: flex;
}

.breadcrumb-item + .breadcrumb-item:before {
    display: inline-block;
    padding-right: .5rem;
    padding-left: .5rem;
    color: #6c757d;
    content: "/";
}

.breadcrumb-item.active {
    color: #6c757d;
}

.breadcrumb-item > a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item > a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/** Dropdowns - Ensure compatibility **/
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: .5rem 0;
    margin: .125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .25rem;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu > li > a {
    display: block;
    padding: .5rem 1rem;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    color: #212529;
    white-space: nowrap;
    text-decoration: none;
    background: none;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    color: #262626;
    text-decoration: none;
    background-color: #f5f5f5;
}

/** Alerts **/
.alert {
    position: relative;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-heading {
    color: inherit;
}

.alert-link {
    font-weight: 700;
}

.alert-dismissible {
    padding-right: 2rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-success hr {
    border-top-color: #b1dfbb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-danger hr {
    border-top-color: #f1b0b7;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/** Modals **/
.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: .3rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(.3rem - 1px);
    border-top-right-radius: calc(.3rem - 1px);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: .75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(.3rem - 1px);
    border-bottom-left-radius: calc(.3rem - 1px);
    gap: .5rem;
}

/* ============================================================
   FORM ELEMENTS COMPATIBILITY
   ============================================================ */

/** Input Groups **/
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    margin-bottom: 0;
}

.input-group-addon,
.input-group-btn {
    white-space: nowrap;
    vertical-align: middle;
}

.input-group-addon {
    padding: .375rem .75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: .25rem;
}

.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
    margin-top: 0;
}

.input-group .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.input-group-addon:not(:last-child) {
    border-right: 0;
}

.input-group-addon:not(:first-child) {
    border-left: 0;
}

/** Form Control States **/
.form-control.has-success,
.form-control.has-warning,
.form-control.has-error {
    border-color: inherit;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* ============================================================
   UTILITIES - CLASS COMPATIBILITY
   ============================================================ */

.clearfix::after {
    display: table;
    clear: both;
    content: "";
}

.center-block {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.text-hide {
    font: 0/0 a;
    color: transparent;
    text-shadow: none;
    background-color: transparent;
    border: 0;
}

.text-muted {
    color: #6c757d;
}

.text-primary {
    color: #007bff;
}

.text-success {
    color: #28a745;
}

.text-info {
    color: #17a2b8;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

/* ============================================================
   DISPLAY AND VISIBILITY
   ============================================================ */

.show {
    display: block !important;
}

.hidden,
.d-none {
    display: none !important;
}

.invisible {
    visibility: hidden !important;
}

.text-hide {
    font: 0/0 a;
    color: transparent;
    text-shadow: none;
    background-color: transparent;
    border: 0;
}

/* ============================================================
   SPACING COMPATIBILITY
   ============================================================ */

.no-margin {
    margin: 0 !important;
}

.no-padding {
    padding: 0 !important;
}

.margin-top {
    margin-top: 1rem;
}

.margin-bottom {
    margin-bottom: 1rem;
}

.padding-top {
    padding-top: 1rem;
}

.padding-bottom {
    padding-bottom: 1rem;
}
