/* Compatibility overrides for transitional UI fixes.
   Keep minimal; add mappings from new classes to legacy ones here.
   Example: ensure buttons use Bootstrap 3 styles if conflicting CSS loaded.
*/

/* Example reset for conflicting bootstrap v4 utilities */
.btn {
    /* prefer Bootstrap 3 button baseline */
    border-radius: 4px;
}

/* Ensure container widths remain as in legacy theme */
.container,
.container-fluid {
    max-width: 100%;
}

/* Helpers that used to live inline in inc/head.php */
.flyover {
    left: 150%;
    overflow: hidden;
    position: fixed;
    width: 50%;
    opacity: 0.9;
    z-index: 1050;
    transition: left 0.6s ease-out 0s;
}

.flyover-centered {
    top: 50%;
    transform: translate(-50%, -50%);
}

html {
    width: 100vw;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.paragraph {
    width: 150%;
}

.box-headers {
    margin-bottom: 7px;
    box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.19);
    width: 100%;
    border-radius: 8px;
    padding: 15px;
}

.box-containers {
    margin-bottom: 5%;
    /* box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.19); */
    width: 100%;
    border-radius: 8px;
    /* border-top: 3px solid blue; */
    padding: 15px;
}

/* Add specific overrides as issues are found during testing */

/* Global typography baseline */
:root {
    --imtihan-ui-font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --imtihan-ui-font-size: 14px;
}

body {
    font-family: var(--imtihan-ui-font-family);
    font-size: var(--imtihan-ui-font-size);
    line-height: 1.5;
}

input,
button,
select,
textarea,
.form-control,
.btn,
label,
.control-label,
.breadcrumb,
.nav-list>li>a,
.widget-header,
.table,
th,
td {
    font-family: var(--imtihan-ui-font-family);
    font-size: var(--imtihan-ui-font-size);
}

/* Bootstrap 3 -> Bootstrap 5 bridge classes still used in legacy templates */
.btn-default {
    --bs-btn-color: #212529;
    --bs-btn-bg: #f8f9fa;
    --bs-btn-border-color: #ced4da;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #e9ecef;
    --bs-btn-hover-border-color: #adb5bd;
    --bs-btn-focus-shadow-rgb: 173, 181, 189;
    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: #dee2e6;
    --bs-btn-active-border-color: #adb5bd;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    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.375rem;
}

.label {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

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

.label-primary {
    background-color: #0d6efd;
}

.label-success {
    background-color: #198754;
}

.label-info {
    color: #212529;
    background-color: #0dcaf0;
}

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

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

.navbar-fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

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

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

.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;
}

.help-block {
    display: block;
    margin-top: 0.25rem;
    margin-bottom: 0;
    color: #6c757d;
}

.form-check > label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
    font-weight: 400;
}

.form-check .form-check-input {
    margin-top: 0;
}

.form-check .lbl {
    margin: 0;
}

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

.form-horizontal .form-group::before,
.form-horizontal .form-group::after {
    display: table;
    content: " ";
}

.form-horizontal .form-group::after {
    clear: both;
}

.control-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

@media (min-width: 768px) {
    .form-horizontal .control-label {
        margin-bottom: 0;
        padding-top: calc(0.375rem + 1px);
        text-align: right;
    }
}

.well {
    min-height: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.btn-xs,
.btn-group-xs > .btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1.25;
    border-radius: 0.2rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-block + .btn-block {
    margin-top: 0.5rem;
}

.input-lg,
.form-control.input-lg {
    height: 46px;
    padding: 10px 16px;
    font-size: 18px;
    line-height: 1.3333333;
    border-radius: 0.5rem;
}

textarea.input-lg,
select[multiple].input-lg {
    height: auto;
}

select.input-lg {
    height: 46px;
    line-height: 46px;
}

.input-group-btn {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.input-group-btn > .btn {
    position: relative;
    z-index: 2;
}

.input-group-btn:not(:first-child) > .btn,
.input-group-btn:not(:first-child) > .btn-group > .btn {
    margin-left: -1px;
}

.input-group .input-group-btn > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.img-responsive {
    display: block;
    max-width: 100%;
    height: auto;
}

.navbar-default {
    --bs-navbar-color: rgba(255, 255, 255, 0.85);
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
    --bs-navbar-brand-color: #fff;
    --bs-navbar-brand-hover-color: #fff;
}

.navbar-toggle {
    position: relative;
    float: right;
    padding: 9px 10px;
    margin-top: 8px;
    margin-right: 15px;
    margin-bottom: 8px;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background-color: currentColor;
}

.navbar-toggle .icon-bar + .icon-bar {
    margin-top: 4px;
}

.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    border: 0;
    background: transparent;
}

.close:hover,
.close:focus {
    color: #000;
    opacity: 0.75;
    text-decoration: none;
}

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

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

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

.page-header {
    padding-bottom: 9px;
    margin: 40px 0 20px;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1,
.page-header h2,
.page-header h3,
.page-header h4,
.page-header h5,
.page-header h6 {
    margin-top: 0;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px dashed;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
    display: none !important;
}

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

@media (min-width: 768px) and (max-width: 991.98px) {
    .hidden-sm {
        display: none !important;
    }
    .visible-sm {
        display: block !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .hidden-md {
        display: none !important;
    }
    .visible-md {
        display: block !important;
    }
}

@media (min-width: 1200px) {
    .hidden-lg {
        display: none !important;
    }
    .visible-lg {
        display: block !important;
    }
}

/* Bootstrap 3 grid compatibility */
[class^="col-xs-"],
[class*=" col-xs-"] {
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
    float: left;
}

.col-xs-1 { width: 8.33333333%; }
.col-xs-2 { width: 16.66666667%; }
.col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.33333333%; }
.col-xs-5 { width: 41.66666667%; }
.col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.33333333%; }
.col-xs-8 { width: 66.66666667%; }
.col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.33333333%; }
.col-xs-11 { width: 91.66666667%; }
.col-xs-12 { width: 100%; }

@media (max-width: 767.98px) {
    [class^="col-sm-"],
    [class*=" col-sm-"],
    [class^="col-md-"],
    [class*=" col-md-"],
    [class^="col-lg-"],
    [class*=" col-lg-"] {
        float: none;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        margin-left: 0 !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    [class^="col-md-"],
    [class*=" col-md-"],
    [class^="col-lg-"],
    [class*=" col-lg-"] {
        float: none;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        margin-left: 0 !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    [class^="col-lg-"],
    [class*=" col-lg-"] {
        float: none;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        margin-left: 0 !important;
    }
}

.col-sm-offset-2,
.col-md-offset-3 {
    margin-left: 0;
}

@media (min-width: 768px) {
    .col-sm-offset-2 {
        margin-left: 16.66666667%;
    }
}

@media (min-width: 992px) {
    .col-md-offset-3 {
        margin-left: 25%;
    }
}
