/* Custom CSS overrides for IIS deployment */

/* Fix FontAwesome font paths for local deployment */
@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/fa-regular-400.woff2") format("woff2"),
    url("../fonts/fa-regular-400.ttf") format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Free";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("../fonts/fa-solid-900.woff2") format("woff2"),
    url("../fonts/fa-solid-900.ttf") format("truetype");
}

@font-face {
  font-family: "Font Awesome 6 Brands";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/fa-brands-400.woff2") format("woff2"),
    url("../fonts/fa-brands-400.ttf") format("truetype");
}

/* Professional Theme - Modal Fixes */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1040 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.6) !important;
}

.modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1050 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  outline: 0 !important;
}

.modal-dialog {
  position: relative !important;
  width: auto !important;
  margin: 0.5rem !important;
  pointer-events: none !important;
}

.modal-dialog-centered {
  display: flex !important;
  align-items: center !important;
  min-height: calc(100% - 1rem) !important;
}

.modal-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  pointer-events: auto !important;
  background-color: #ffffff !important;
  background-clip: padding-box !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 10px !important;
  outline: 0 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Ensure modal appears above everything */
.modal-open {
  overflow: hidden !important;
}

/* Custom modal backdrop for our inline style approach */
.custom-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Fix AdminLTE modal styles */
.modal-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  padding: 1rem 1rem !important;
  border-bottom: 1px solid #dee2e6 !important;
  border-top-left-radius: calc(0.3rem - 1px) !important;
  border-top-right-radius: calc(0.3rem - 1px) !important;
}

.modal-title {
  margin-bottom: 0 !important;
  line-height: 1.5 !important;
}

.modal-body {
  position: relative !important;
  flex: 1 1 auto !important;
  padding: 1rem !important;
}

.modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0.75rem !important;
  border-top: 1px solid #dee2e6 !important;
  border-bottom-right-radius: calc(0.3rem - 1px) !important;
  border-bottom-left-radius: calc(0.3rem - 1px) !important;
}

/* Bootstrap responsive grid fixes */
@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px !important;
    margin: 1.75rem auto !important;
  }
}

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

