/* Bootstrap 3 to 5 Compatibility Styles */

/* Button compatibility */
.btn-default {
  color: #212529;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-default:hover {
  color: #fff;
  background-color: #5c636a;
  border-color: #565e64;
}

/* Grid system compatibility is mostly handled by Bootstrap 5 */

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

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

.panel-heading {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
}

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

.panel-default {
  border-color: rgba(0, 0, 0, 0.125);
}

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

.panel-title > a {
  text-decoration: none;
  color: inherit;
}

.panel-collapse {
  display: none;
}

.panel-collapse.collapse.show,
.panel-collapse.collapse.in {
  display: block;
}

/* Well to Bootstrap 5 equivalent */
.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);
}

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

/* Glyphicon to FontAwesome compatibility - these require FontAwesome to be loaded */
.glyphicon {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro";
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.glyphicon-ok:before {
  content: "\f00c";
  font-weight: 900;
}

.glyphicon-warning-sign:before {
  content: "\f071";
  font-weight: 900;
}

/* Input group addon compatibility */
.input-group-addon {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #555;
  text-align: center;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

/* Caret for dropdowns */
.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;
}

/* Legacy alert close button support */
.alert .close {
  position: relative;
  top: -2px;
  right: -21px;
  color: inherit;
  padding: 0;
  background-color: transparent;
  border: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.5;
  text-shadow: 0 1px 0 #fff;
  cursor: pointer;
}

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

/* Legacy data-toggle compatibility */
[data-toggle="tooltip"] {
  cursor: pointer;
}

[data-toggle="collapse"] {
  cursor: pointer;
}

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

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

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

.nav.navbar-nav {
  margin: 0;
}

.nav.navbar-nav > li {
  float: left;
  list-style: none;
}

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

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

.dropdown-menu .divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;
}

/* Form control label compatibility */
.control-label {
  margin-bottom: 5px;
  font-weight: 700;
}

/* Text utilities */
.text-danger {
  color: #dc3545;
}

.text-success {
  color: #198754;
}

/* SR-only for screen readers */
.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;
}

/* Legacy collapse behavior */
.collapse {
  display: none;
}

.collapse.in,
.collapse.show {
  display: block;
}

/* Bootstrap 3 button sizes */
.btn-small,
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}
