/* =========================================================
   OCR overlay + spinner (reliable)
   Shown ONLY while rcpt-ocr-loading-target is loading
   ========================================================= */

/* Default: overlay hidden */
#rcpt-ocr-overlay {
  display: none;
}

/* When OCR callback is running, Dash sets this attribute */
#rcpt-ocr-loading-target[data-dash-is-loading="true"] ~ #rcpt-ocr-overlay {
  display: flex;
}

/* Overlay: dark transparent + blocks clicks */
.ocr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);

  align-items: center;
  justify-content: center;

  pointer-events: all; /* freeze page */
  cursor: progress;
}

/* Spinner */
.ocr-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: ocrspin 0.9s linear infinite;
}

@keyframes ocrspin {
  to { transform: rotate(360deg); }
}
