/**
 * Bootstrap 5 Compatibility Bridge for AAI Solution
 * Ensures all Bootstrap 3 grid, panel, navbar, and utility classes continue to function seamlessly on Bootstrap 5.3.3.
 */

/* --- 1. Grid col-xs-* support in Bootstrap 5 --- */
.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%; }

/* --- 2. Panels (Bootstrap 3 to Bootstrap 5 Card Mapping) --- */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-flat {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}

.panel-body {
    padding: 20px;
}

.panel-heading {
    padding: 10px 20px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 15px;
    color: inherit;
}

/* --- 3. Navbar (Bootstrap 3 navbar structure) --- */
.navbar {
    position: relative;
    min-height: 48px;
    margin-bottom: 0;
    border: 1px solid transparent;
    padding: 0;
}

.navbar-inverse {
    background-color: #263238;
    border-color: #263238;
    color: #fff;
}

.navbar-header {
    float: left;
    display: flex;
    align-items: center;
}

.navbar-brand {
    float: left;
    height: 48px;
    padding: 6px 20px;
    font-size: 15px;
    line-height: 20px;
}

.navbar-nav {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    padding-left: 0;
}

.navbar-nav > li {
    float: left;
}

.navbar-nav > li > a {
    padding: 14px 15px;
    line-height: 20px;
    color: #fff;
    text-decoration: none;
    display: block;
}

.navbar-nav > li > a:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.navbar-right {
    float: right !important;
    margin-right: -15px;
    margin-left: auto;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

/* --- 4. Forms, Labels, and Input Groups --- */
.form-group {
    margin-bottom: 15px;
}

.form-horizontal .control-label {
    padding-top: 7px;
    margin-bottom: 0;
    text-align: right;
}

/* Match legacy Bootstrap 3 form-control height and typography */
.form-control {
    height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}

.form-control:focus {
    border-color: #3c4ba8;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(60, 75, 168, 0.5);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    background-color: #eeeeee;
    opacity: 1;
    cursor: not-allowed;
}

textarea.form-control {
    height: auto;
}

.input-group-addon {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: flex;
    align-items: center;
}


/* --- 5. Utilities & Helper Classes --- */
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.hidden { display: none !important; }
.visible-xs-block { display: none !important; }
.hidden-xs { display: block !important; }

@media (max-width: 767px) {
    .visible-xs-block { display: block !important; }
    .hidden-xs { display: none !important; }
}

/* --- 6. Buttons --- */
.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 3px;
    user-select: none;
    box-shadow: none;
}

.btn-default,
.k-button:not(.k-primary):not(.k-button-solid-primary):not(.k-grid-excel):not(.k-grid-pdf):not(.k-pager-nav):not(.k-pager-refresh) {
    color: #333333;
    background-color: #ffffff;
    background-image: none;
    border: 1px solid #cccccc;
    border-radius: 3px;
}

.btn-default:hover,
.k-button:not(.k-primary):not(.k-button-solid-primary):not(.k-grid-excel):not(.k-grid-pdf):not(.k-pager-nav):not(.k-pager-refresh):hover {
    color: #333333;
    background-color: #ebebeb;
    border-color: #adadad;
}

.btn-primary {
    color: #ffffff;
    background-color: #3c4ba8;
    border-color: #3c4ba8;
}

.btn-primary:hover {
    color: #ffffff;
    background-color: #2e3a84;
    border-color: #2e3a84;
}


/* --- 7. Modals (Bootstrap 3 layout adaptation) --- */
.modal-header .close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
    background: transparent;
    border: 0;
}

.modal-header .close:hover {
    opacity: .5;
}

/* --- 8. Link & Anchor Text Decoration (Bootstrap 3 Behavior) --- */
a {
    text-decoration: none;
}

a:hover, a:focus {
    text-decoration: underline;
}

/* Ensure navbar, sidebar menus, buttons, and Kendo components never underline */
.navbar a,
.sidebar a,
.navigation a,
.k-button,
.k-grid a,
.k-pager a,
.k-link {
    text-decoration: none !important;
}

