/* custom.css (must load after bootstrap.css) */
/* -------------------------------------------------------------------------- */

/* Bootstrap overrides */

:root {
  /* --bs-body-bg: #9c9ea1;  */
  /* --bs-body-bg-rgb: 156, 158, 161; */
  /* PRIMARY */
  --bs-primary: #009485;
  --bs-primary-rgb: 0, 148, 133;
  --bs-primary-darker: #006b60;
  --bs-primary-darker-rgb: 0, 107, 96;
  --bs-primary-lighter: #00a695;
  --bs-primary-lighter-rgb: 0, 166, 149;
  /* SUCCESS */
  --bs-success: #01913b;
  --bs-success-rgb: 0, 145, 59;
  --bs-success-darker: #02692b;
  --bs-success-darker-rgb: 0, 105, 43;
  --bs-success-lighter: #00b549;
  --bs-success-lighter-rgb: 0, 181, 73;
}


a {
  color: var(--bs-primary);
  text-decoration: none; /* no underline */
}

a:hover,
a:focus {
  color: var(--bs-primary-dark); /* optional: darker shade on hover */
  text-decoration: none; /* no underline */
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary-darker);
  --bs-btn-hover-border-color: var(--bs-primary-darker);
  --bs-btn-active-bg: var(--bs-primary-lighter);
  --bs-btn-active-border-color: var(--bs-primary-lighter);
}

.btn-success {
  --bs-btn-bg: var(--bs-success);
  --bs-btn-border-color: var(--bs-success);
  --bs-btn-hover-bg: var(--bs-success-darker);
  --bs-btn-hover-border-color: var(--bs-success-darker);
  --bs-btn-active-bg: var(--bs-success-lighter);
  --bs-btn-active-border-color: var(--bs-success-lighter);
}   

.table-primary {
    --bs-table-bg: #0094854f !important;
}

.page-link {
    color: var(--bs-dark);
    border-color: var(--bs-dark); 
}

.page-item.active .page-link {
    background-color: var(--bs-dark); 
    border-color: var(--bs-dark); 
    color: #fff;
}

.page-link:hover {
    color: #fff; 
    background-color: var(--bs-dark); 
    border-color: var(--bs-dark);
}

.nav-tabs .nav-link:not(.active) {
  color: var(--bs-secondary);
}

/* -------------------------------------------------------------------------- */

/* For the htmx loading spinner */

#loading-spinner-full,
#loading-spinner-corner {
  display: none; /* Hidden by default */
  pointer-events: none; /* Allow clicks through when hidden */
}

#loading-spinner-full.htmx-request,
#loading-spinner-corner.htmx-request {
  display: block;
  pointer-events: all; /* Block clicks when visible */
}

.loading-overlay-full {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(125, 125, 125, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-overlay-corner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: none;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  z-index: 9999;
}

.loading-spinner {
  border: 24px solid #f3f3f3;
  border-top: 24px solid #157046;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 1s linear infinite;
}

.loading-spinner-small {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #157046;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------- */

/* For select2 inputs */

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bs-body-bg) !important;
}

/* Dropdown menu */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    box-shadow: var(--bs-dropdown-box-shadow) !important;
}

/* Single select main box */
.select2-container--bootstrap-5 .select2-selection--single {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
}

/* Single select selected text */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color) !important;
    line-height: 1.5em;
}

/* Single select focus glow */
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Single select search field */
.select2-container--bootstrap-5 .select2-search__field {
    outline: none !important;
    border-color: var(--bs-secondary) !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Multi-select main box */
.select2-container--bootstrap-5 .select2-selection--multiple {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important;
    min-height: calc(1.5em + 0.75rem) !important;
}

/* Multi-select selected text */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    color: var(--bs-body-color) !important;
}

/* Multi-select selected items/chips */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-primary) !important; /* Active selection */
    color: var(--bs-light) !important;
    border: 1px solid var(--bs-primary-dark) !important;
    border-radius: var(--bs-border-radius) !important;
    padding-right: 0.25rem !important;
}

/* Multi-select "x" in selected items. White -> red on hover */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") 50%/.75rem auto no-repeat !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove:hover {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ff0000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") 50%/.75rem auto no-repeat !important;
}

/* Multi-select padding for selected items text */
.select2-container--bootstrap-5 
.select2-selection--multiple 
.select2-selection__choice 
.select2-selection__choice__display {
    margin-left: .5rem !important;  /* mx-2 = 0.5rem */
    margin-right: .5rem !important;
}


/* Multi-select focus glow */
.select2-container--bootstrap-5.select2-container--focus .select2-selection--multiple {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Multi-select search field */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field {
    outline: none !important;
    border: none !important;
    background: transparent !important;
    color: var(--bs-body-color) !important;
}

/* Dropdown options */
.select2-container--bootstrap-5 .select2-results__option {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Highlighted/active dropdown option */
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected,.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) {
    background-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}