/**
 * AutoCheckView — site-wide Bootstrap 5 modal theme
 * Safe: only styles .modal.fade / .modal.show (not legacy .modal-overlay)
 */

:root {
  --acv-modal-radius: 16px;
  --acv-modal-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  --acv-modal-accent: #0d6efd;
}

/* Backdrop */
.modal-backdrop.show {
  opacity: 0.55;
  backdrop-filter: blur(2px);
}

/* Dialog shell */
.modal.fade .modal-dialog {
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.modal.show .modal-dialog {
  transform: none;
}

.modal .modal-content {
  border: 0;
  border-radius: var(--acv-modal-radius);
  box-shadow: var(--acv-modal-shadow);
  overflow: hidden;
  background: #fff;
  max-height: none; /* don't fight Bootstrap scrollable dialogs */
  width: auto;
}

.modal .modal-header {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e9ecef;
  padding: 1rem 1.25rem;
  border-radius: 0;
}

.modal .modal-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.modal .modal-body {
  padding: 1.25rem;
}

.modal .modal-footer {
  border-top: 1px solid #e9ecef;
  background: #f8fafc;
  padding: 0.9rem 1.25rem;
  gap: 0.5rem;
}

.modal .btn-close {
  position: static;
  width: 1rem;
  height: 1rem;
  padding: 0.75rem;
  margin: 0;
  background-color: transparent;
  opacity: 0.55;
  border-radius: 999px;
}
.modal .btn-close:hover {
  opacity: 1;
  background: #e9ecef;
}

/* Centered + mobile sheet feel */
.modal-dialog-centered {
  min-height: calc(100% - 1.75rem);
}

@media (max-width: 575.98px) {
  .modal .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .modal .modal-content {
    border-radius: 14px;
    max-height: calc(100vh - 1rem);
  }
  .modal .modal-body {
    padding: 1rem;
  }
  .modal-dialog-scrollable .modal-body {
    max-height: min(70vh, 520px);
  }
}

/* --------------------------------------------------------------------------
   Booking: Change Package modal
   -------------------------------------------------------------------------- */
.category-modal .modal-dialog {
  max-width: 820px;
}

.category-option {
  display: block;
  text-align: left;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.1rem 1rem 1rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
  height: 100%;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.category-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
  transition: background 0.18s ease;
}

.category-option:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 28px rgba(13, 110, 253, 0.12);
  transform: translateY(-2px);
  background: #fbfdff;
}

.category-option:focus-visible {
  outline: 2px solid var(--acv-modal-accent);
  outline-offset: 2px;
}

.category-option.selected {
  border-color: var(--acv-modal-accent);
  background: linear-gradient(180deg, #eff6ff 0%, #fff 55%);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18);
}

.category-option.selected::before {
  background: var(--acv-modal-accent);
}

.category-option .badge {
  vertical-align: middle;
}

.category-option h6 {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.category-option .opt-price {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.category-option .opt-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: #fff;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.category-option.selected .opt-check {
  border-color: var(--acv-modal-accent);
  background: var(--acv-modal-accent);
  color: #fff;
}

.change-category-btn {
  border-radius: 12px !important;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.change-category-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 767.98px) {
  .category-modal .modal-body .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .category-option {
    padding: 1rem 0.9rem 0.9rem;
  }

  .category-option .opt-price {
    font-size: 1.2rem;
  }

  .category-option .opt-check {
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
  }
}

@media (hover: none) {
  .category-option:hover,
  .change-category-btn:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Client dashboard modals
   -------------------------------------------------------------------------- */
#orderDetailsModal .modal-header {
  background: linear-gradient(135deg, #0d6efd 0%, #0f766e 100%);
  border-bottom: 0;
}
#orderDetailsModal .modal-title,
#orderDetailsModal .btn-close {
  color: #fff;
  filter: invert(0);
}
#orderDetailsModal .btn-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%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;
  opacity: 0.9;
}
#orderDetailsModal .btn-close:hover {
  background-color: rgba(255,255,255,0.15);
  opacity: 1;
}

#deleteOneModal .modal-header,
#bulkDeleteModal .modal-header {
  background: #fff5f5;
  border-bottom-color: #fecaca;
}
#deleteOneModal .modal-title,
#bulkDeleteModal .modal-title {
  color: #b91c1c;
}

/* Body scroll lock helper (Bootstrap usually handles; reinforce) */
body.modal-open {
  overflow: hidden;
  padding-right: 0 !important; /* avoid layout jump on some themes */
}
