﻿/* ================================================== */
/* Bootstrap 5 compatibility fixes and legacy style   */
/* overrides for the site-wide (non-React) UI.        */
/* ================================================== */

/* ================================================== */
/* ===== ROOT / ELEMENT SELECTORS =================== */
/* ================================================== */

/* Fix missing cursor pointer on button-type inputs on the legacy login page */
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled),
button:not(:disabled) {
  cursor: pointer;
}

/* ================================================== */
/* ===== BOOTSTRAP 5 — GENERAL FIXES ================ */
/* ================================================== */

/* Restore correct color and background for .btn-info (changed in Bootstrap 5) */
.btn-info {
  color: #ffffff !important;
  background-color: #17a2b8 !important;
  border-color: #17a2b8 !important;
}

/* Restore the previous vertical padding for small buttons */
.btn-sm {
  --bs-btn-padding-y: 0.375rem !important;
}

/* Restore horizontal padding on the navbar (Bootstrap 5 removed it by default) */
.navbar {
  padding: 0.5rem 1rem !important;
}

/* Restore muted nav link color for dark navbars */
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.5);
}

/* Restore slightly lighter color on hover/focus for dark navbar links */
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.75);
}

/* Fix .form-inline display — Bootstrap 5 removed this utility class, which
   broke the legacy flex wrapper on some pages */
.form-inline {
  display: block !important;
}

/* Restore the Bootstrap 4 .form-row layout (removed in Bootstrap 5) */
.form-row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
}

/* Ensure direct children of .card-body follow the Bootstrap grid gutter pattern */
.card-body > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

