/* custom.css */
/* Override หรือเพิ่ม style ที่เฉพาะของระบบ */

body {
  font-family: "Sarabun", "Segoe UI", Arial, sans-serif;
  background-color: #f8f9fa;
}

/* Card look & feel */
.card {
  border-radius: .75rem;
}

/* Navbar branding */
.navbar-brand {
  font-weight: 600;
}

/* Offcanvas menu */
.offcanvas .list-group-item {
  border: none;
}
.offcanvas .list-group-item:hover {
  background-color: rgba(255, 255, 255, .1);
}

/* Pagination cursor */
.page-link {
  cursor: pointer;
}

/* ✅ Loading Spinner Overlay */
#loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1055; /* สูงกว่า modal backdrop */
  display: flex;
  justify-content: center;
  align-items: center;

  background-color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* เมื่อ HTMX เริ่ม request จะเพิ่ม class .htmx-request ให้ body */
.htmx-request #loading-spinner {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* สำหรับกรณี element ใช้ hx-indicator โดยตรง (เช่น tbody, ปุ่ม ฯลฯ) */
.htmx-request.hx-indicator #loading-spinner {
  opacity: 1;
  visibility: visible;
}

/* Spinner ขนาดใหญ่ขึ้น และข้อความ */
#loading-spinner .spinner-border {
  width: 3rem;
  height: 3rem;
}
#loading-spinner .loading-text {
  margin-top: 1rem;
  color: #0d6efd;
  font-weight: 600;
}

/* ป้องกันการกระตุกระหว่าง modal fade */
.modal.show ~ #loading-spinner {
  z-index: 2000; /* สูงกว่า modal backdrop แต่ต่ำกว่า modal-content */
}