/* Form control fixes */
.form-control {
  display: block !important;
  width: 100% !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  background-color: #fff !important;
  background-image: none !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-control:focus {
  color: #212529 !important;
  background-color: #fff !important;
  border-color: #86b7fe !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Button fixes */
.btn {
  display: inline-block !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  text-align: center !important;
  text-decoration: none !important;
  vertical-align: middle !important;
  cursor: pointer !important;
  user-select: none !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  border-radius: 0.25rem !important;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.btn-primary {
  color: #fff !important;
  background-color: #007bff !important;
  border-color: #007bff !important;
}

.btn-success {
  color: #fff !important;
  background-color: #28a745 !important;
  border-color: #28a745 !important;
}

.btn-secondary {
  color: #fff !important;
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

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

.btn-warning {
  color: #212529 !important;
  background-color: #ffc107 !important;
  border-color: #ffc107 !important;
}

.btn-info {
  color: #fff !important;
  background-color: #17a2b8 !important;
  border-color: #17a2b8 !important;
}

.btn-light {
  color: #212529 !important;
  background-color: #f8f9fa !important;
  border-color: #f8f9fa !important;
}

.btn-dark {
  color: #fff !important;
  background-color: #343a40 !important;
  border-color: #343a40 !important;
}

/* Button hover states */
.btn-primary:hover {
  color: #fff !important;
  background-color: #0056b3 !important;
  border-color: #004085 !important;
}

.btn-success:hover {
  color: #fff !important;
  background-color: #218838 !important;
  border-color: #1e7e34 !important;
}

.btn-secondary:hover {
  color: #fff !important;
  background-color: #5a6268 !important;
  border-color: #545b62 !important;
}

/* Card fixes for IIS */
.card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
  background-color: #fff !important;
  background-clip: border-box !important;
  border: 1px solid rgba(0, 0, 0, 0.125) !important;
  border-radius: 0.25rem !important;
}

.card-header {
  padding: 0.75rem 1.25rem !important;
  margin-bottom: 0 !important;
  background-color: rgba(0, 0, 0, 0.03) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125) !important;
}

.card-body {
  flex: 1 1 auto !important;
  padding: 1.25rem !important;
}

.card-footer {
  padding: 0.75rem 1.25rem !important;
  background-color: rgba(0, 0, 0, 0.03) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.125) !important;
}

/* Table fixes */
.table {
  width: 100% !important;
  margin-bottom: 1rem !important;
  color: #212529 !important;
  border-collapse: collapse !important;
}

.table th,
.table td {
  padding: 0.75rem !important;
  vertical-align: top !important;
  border-top: 1px solid #dee2e6 !important;
}

.table thead th {
  vertical-align: bottom !important;
  border-bottom: 2px solid #dee2e6 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075) !important;
}

/* Alert fixes */
.alert {
  position: relative !important;
  padding: 0.75rem 1.25rem !important;
  margin-bottom: 1rem !important;
  border: 1px solid transparent !important;
  border-radius: 0.25rem !important;
}

.alert-success {
  color: #155724 !important;
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
}

.alert-danger {
  color: #721c24 !important;
  background-color: #f8d7da !important;
  border-color: #f5c6cb !important;
}

.alert-warning {
  color: #856404 !important;
  background-color: #fff3cd !important;
  border-color: #ffeaa7 !important;
}

.alert-info {
  color: #0c5460 !important;
  background-color: #d1ecf1 !important;
  border-color: #bee5eb !important;
}

/* Dropdown fixes */
.dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 1000 !important;
  display: none !important;
  float: left !important;
  min-width: 10rem !important;
  padding: 0.5rem 0 !important;
  margin: 0.125rem 0 0 !important;
  font-size: 1rem !important;
  color: #212529 !important;
  text-align: left !important;
  list-style: none !important;
  background-color: #fff !important;
  background-clip: padding-box !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 0.25rem !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175) !important;
}

.dropdown-menu.show {
  display: block !important;
}

.dropdown-item {
  display: block !important;
  width: 100% !important;
  padding: 0.25rem 1.5rem !important;
  clear: both !important;
  font-weight: 400 !important;
  color: #212529 !important;
  text-align: inherit !important;
  white-space: nowrap !important;
  background-color: transparent !important;
  border: 0 !important;
}

.dropdown-item:hover {
  color: #16181b !important;
  text-decoration: none !important;
  background-color: #f8f9fa !important;
}

/* Badge fixes */
.badge {
  display: inline-block !important;
  padding: 0.25em 0.4em !important;
  font-size: 75% !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
  vertical-align: baseline !important;
  border-radius: 0.25rem !important;
}

.badge-primary {
  color: #fff !important;
  background-color: #007bff !important;
}

.badge-success {
  color: #fff !important;
  background-color: #28a745 !important;
}

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

.badge-warning {
  color: #212529 !important;
  background-color: #ffc107 !important;
}

.badge-info {
  color: #fff !important;
  background-color: #17a2b8 !important;
}

/* Pagination fixes */
.pagination {
  display: flex !important;
  padding-left: 0 !important;
  list-style: none !important;
  border-radius: 0.25rem !important;
}

.page-link {
  position: relative !important;
  display: block !important;
  padding: 0.5rem 0.75rem !important;
  margin-left: -1px !important;
  line-height: 1.25 !important;
  color: #007bff !important;
  background-color: #fff !important;
  border: 1px solid #dee2e6 !important;
}

.page-link:hover {
  z-index: 2 !important;
  color: #0056b3 !important;
  text-decoration: none !important;
  background-color: #e9ecef !important;
  border-color: #dee2e6 !important;
}

.page-item.active .page-link {
  z-index: 3 !important;
  color: #fff !important;
  background-color: #007bff !important;
  border-color: #007bff !important;
}