/* Restore .custom-control layout (Bootstrap 4 utility removed in Bootstrap 5) */
.custom-control {
  display: inline-flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.custom-control > * {
  margin-right: 5px;
}

/* Restore spacing between a custom control input and its label */
.custom-control-label {
  margin-left: 0.25rem;
}

/* Style valid custom control labels green to match Bootstrap validation colors */
.custom-control-input.is-valid ~ .custom-control-label,
.was-validated .custom-control-input:valid ~ .custom-control-label {
  color: #28a745;
}

/* Style invalid custom control labels red to match Bootstrap validation colors */
.custom-control-input.is-invalid ~ .custom-control-label,
.was-validated .custom-control-input:invalid ~ .custom-control-label {
  color: #dc3545;
}

/* Fix floating label z-index — placeholder text was appearing hidden
   beneath the input field */
.floating-label {
  z-index: 10 !important;
}

/* Remove the max-width cap at the xxl breakpoint so containers expand
   to the full page width at large screen sizes */
@media (min-width: 1400px) {
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl {
    max-width: 100%;
  }
}

/* Remove z-index from the navbar and sticky elements so the VueJS
   multiselect dropdown does not clip beneath the top navigation banner */
.navbar,
.sticky-top {
  z-index: unset !important;
}

/* ================================================== */
/* ===== BOOTSTRAP 5 — VPAT CONTRAST FIXES ========== */
/* ================================================== */
/* Custom color overrides to meet WCAG / VPAT contrast requirements */

a,
.btn-primary,
.btn-outline-primary,
.btn-link,
.dropdown-item.active,
.dropdown-item:active,
.custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before,
.custom-range::-moz-range-thumb,
.custom-range::-ms-thumb,
.page-link,
.badge-primary,
.progress-bar,
.list-group-item.active,
.bg-primary,
.border-primary,
.text-primary {
  color: #0068d6;
}

/* Secondary / muted text color updated for sufficient contrast */
caption,
.blockquote-footer,
.figure-caption,
.form-control::-webkit-input-placeholder,
.form-control::-moz-placeholder,
.form-control:-ms-input-placeholder,
.form-control::-ms-input-placeholder,
.form-control::placeholder,
.form-check-input[disabled] ~ .form-check-label,
.form-check-input:disabled ~ .form-check-label,
.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary.disabled,
.btn-outline-primary:disabled,
.btn-outline-secondary.disabled,
.btn-outline-secondary:disabled,
.btn-link:disabled,
.btn-link.disabled,
.dropdown-item.disabled,
.dropdown-header,
.custom-control-input[disabled] ~ .custom-control-label,
.custom-control-input:disabled ~ .custom-control-label,
.custom-select:disabled,
.nav-link.disabled,
.nav-tabs .nav-link.disabled,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.breadcrumb-item + .breadcrumb-item::before,
.breadcrumb-item.active,
.page-item.disabled .page-link,
.badge-secondary,
.list-group-item.disabled,
.toast-header,
.bg-secondary,
.border-secondary,
.text-secondary,
.text-muted {
  color: #6b737b;
}

/* Primary button background and border updated to match the contrast-safe primary color */
.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled,
.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active,
.show > .btn-outline-primary.dropdown-toggle {
  background-color: #0068d6;
  border-color: #0068d6;
}

/* Secondary button background and border updated to match the contrast-safe secondary color */
.btn-secondary,
.btn-secondary.disabled,
.btn-secondary:disabled,
.btn-outline-secondary:hover,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.show > .btn-outline-secondary.dropdown-toggle {
  background-color: #6b737b;
  border-color: #6b737b;
}

/* ================================================== */
/* ===== ACE LIBRARY LEGACY LOOK ==================== */
/* ================================================== */
/* Overrides to maintain visual consistency with the previous Ace UI library */

/* Slightly reduce h3 size for the .smaller variant */
h3.smaller {
  font-size: 21px;
}

/* Navbar brand (logo/title) styling to match the old Ace header appearance */
.navbar .navbar-brand {
  color: #fff;
  font-size: 24px;
  text-shadow: none;
  padding-top: 10px;
  padding-bottom: 10px;
  height: auto;
}

/* Section header bar with a bottom border separator */
.header {
  line-height: 28px;
  margin-bottom: 16px;
  margin-top: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ccc;
}

/* Blue variant of the section header — uses a lighter blue border */
.header.blue {
  border-bottom-color: #d5e3ef;
}

/* Table header row — gradient background with muted text */
.table > thead > tr {
  color: #707070;
  font-weight: normal;
  background: #f2f2f2;
  background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #ececec 100%);
  background-image: -o-linear-gradient(top, #f8f8f8 0%, #ececec 100%);
  background-image: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%);
  background-repeat: repeat-x;
}

/* Ensure the first column of a bordered table uses the correct border color */
.table.table-bordered > thead > tr > th:first-child {
  border-left-color: #ddd;
}

/* Vertically center content in bordered table header cells */
.table.table-bordered > thead > tr > th {
  vertical-align: middle;
}

/* Left border color of the first header cell in non-bordered tables */
.table > thead > tr > th:first-child {
  border-left-color: #f1f1f1;
}

/* Table header cell font weight and border color */
.table > thead > tr > th {
  border-color: #ddd;
  font-weight: bold;
}

/* Remove border-radius from all table cells and bordered tables */
th,
td,
.table-bordered {
  border-radius: 0 !important;
}

/* Ace-style info box widget */
.infobox {
  display: inline-block;
  width: 270px;
  height: 66px;
  color: #555;
  background-color: #fff;
  box-shadow: none;
  border-radius: 0;
  margin: -1px 0 0 -1px;
  padding: 8px 3px 6px 9px;
  border: 1px dotted;
  border-color: #d8d8d8 !important;
  vertical-align: middle;
  text-align: left;
  position: relative;
}

/* Icon container within an infobox */
.infobox > .infobox-icon {
  display: inline-block;
  vertical-align: top;
  width: 44px;
}

/* Ace icon inside the infobox icon container — circular with shadow */
.infobox > .infobox-icon > .ace-icon {
  display: inline-block;
  height: 42px;
  margin: 0;
  padding: 1px 1px 0 2px;
  background-color: transparent;
  border-width: 0;
  text-align: center;
  position: relative;
  border-radius: 100%;
  -webkit-box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* Blue variant of the infobox — uses a blue text and border color */
.infobox-blue2 {
  color: #3983c2;
  border-color: #3983c2;
}

/* Inner padding for widget content areas */
.widget-main {
  padding: 12px;
}

/* White background for widget body sections */
.widget-body {
  background-color: #fff;
}

/* Widget box — bordered card-like container with no shadow */
.widget-box.no-border {
  border-width: 0;
}

.widget-box {
  padding: 0;
  -webkit-box-shadow: none;
  box-shadow: none;
  margin: 3px 0;
  border: 1px solid #ccc;
  max-width: 550px;
}

/* Narrower widget box variant */
.widget-box {
  padding: 0;
  -webkit-box-shadow: none;
  box-shadow: none;
  margin: 3px 0;
  border: 1px solid #ccc;
  max-width: 460px;
}

/* Input with an absolutely positioned icon inside it */
.input-icon {
  position: relative;
}

/* Right-aligned icon variant — shift input padding to the right */
.input-icon.input-icon-right > input {
  padding-left: 6px;
  padding-right: 24px;
}

/* Ace icon positioned on the left inside the input */
.input-icon > .ace-icon {
  padding: 0 3px;
  z-index: 2;
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 3px;
  line-height: 30px;
  display: inline-block;
  color: #909090;
  font-size: 16px;
}

/* Move the icon to the right side when using .input-icon-right */
.input-icon.input-icon-right > .ace-icon {
  left: auto;
  right: 3px;
}

/* Login box toolbar — blue background with a top border */
.login-box .toolbar {
  background: #5090c1;
  border-top: 2px solid #597597;
}

/* Allow span-wrapped input icons to display inline */
span.input-icon {
  display: inline-block;
}

/* ================================================== */
/* ===== UTILITY CLASSES ============================ */
/* ================================================== */

/* Force block display */
.block {
  display: block !important;
}

/* Remove all borders */
.no-border {
  border-width: 0;
}

/* Blue text color — matches the Ace library accent color */
.blue {
  color: #478fca !important;
}

/* Green text color — matches the Ace library success color */
.green {
  color: #69aa46 !important;
}

/* Lighter font weight */
.lighter {
  font-weight: lighter;
}

/* Legacy Bootstrap 4 text alignment classes (removed in Bootstrap 5) */
.text-left {
  text-align: left !important;
}

.text-right {
  text-align: right !important;
}

/* Legacy Bootstrap 4 float classes (removed in Bootstrap 5) */
.float-left,
.pull-left {
  float: left !important;
}

.float-right,
.pull-right {
  float: right !important;
}
