/**
 * Bootstrap 3 → 5 markup compatibility layer.
 * Keeps existing module HTML/JS working while BS5 CSS is loaded.
 */

.no-display {
  display: none !important;
}

/* BS3 responsive visibility helpers */
@media (max-width: 767px) {
  .hidden-xs {
    display: none !important;
  }
}

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

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

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

/* BS3 collapse ".in" → BS5 ".show" */
.collapse.in,
.collapsing.in {
  display: block !important;
  height: auto !important;
  visibility: visible !important;
}

.tab-pane.active {
  display: block;
}

/* Float helpers */
.pull-left { float: left !important; }
.pull-right { float: right !important; }

.clearfix::before,
.clearfix::after {
  display: table;
  content: " ";
}

.clearfix::after {
  clear: both;
}

/* Buttons */
.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;
  color: var(--bs-btn-color);
  background-color: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}

.btn-default:hover,
.btn-default:focus {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
  border-color: var(--bs-btn-hover-border-color);
}

.btn-xs {
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}

/* Navbar (BS3 inverse fixed-top) */
.navbar {
  position: relative;
  min-height: 50px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

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

.navbar-header {
  float: left;
}

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

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

.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
  background-color: #080808;
  color: #fff;
}

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

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

.navbar-nav > li {
  position: relative;
}

.navbar-nav > li > a {
  position: relative;
  display: block;
  padding: 15px;
}

.navbar-right {
  float: right !important;
  margin-right: 0;
}

@media (min-width: 768px) {
  .navbar-collapse.collapse,
  .navbar-collapse.collapse.in {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    padding-bottom: 0;
    border-top: 0;
    box-shadow: none;
  }

  .navbar-header .navbar-toggle {
    display: none;
  }

  .navbar-nav.navbar-right {
    float: right !important;
  }
}

@media (max-width: 767px) {
  .navbar-header {
    float: none;
    text-align: center;
  }

  .navbar-toggle {
    display: block;
    margin: 8px auto;
    float: none;
  }

  .navbar-collapse.collapse:not(.in) {
    display: none !important;
  }

  .navbar-collapse.collapse.in {
    display: block !important;
  }

  .navbar-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .navbar-right {
    float: none !important;
  }
}

.navbar-toggle {
  position: relative;
  padding: 9px 10px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
}

.navbar-inverse .navbar-toggle {
  border-color: #333;
}

.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
  background-color: #333;
}

.icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background-color: #888;
  margin-top: 4px;
}

.icon-bar:first-child {
  margin-top: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dropdown (BS3 markup + BS3 JS) */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu > li > a {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: 400;
  line-height: 1.42857143;
  color: #333;
  white-space: nowrap;
}

.open > .dropdown-menu {
  display: block;
}

/* Panels (removed in BS5) */
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-default {
  border-color: #ddd;
}

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

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

.panel-body {
  padding: 15px;
}

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

.panel-group {
  margin-bottom: 20px;
}

.panel-group .panel {
  margin-bottom: 0;
  border-radius: 4px;
}

.panel-group .panel + .panel {
  margin-top: 5px;
}

.panel-group .panel-heading {
  border-bottom: 0;
}

.panel-group .panel-heading + .panel-collapse > .panel-body {
  border-top: 1px solid #ddd;
}

/* Forms */
.input-lg {
  min-height: calc(1.5em + 1rem + 2px);
  padding: 0.5rem 1rem;
  font-size: 1.125rem;
  border-radius: 0.5rem;
}

.control-label {
  margin-bottom: 0.5rem;
}

.form-horizontal .control-label {
  text-align: right;
}

.form-horizontal .form-group {
  margin-right: -15px;
  margin-left: -15px;
}

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

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

.input-group {
  position: relative;
  display: table;
  border-collapse: separate;
  width: 100%;
}

.input-group .form-control {
  position: relative;
  z-index: 2;
  float: left;
  width: 100%;
  margin-bottom: 0;
  display: table-cell;
}

.input-group-addon {
  display: table-cell;
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #555;
  text-align: center;
  background-color: #eee;
  border: 1px solid #ccc;
}

.input-group .form-control:first-child,
.input-group-addon:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group-addon:first-child {
  border-right: 0;
}

.input-group .form-control:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group-addon + .form-control {
  border-left: 0;
}

.img-circle {
  border-radius: 50%;
}

/* Alerts dismiss (BS3 close button) */
.alert .close {
  float: right;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
  background: transparent;
  border: 0;
  padding: 0;
}

.alert .close:hover {
  opacity: 0.75;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0;
  list-style: none;
}

.pagination > li {
  display: inline-flex;
}

.pagination > li > a,
.pagination > li > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.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, 0.05);
}
