.button-container {
  display: block;
  width: 100%;
  text-align: center;
}

.my-modal-button {
  text-align: center;
  display: inline-block;
}

/* Overlay */
.my-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* toggle to 'flex' when opening */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 10px;
  box-sizing: border-box;
}

/* Modal shell */
.my-modal-window {
  position: relative; /* IMPORTANT: anchor for the absolute container */
  width: 90vw;
  height: 80vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Toolbar */
.rnt-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  width: auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #000000;
  z-index: 5;
  opacity: 0.8; /* slight translucency */
}

/* REQUIRED: pdf.js scroll container must be absolute */
.viewerContainer {
  position: absolute; /* <- this satisfies the error */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  will-change: transform;
  backface-visibility: hidden;
  image-rendering: auto !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.viewerContainer .pdfPageView {
  margin-right: 16px; /* gap between pages */
}

/* Optional: last page has no extra margin */
.viewerContainer .pdfPageView:last-child {
  margin-right: 0;
}

/* pdf.js viewer root */
.pdfViewer {
  position: relative; /* pages & overlays are laid out inside */
  width: 100%;
  max-height: 100%;
}

/* Usual page & overlay rules */
.pdfViewer .page {
  position: relative;
  background: #fff;
  border: none;
}
.pdfViewer .textLayer,
.pdfViewer .annotationLayer,
.pdfViewer .xfaLayer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}


#pdfViewer {
  display: flex;
  flex-direction: row;      /* keep pages side by side */
  justify-content: center;  /* center horizontally */
  align-items: center;      /* center vertically */
}

/* Close button */
.my-modal-close {
  opacity: 0.8; /* slight translucency */
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 50px;
  cursor: pointer;
  z-index: 5;
}

.rnt-toolbar .download {
  margin-left: 16px;
}

.download i.eicon-file-download {
  transform: scale(1.5);
}

.my-modal-close i.eicon-editor-close {
  transform: scale(1.5);
}

/* Make PDF link annotations invisible but keep them clickable */
.my-modal-overlay .annotationLayer .linkAnnotation > a {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;

  /* keep usability */
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none; /* optional */
  -webkit-tap-highlight-color: transparent; /* iOS Safari touch highlight */
}

/* Ensure hover/focus don't reintroduce a highlight */
.my-modal-overlay .annotationLayer .linkAnnotation > a:hover,
.my-modal-overlay .annotationLayer .linkAnnotation > a:focus,
.my-modal-overlay .annotationLayer .linkAnnotation > a:focus-visible,
.my-modal-overlay .annotationLayer .linkAnnotation > a:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* If the yellow is from the Find tool (textLayer), neutralize it too */
.my-modal-overlay .textLayer .highlight,
.my-modal-overlay .textLayer .highlight.selected {
  background-color: transparent !important;
  box-shadow: none !important;
}

.textLayer {
  display: block !important;
  opacity: 1 !important;
  transform: none !important;
}
.textLayer span {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
