/**
 * Global loader overlay — Online Booking style (white wash + blocks interaction).
 * Applies to ngLoader (.loader), #loadingImage, and mobile .im-loader-overlay.
 */

/* ngLoader full-screen block (overrides weak rgba(0,0,0,0.22) from ngLoader).
   Do not force display when .ng-hide — Angular must be able to hide the loader. */
.loader {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  z-index: 200000 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  pointer-events: auto !important;
  cursor: wait !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: none !important;
  box-sizing: border-box !important;
}

.loader:not(.ng-hide) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.loader.ng-hide {
  display: none !important;
  pointer-events: none !important;
}

/* Keep spinner/message group centered (ngLoader template inner div) */
.loader > div {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin: 0 auto !important;
  pointer-events: none !important;
}

/* Darker message chip so text stays readable on white wash */
.loader > div[style*="background-color"],
.loader .loader-message,
.loader [class*="message"] {
  color: #374151 !important;
}

body.mm-loader-active {
  cursor: wait !important;
}

body.mm-loader-active #tpAppRoot {
  /* Overlay sits above; this blocks accidental focus into the app underneath */
  pointer-events: none !important;
}

/* Allow the overlay itself (appended to body, outside #tpAppRoot) to receive events */
body.mm-loader-active .loader,
body.mm-loader-active #loadingImage {
  pointer-events: auto !important;
}

/* #loadingImage (gate / login / legacy show) — match booking overlay */
div#loadingImage {
  position: fixed !important;
  inset: 0 !important;
  z-index: 200001 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  pointer-events: auto !important;
  cursor: wait !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: none !important;
}

div#loadingImage .mm-loader-panel {
  background: transparent !important;
  box-shadow: none !important;
}

/* Mobile document screens (.im-loader-overlay) */
.im-loader-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 200000 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  pointer-events: auto !important;
  cursor: wait !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
