/* Bootstrap 5 Compatibility CSS */

/* Utility classes migration */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Button migrations */
.btn-default {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.btn-default:hover {
    color: #212529;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Navigation utilities */
.navbar-right {
    margin-left: auto;
}

/* Responsive utilities migration */
.visible-xs { display: block !important; }
.hidden-xs { display: none !important; }

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

/* Form styling compatibility */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Bootstrap Icons compatibility for FA icons */
.fa {
    font-family: "Bootstrap Icons" !important;
}

/* Grid system compatibility */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Breadcrumb styling update */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

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

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

/* Button sizing compatibility */
.btn.large {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.375rem;
}

.btn.center {
    display: block;
    margin: 0 auto;
}

/* Tooltip compatibility */
[data-bs-toggle="tooltip"] {
    cursor: help;
}

/* Message styling for Bootstrap 5 */
.bg-danger.h2.center {
    background-color: #dc3545 !important;
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: 0.375rem;
}

.bg-success.h2.center {
    background-color: #198754 !important;
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: 0.375rem;
}

/* Navbar brand compatibility */
.navbar-brand {
    display: inline-block;
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    line-height: inherit;
    white-space: nowrap;
}

/* Navigation items */
.nav-item {
    margin-right: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.nav-link:hover {
    color: #0a58ca;
}

/* Form group spacing */
.form-group {
    margin-bottom: 1rem;
}

/* Responsive column classes for older templates */
.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%; }

/* Select dropdown styling */
.form-control select {
    appearance: auto;
}

/* Specific compatibility for search and filter forms */
.form-search .form-group {
    margin-bottom: 1rem;
}

.form-search .btn {
    width: 100%;
}

/* Property listing compatibility */
.property .info {
    padding: 1rem;
}

.property .tag.price {
    font-weight: bold;
    color: #198754;
    font-size: 1.2rem;
}

/* Link arrow styling */
.link-arrow {
    text-decoration: none;
    color: #0d6efd;
}

.link-arrow:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* Panel to Card migration helpers */
.panel {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.panel-info {
    border-color: #0dcaf0;
}

.panel-success {
    border-color: #198754;
}

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

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

.panel-header {
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: calc(0.375rem - 1px) calc(0.375rem - 1px) 0 0;
}

.panel-body {
    padding: 1rem;
}

.panel-info .panel-header {
    background-color: #cff4fc;
    border-color: #0dcaf0;
}

.panel-success .panel-header {
    background-color: #d1e7dd;
    border-color: #198754;
}

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

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

/* Label badges */
.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.375rem;
}

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

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

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

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

/* Modal improvements for Bootstrap 5 */
.modal-header .btn-close {
    padding: 0.5rem 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* List group item hover */
.list-group-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.list-group-item:hover {
    background-color: #f8f9fa;
}
