/**
 * Bootstrap 3 to Bootstrap 5 Compatibility Layer
 * Add this CSS after Bootstrap 5 to support legacy BS3 classes
 * 
 * Usage: Include this stylesheet after Bootstrap 5
 * <link rel="stylesheet" href="bootstrap-5.min.css">
 * <link rel="stylesheet" href="bootstrap-compat.css">
 */

/* ========================================
   GRID SYSTEM COMPATIBILITY
   ======================================== */

/* Hidden classes - BS3 used .hidden-*, BS5 uses .d-*-none */
.hidden-xs { display: none !important; }
@media (min-width: 576px) { .hidden-xs { display: initial !important; } }

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

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

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

.hidden-xl { display: initial !important; }
@media (min-width: 1200px) { .hidden-xl { display: none !important; } }

/* Visible classes */
.visible-xs, .visible-sm, .visible-md, .visible-lg, .visible-xl { display: none !important; }

@media (max-width: 575.98px) { 
  .visible-xs { display: block !important; }
  .visible-xs-block { display: block !important; }
  .visible-xs-inline { display: inline !important; }
  .visible-xs-inline-block { display: inline-block !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) { 
  .visible-sm { display: block !important; }
  .visible-sm-block { display: block !important; }
  .visible-sm-inline { display: inline !important; }
  .visible-sm-inline-block { display: inline-block !important; }
}

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

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

@media (min-width: 1200px) { 
  .visible-xl { display: block !important; }
  .visible-xl-block { display: block !important; }
  .visible-xl-inline { display: inline !important; }
  .visible-xl-inline-block { display: inline-block !important; }
}

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

/* BS3 default button style */
.btn-default {
  --bs-btn-color: #333;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #ccc;
  --bs-btn-hover-color: #333;
  --bs-btn-hover-bg: #e6e6e6;
  --bs-btn-hover-border-color: #adadad;
  --bs-btn-active-color: #333;
  --bs-btn-active-bg: #e6e6e6;
  --bs-btn-active-border-color: #adadad;
  --bs-btn-disabled-color: #333;
  --bs-btn-disabled-bg: #fff;
  --bs-btn-disabled-border-color: #ccc;
}

/* Button sizing - BS3 used .btn-xs */
.btn-xs {
  --bs-btn-padding-y: 0.15rem;
  --bs-btn-padding-x: 0.4rem;
  --bs-btn-font-size: 0.75rem;
  --bs-btn-border-radius: 0.2rem;
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
  font-size: var(--bs-btn-font-size);
  border-radius: var(--bs-btn-border-radius);
}

/* ========================================
   PANELS TO CARDS
   ======================================== */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0,0,0,.125);
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

.panel-heading {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: #f5f5f5;
  border-bottom: 1px solid rgba(0,0,0,.125);
  border-top-left-radius: calc(0.25rem - 1px);
  border-top-right-radius: calc(0.25rem - 1px);
}

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

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

.panel-footer {
  padding: 0.75rem 1.25rem;
  background-color: #f5f5f5;
  border-top: 1px solid rgba(0,0,0,.125);
  border-bottom-right-radius: calc(0.25rem - 1px);
  border-bottom-left-radius: calc(0.25rem - 1px);
}

/* Panel variants */
.panel-default { border-color: #ddd; }
.panel-default > .panel-heading { 
  color: #333; 
  background-color: #f5f5f5; 
  border-color: #ddd; 
}

.panel-primary { border-color: #0d6efd; }
.panel-primary > .panel-heading { 
  color: #fff; 
  background-color: #0d6efd; 
  border-color: #0d6efd; 
}

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

.panel-info { border-color: #0dcaf0; }
.panel-info > .panel-heading { 
  color: #000; 
  background-color: #0dcaf0; 
  border-color: #0dcaf0; 
}

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

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

/* ========================================
   WELLS
   ======================================== */

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}

.well-lg {
  padding: 24px;
  border-radius: 6px;
}

.well-sm {
  padding: 9px;
  border-radius: 3px;
}

/* ========================================
   LABELS TO 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.25rem;
}

.label-default { background-color: #6c757d; }
.label-primary { background-color: #0d6efd; }
.label-success { background-color: #198754; }
.label-info { background-color: #0dcaf0; color: #000; }
.label-warning { background-color: #ffc107; color: #000; }
.label-danger { background-color: #dc3545; }

/* ========================================
   THUMBNAILS
   ======================================== */

.thumbnail {
  display: block;
  padding: 4px;
  margin-bottom: 20px;
  line-height: 1.5;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border 0.2s ease-in-out;
}

.thumbnail > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

a.thumbnail:hover,
a.thumbnail:focus {
  border-color: #0d6efd;
}

.thumbnail .caption {
  padding: 9px;
  color: #333;
}

/* ========================================
   FORM CONTROL COMPATIBILITY
   ======================================== */

/* BS3 input-lg and input-sm */
.input-lg, .form-control-lg {
  min-height: calc(1.5em + 1rem + 2px);
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  border-radius: 0.3rem;
}

.input-sm, .form-control-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

/* Help block */
.help-block {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #6c757d;
}

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

/* Control label */
.control-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Horizontal forms */
.form-horizontal .control-label {
  padding-top: calc(0.375rem + 1px);
  margin-bottom: 0;
  text-align: right;
}

/* ========================================
   NAVBAR COMPATIBILITY
   ======================================== */

/* BS3 navbar-default */
.navbar-default {
  background-color: #f8f9fa;
  border-color: #e7e7e7;
}

.navbar-default .navbar-brand {
  color: #777;
}

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
  color: #5e5e5e;
}

.navbar-default .navbar-nav > li > a {
  color: #777;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #333;
}

/* Navbar inverse */
.navbar-inverse {
  background-color: #222;
  border-color: #080808;
}

.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
  color: #9d9d9d;
}

