/**
 * Bootstrap 5 Compatibility Layer (Slim)
 *
 * Minimal backwards compatibility for Bootstrap 4 classes still in use.
 * Most BS4 classes have been migrated to BS5 equivalents.
 */

/* ============================================
   FORM UTILITIES (still heavily used)
   ============================================ */

/* .form-group - removed in BS5, provides spacing for form elements */
.form-group {
    margin-bottom: 1rem;
}

/* .form-inline - still used in a few places */
.form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}

.form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}

.form-inline .form-group {
    display: flex;
    flex: 0 0 auto;
    flex-flow: row wrap;
    align-items: center;
    margin-bottom: 0;
}

/* ============================================
   CLOSE BUTTON COMPATIBILITY
   ============================================ */

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

button.close:hover {
    opacity: 0.75;
}

/* ============================================
   MEDIA OBJECT (for legacy components)
   ============================================ */

.media {
    display: flex;
    align-items: flex-start;
}

.media-body {
    flex: 1;
}

/* ============================================
   LEGACY FALLBACKS (rarely used)
   ============================================ */

/* .btn-block - use w-100 instead */
.btn-block {
    display: block;
    width: 100%;
}

/* .no-gutters - use g-0 instead */
.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

/* .sr-only - use visually-hidden instead */
.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;
}

/* ============================================
   RESPONSIVE DISPLAY UTILITIES
   Bootstrap 5 responsive display classes
   ============================================ */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-table-cell { display: table-cell !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-table-cell { display: table-cell !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-table-cell { display: table-cell !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-table-cell { display: table-cell !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
    .d-xl-table-cell { display: table-cell !important; }
}