/* Nav tabs fixes */
.nav-tabs {
  border-bottom: 1px solid #dee2e6 !important;
}

.nav-tabs .nav-link {
  margin-bottom: -1px !important;
  border: 1px solid transparent !important;
  border-top-left-radius: 0.25rem !important;
  border-top-right-radius: 0.25rem !important;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  border-color: #e9ecef #e9ecef #dee2e6 !important;
}

.nav-tabs .nav-link.active {
  color: #495057 !important;
  background-color: #fff !important;
  border-color: #dee2e6 #dee2e6 #fff !important;
}

/* Spinner/Loading fixes */
.spinner-border {
  display: inline-block !important;
  width: 2rem !important;
  height: 2rem !important;
  vertical-align: text-bottom !important;
  border: 0.25em solid currentColor !important;
  border-right-color: transparent !important;
  border-radius: 50% !important;
  animation: spinner-border 0.75s linear infinite !important;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg) !important;
  }
}

/* Tooltip fixes */
.tooltip {
  position: absolute !important;
  z-index: 1070 !important;
  display: block !important;
  margin: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif !important;
  font-style: normal !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  text-align: left !important;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  word-break: normal !important;
  word-spacing: normal !important;
  white-space: normal !important;
  line-break: auto !important;
  font-size: 0.875rem !important;
  word-wrap: break-word !important;
  opacity: 0.9 !important;
}

.tooltip-inner {
  max-width: 200px !important;
  padding: 0.25rem 0.5rem !important;
  color: #fff !important;
  text-align: center !important;
  background-color: #000 !important;
  border-radius: 0.25rem !important;
}

/* Fix for close buttons */
.btn-close {
  box-sizing: content-box !important;
  width: 1em !important;
  height: 1em !important;
  padding: 0.25em 0.25em !important;
  color: #000 !important;
  background: transparent
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%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")
    center/1em auto no-repeat !important;
  border: 0 !important;
  border-radius: 0.25rem !important;
  opacity: 0.5 !important;
}

.btn-close:hover {
  color: #000 !important;
  text-decoration: none !important;
  opacity: 0.75 !important;
}

/* Ensure proper z-index layering */
.navbar {
  z-index: 1030 !important;
}

.sidebar {
  z-index: 1020 !important;
}

.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}

.tooltip {
  z-index: 1070 !important;
}

/* Fix for input groups */
.input-group {
  position: relative !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  width: 100% !important;
}

.input-group > .form-control {
  position: relative !important;
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 0 !important;
}

.input-group-text {
  display: flex !important;
  align-items: center !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #495057 !important;
  text-align: center !important;
  white-space: nowrap !important;
  background-color: #e9ecef !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem !important;
}

/* Fix for checkboxes and radios */
.form-check {
  display: block !important;
  min-height: 1.5rem !important;
  padding-left: 1.5em !important;
  margin-bottom: 0.125rem !important;
}

.form-check-input {
  width: 1em !important;
  height: 1em !important;
  margin-top: 0.25em !important;
  margin-left: -1.5em !important;
  vertical-align: top !important;
  background-color: #fff !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  border: 1px solid rgba(0, 0, 0, 0.25) !important;
  appearance: none !important;
}

.form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

/* Fix for select dropdowns */
.form-select {
  display: block !important;
  width: 100% !important;
  padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem !important;
  appearance: none !important;
}

.form-select:focus {
  border-color: #86b7fe !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* AdminLTE specific overrides */
.content-wrapper {
  background-color: #f4f6f9 !important;
}

.main-header {
  border-bottom: 1px solid #dee2e6 !important;
}

.main-sidebar {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22) !important;
}

/* Ensure React components render properly */
#root {
  min-height: 100vh !important;
}

/* Fix for any inline modal styles */
div[style*="position: fixed"][style*="z-index"] {
  z-index: 9999 !important;
}
