body.acto-catalog-reader-page {
  --reader-ink: #182b45;
  --reader-blue: #2d5b96;
  --reader-line: #dce5ef;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #fff;
  color: var(--reader-ink);
  font-family: 'Google Sans', Arial, sans-serif;
}

.acto-catalog-reader-page *, .acto-catalog-reader-page *::before, .acto-catalog-reader-page *::after { box-sizing: border-box; }

.reader-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 8px clamp(12px, 2vw, 22px);
  background: #fff;
  border-bottom: 1px solid var(--reader-line);
}
.reader-back {
  color: var(--reader-blue);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.reader-back:hover { text-decoration: underline; }
#readerTitle {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--reader-ink);
  font-size: clamp(0.88rem, 2vw, 1.1rem);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-toolbar button, .reader-controls button {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--reader-line);
  border-radius: 9px;
  background: #fff;
  color: var(--reader-blue);
  font: 500 1.35rem/1 'Google Sans', Arial, sans-serif;
  cursor: pointer;
}
.reader-toolbar button[hidden] { display: none; }
.reader-toolbar button:hover:not(:disabled), .reader-controls button:hover:not(:disabled) { background: #edf4fc; border-color: #b2c9e5; }
.reader-controls button:disabled { opacity: 0.42; cursor: default; }
.reader-toolbar :focus-visible, .reader :focus-visible { outline: 2px solid #6696cc; outline-offset: 2px; }

.acto-catalog-reader-page .reader {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 8px clamp(8px, 2vw, 20px);
}
.reader-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--reader-line);
  border-radius: 10px;
  background: #e9eef4;
  cursor: grab;
  direction: ltr;
  perspective: 1400px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  scrollbar-width: thin;
}
.reader-stage:active { cursor: grabbing; }
.reader-stage.is-zoomed { overflow: auto; touch-action: pan-x pan-y pinch-zoom; }
.reader-book {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  margin: auto;
  transform-style: preserve-3d;
}
.reader-page {
  position: relative;
  flex: none;
  background: #fff;
  box-shadow: 0 4px 18px #182b4526;
}
.reader-page canvas { display: block; }
.reader-page[hidden] { display: none; }
.reader-book:not(:has(.reader-page[hidden])) .reader-page--left::after,
.reader-book:not(:has(.reader-page[hidden])) .reader-page--right::after {
  position: absolute;
  inset-block: 0;
  width: 13px;
  pointer-events: none;
  content: "";
}
.reader-page--left::after { right: 0; background: linear-gradient(90deg, transparent, #192b461a); }
.reader-page--right::after { left: 0; background: linear-gradient(270deg, transparent, #192b4612); }
.reader-flip {
  position: absolute;
  inset-block: 0;
  margin-block: auto;
  z-index: 2;
  pointer-events: none;
  transform: translateZ(1px);
  backface-visibility: hidden;
  box-shadow: 0 4px 16px #111b2a55;
}
.reader-flip--next { right: 0; transform-origin: left center; }
.reader-flip--prev { left: 0; transform-origin: right center; }

.reader-controls {
  display: grid;
  flex: none;
  grid-template-columns: auto minmax(76px, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2.5vw, 24px);
  width: min(100%, 720px);
  margin-inline: auto;
  padding: 2px 4px;
  background: #fff;
}
.reader-controls__pages, .reader-controls__zoom {
  display: flex;
  align-items: center;
  gap: 7px;
}
.reader-controls__pages { direction: ltr; }
#readerPageInput {
  width: 50px;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--reader-line);
  border-radius: 7px;
  background: #f6f8fb;
  color: inherit;
  font: inherit;
  text-align: center;
  appearance: textfield;
}
#readerPageInput::-webkit-inner-spin-button, #readerPageInput::-webkit-outer-spin-button { appearance: none; }
#readerCounter, #readerZoomLevel {
  min-width: 45px;
  color: #4e627e;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.reader-progress { width: 100%; margin: 0; accent-color: var(--reader-blue); cursor: pointer; direction: ltr; }
.reader-progress:disabled { opacity: 0.42; cursor: default; }
.reader-hint {
  flex: none;
  margin: 0;
  color: #52657f;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}
.reader-status {
  position: absolute;
  z-index: 5;
  inset: 8px clamp(8px, 2vw, 20px) auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px 12px 0 0;
  background: #f6f9fdf5;
  color: var(--reader-ink);
  font-size: 0.875rem;
  text-align: center;
}
.reader-status a { color: var(--reader-blue); }
.reader-status[hidden] { display: none; }
.reader > #readerOriginalPdf[hidden] { display: none; }

@media (max-width: 560px) {
  .reader-toolbar { gap: 10px; min-height: 54px; }
  .reader-back { font-size: 0.75rem; }
  .reader-stage { border-radius: 8px; }
  .reader-controls { grid-template-columns: 1fr auto; gap: 5px 8px; padding: 6px 8px; }
  .reader-controls button { width: 32px; height: 34px; }
  .reader-controls__pages, .reader-controls__zoom { gap: 4px; }
  #readerPageInput { width: 40px; height: 32px; }
  #readerCounter, #readerZoomLevel { min-width: 36px; }
  .reader-progress { grid-column: 1 / -1; grid-row: 1; height: 20px; }
  .reader-hint { display: none; }
}

/* ==========================================================================
   PDF OKUYUCU — yenilenmiş görünüm ve yükleme iskeleti
   ========================================================================== */
body.acto-catalog-reader-page {
  --reader-ink: #132a47;
  --reader-blue: #1d5aa8;
  --reader-line: #dfe8f4;
  background: #eef3fa;
}
.reader-toolbar {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid #e3ebf6;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.reader-toolbar #readerTitle {
  font-weight: 600;
  letter-spacing: -.01em;
}
.acto-catalog-reader-page .reader {
  gap: 10px;
  padding: 10px clamp(10px, 2vw, 20px) 12px;
}
.reader-stage {
  position: relative;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 0%, #f8fbff 0%, #e6eef8 55%, #dfe8f3 100%);
  box-shadow: inset 0 1px 0 #fff, 0 18px 40px -30px rgba(16, 42, 80, .35);
}
.reader-page {
  border-radius: 3px;
  box-shadow: 0 12px 32px rgba(15, 35, 65, .16);
}
.reader-controls {
  width: min(100%, 780px);
  padding: 8px 12px;
  border: 1px solid #e0e9f4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px -18px rgba(16, 42, 80, .3);
  grid-template-columns: auto minmax(90px, 1fr) auto;
}
.reader-controls button {
  border-color: #dbe5f1;
  border-radius: 10px;
  background: #f8fbff;
}
.reader-controls button:hover:not(:disabled) { background: #eaf3ff; }
#readerPageInput {
  border-radius: 9px;
  background: #f8fbff;
}
.reader-hint {
  color: #7b8ba1;
  font-size: 11px;
}
.reader-status {
  inset: 18px auto auto 50%;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border: 1px solid #dbe6f3;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 20px -12px rgba(16, 42, 80, .35);
  font-size: 12.5px;
  line-height: 1.4;
  transform: translateX(-50%);
  white-space: normal;
}
.reader-status a { font-weight: 600; }

/* Modal içinde gömülüyken kendi araç çubuğunu gizle. */
body.is-embedded .reader-toolbar { display: none; }
body.is-embedded .reader { padding-top: 12px; }

@media (max-width: 560px) {
  .reader-status { top: 12px; font-size: 11.5px; }
}

/* PDF yükleniyor durumu: yuvarlak spinner + bekleme metni */
.reader-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.reader-status__spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid #d6e4f4;
  border-top-color: #1c5aa6;
  border-radius: 50%;
  animation: readerStatusSpin .7s linear infinite;
}
.reader-status__text {
  min-width: 0;
  text-align: center;
}
@keyframes readerStatusSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .reader-status__spinner { animation: none; }
}