.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus,
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
  color: #fff;
}

/* ========================================
   PAGINATION COMPATIBILITY
   ======================================== */

.pagination > li {
  display: inline;
}

.pagination > li > a,
.pagination > li > span {
  position: relative;
  float: left;
  padding: 0.375rem 0.75rem;
  margin-left: -1px;
  line-height: 1.5;
  color: #0d6efd;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #dee2e6;
}

.pagination > li:first-child > a,
.pagination > li:first-child > span {
  margin-left: 0;
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.pagination > li:last-child > a,
.pagination > li:last-child > span {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.pagination > li > a:hover,
.pagination > li > span:hover {
  z-index: 2;
  color: #024dbc;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.pagination > .active > a,
.pagination > .active > span {
  z-index: 3;
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.pagination > .disabled > span,
.pagination > .disabled > a {
  color: #6c757d;
  pointer-events: none;
  background-color: #fff;
  border-color: #dee2e6;
}

/* ========================================
   BREADCRUMB COMPATIBILITY
   ======================================== */

.breadcrumb > li {
  display: inline-block;
}

.breadcrumb > li + li:before {
  content: "/";
  padding: 0 0.5rem;
  color: #6c757d;
}

.breadcrumb > .active {
  color: #6c757d;
}

/* ========================================
   ALERTS COMPATIBILITY
   ======================================== */

.alert-dismissable,
.alert-dismissible {
  padding-right: 3rem;
}

.alert-dismissable .close,
.alert-dismissible .close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.75rem 1.25rem;
  color: inherit;
}

/* ========================================
   MODAL COMPATIBILITY
   ======================================== */

/* BS3 modal-sm and modal-lg classes work, but ensure compatibility */
.modal-sm {
  max-width: 300px;
}

@media (min-width: 992px) {
  .modal-lg {
    max-width: 800px;
  }
}

/* ========================================
   PROGRESS BARS COMPATIBILITY
   ======================================== */

.progress {
  overflow: hidden;
}

.progress-bar {
  float: left;
  width: 0;
  height: 100%;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #fff;
  text-align: center;
  background-color: #0d6efd;
  transition: width 0.6s ease;
}

.progress-bar-success { background-color: #198754; }
.progress-bar-info { background-color: #0dcaf0; }
.progress-bar-warning { background-color: #ffc107; }
.progress-bar-danger { background-color: #dc3545; }

.progress-bar-striped {
  background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
}

/* ========================================
   LIST GROUPS
   ======================================== */

.list-group-item.active > .badge {
  color: #0d6efd;
  background-color: #fff;
}

/* ========================================
   UTILITIES
   ======================================== */

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

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

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

.show { display: block !important; }
.hidden { display: none !important; }

.affix {
  position: fixed;
}

/* ========================================
   CONTEXTUAL BACKGROUNDS
   ======================================== */

.bg-primary {
  background-color: #0d6efd !important;
  color: #fff;
}

.bg-success {
  background-color: #198754 !important;
  color: #fff;
}

.bg-info {
  background-color: #0dcaf0 !important;
  color: #000;
}

.bg-warning {
  background-color: #ffc107 !important;
  color: #000;
}

.bg-danger {
  background-color: #dc3545 !important;
  color: #fff;
}

/* ========================================
   RESPONSIVE EMBEDS
   ======================================== */

.embed-responsive {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.embed-responsive::before {
  display: block;
  content: "";
}

.embed-responsive .embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-responsive-16by9::before {
  padding-top: 56.25%;
}

.embed-responsive-4by3::before {
  padding-top: 75%;
}

.embed-responsive-1by1::before {
  padding-top: 100%;
}

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

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

.close:hover {
  color: #000;
  text-decoration: none;
  opacity: .75;
}

/* ========================================
   CLEARFIX
   ======================================== */

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

a, a:hover {
	text-decoration: none;
}