:root {
  --wrpr-safe-area-top: env(safe-area-inset-top, 0px);
  --wrpr-safe-area-right: env(safe-area-inset-right, 0px);
  --wrpr-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --wrpr-safe-area-left: env(safe-area-inset-left, 0px);
}

.wrpr-reader-wrapper {
  font-family: 'Inter', sans-serif;
  padding: 20px;
  background: #fff;
}
.wrpr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e60000;
  margin-bottom: 20px;
}
.wrpr-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wrpr-header h2 {
  font-size: 24px;
  color: #000;
}
.wrpr-lang-select {
  border: 1px solid #ccc;
  padding: 4px 8px;
  border-radius: 6px;
}
.wrpr-header-buy {
  background: #e60000;
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
}
.wrpr-book-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.wrpr-book-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}
.wrpr-book-card:hover {
  transform: scale(1.01);
}
.wrpr-book-card img {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
}
.wrpr-book-card .wrpr-actions {
  display: flex;
  gap: 10px;
}
.wrpr-info {
  flex: 1;
  text-align: left;
}
.wrpr-cover {
  margin-right: 1rem;
}
.wrpr-info h4 {
  font-size: 17px;
  margin: 0 0 4px;
}
.wrpr-info p {
  margin: 0;
  font-size: 14px;
  color: #444;
}
.wrpr-open-btn {
  background: #e60000;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
}
.wrpr-buy-link {
  background: #fff;
  color: #e60000;
  border: 2px solid #e60000;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  margin-left: 8px;
}
#wrpr-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(40px + var(--wrpr-safe-area-top)) calc(20px + var(--wrpr-safe-area-right))
    calc(40px + var(--wrpr-safe-area-bottom)) calc(20px + var(--wrpr-safe-area-left));
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  overflow-y: auto;
  animation: wrprFade 0.3s ease;
}

#wrpr-modal[aria-hidden='true'] {
  display: none;
}

#wrpr-modal-content {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 56px 48px 150px;
  width: min(90vw, 960px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

#wrpr-close {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e60000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#wrpr-close:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(230, 0, 0, 0.35);
}

#wrpr-pdf-canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  transition: opacity 0.22s ease, filter 0.22s ease;
  opacity: 1;
}

#wrpr-pdf-canvas.wrpr-canvas-fade-out {
  opacity: 0.2;
  filter: blur(1px);
}

@keyframes wrprFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== WRPR Reader Navigation – Final Polished ===== */
.wrpr-nav {
  position: absolute;
  bottom: calc(60px + var(--wrpr-safe-area-bottom)); /* sayfa numarasının hemen altına */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
}

.wrpr-fs-btn {
  position: absolute;
  bottom: calc(90px + var(--wrpr-safe-area-bottom));
  right: calc(20px + var(--wrpr-safe-area-right));
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: #ff0000;
  color: #fff;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
  z-index: 10002;
  cursor: pointer;
}

.wrpr-fs-btn:hover,
.wrpr-fs-btn:focus-visible {
  background: #d40000;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.wrpr-fs-btn:active {
  transform: scale(0.92);
}

.wrpr-fs-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}

.wrpr-fs-btn--active {
  background: #c20000;
}

@media (min-width: 1024px) {
  .wrpr-fs-btn {
    display: none;
  }
}

.wrpr-nav button {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #ff3b3b, #d40000);
  color: #fff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 20px rgba(255, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  position: relative;
  overflow: hidden;
}

.wrpr-nav button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wrpr-nav button:hover::after,
.wrpr-nav button:focus-visible::after {
  opacity: 1;
}

.wrpr-nav button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(255, 0, 0, 0.3);
}

.wrpr-nav button:active {
  transform: scale(0.94);
}

.wrpr-nav button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 4px;
}

.wrpr-nav button.is-disabled,
.wrpr-nav button:disabled {
  background: linear-gradient(145deg, #bdbdbd, #9e9e9e);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.wrpr-nav button.is-disabled::after,
.wrpr-nav button:disabled::after {
  opacity: 0;
}

.wrpr-nav button i {
  pointer-events: none;
}

/* Sayfa numarası stilini biraz yumuşatıyoruz */
.wrpr-page-info {
  position: absolute;
  bottom: calc(120px + var(--wrpr-safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: #444;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
  #wrpr-modal-content {
    width: 92% !important;
    height: auto !important;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }

  #wrpr-pdf-canvas {
    max-width: 100%;
    height: auto;
  }

  .wrpr-nav {
    bottom: calc(55px + var(--wrpr-safe-area-bottom));
    gap: 18px;
  }

  .wrpr-nav button {
    width: 48px;
    height: 48px;
    font-size: 18px;
    box-shadow: 0 10px 18px rgba(255, 0, 0, 0.25);
  }

  .wrpr-page-info {
    bottom: calc(95px + var(--wrpr-safe-area-bottom));
    font-size: 12px;
    padding: 2px 8px;
  }

  .wrpr-book-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .wrpr-book-card img {
    width: 90px;
    height: 90px;
    border-radius: 10px;
  }

  .wrpr-book-card .wrpr-buy-link {
    margin-top: 8px;
  }
}
