/* ============================================
   Bootstrap 5 + Tailwind CSS Compatibility Layer
   ============================================ */

/* Reset Bootstrap conflicts with Tailwind */
.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Ensure Bootstrap modals work correctly */
.modal.fade {
  transition: opacity 0.15s linear;
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

/* Bootstrap alert compatibility */
.alert {
  position: relative;
  padding: 1rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
}

.alert-danger {
  color: #991b1b;
  background-color: #fef2f2;
  border-color: #fecaca;
}

.alert-success {
  color: #166534;
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

.alert-dismissible {
  padding-right: 3rem;
}

.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 1.25rem 1rem;
}

/* Bootstrap form validation */
.is-invalid {
  border-color: #dc2626 !important;
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc2626;
}

.invalid-feedback.d-block {
  display: block;
}

/* Bootstrap table */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: #1f2937;
  border-collapse: collapse;
}

.table-bordered {
  border: 1px solid #e5e7eb;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #e5e7eb;
}

.table-hover tbody tr:hover {
  background-color: #f9fafb;
}

/* Bootstrap utilities we need */
.text-end {
  text-align: right !important;
}

.d-block {
  display: block !important;
}

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

.mb-0 {
  margin-bottom: 0 !important;
}

.mt-3 {
  margin-top: 0.75rem !important;
}

.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* Ensure body doesn't shift when modal opens */
body.modal-open {
  overflow: hidden;
  padding-right: 0 !important;
}
