/* ═══════════════════════════════════════════════════════════
   PDF guide reader — standalone page (dark luxury, RTL)
   Self-contained on purpose: does NOT touch the main site CSS.
═══════════════════════════════════════════════════════════ */
:root {
  --rd-bg: #0b1220;
  --rd-surface: #111a2c;
  --rd-border: rgba(148, 184, 210, 0.14);
  --rd-text: #e8eef5;
  --rd-muted: #93a5b8;
  --rd-teal: #1d7d74;
  --rd-teal-strong: #25978c;
  --rd-error: #e5636e;
}

* { box-sizing: border-box; }

/* The page itself never scrolls: scrolling happens ONLY inside the
   reader container (.rd-viewer / .rd-gate). This kills pull-to-refresh
   and rubber-band reloads on iOS/Android without hurting anything else. */
html, body {
  margin: 0;
  padding: 0;
  background: var(--rd-bg);
  color: var(--rd-text);
  font-family: "Tajawal", "Cairo", sans-serif;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.licon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.2em;
}

/* ── Top bar ── */
.rd-topbar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rd-border);
}
.rd-topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rd-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.rd-brand-icon { color: var(--rd-teal-strong); display: inline-flex; }
.rd-pageinfo {
  direction: ltr;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rd-muted);
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  min-width: 72px;
  text-align: center;
}
.rd-pagesep { margin: 0 0.3em; opacity: 0.6; }

/* ── Gate ── */
.rd-gate {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  padding: 1.2rem;
}
.rd-gate.hidden { display: none; }
/* Card matches the main-site access gate (.access-card in style.css)
   so both products share one brand identity. */
.rd-gate-card {
  margin: auto; /* centers, yet stays scrollable when the keyboard shrinks the space */
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(20, 36, 62, 0.94), rgba(10, 20, 38, 0.96));
  border: 1px solid rgba(120, 170, 200, 0.18);
  border-radius: 22px;
  padding: 2.4rem 2rem 1.9rem;
  text-align: center;
  color: #eaf2f8;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rdGateIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rdGateIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.rd-gate-logo {
  width: 116px;
  height: auto;
  margin: 0 auto 1.2rem;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}
.rd-gate-card h1 {
  font-family: "Cairo", sans-serif;
  font-weight: 800;
  font-size: 1.55rem;
  margin: 0 0 0.5rem;
  color: #f4f9fc;
}
.rd-gate-sub {
  font-size: 0.97rem;
  line-height: 1.75;
  color: #a9bed1;
  margin: 0 auto 1.6rem;
  max-width: 34ch;
}
#rd-gate-input {
  width: 100%;
  font-family: "Tajawal", monospace;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  font-size: 1.15rem;
  color: #eaf2f8;
  padding: 0.95rem 1rem;
  background: rgba(7, 16, 28, 0.7);
  border: 1.5px solid rgba(120, 170, 200, 0.25);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-user-select: text;
  user-select: text;
}
#rd-gate-input::placeholder { color: #5d7286; letter-spacing: 0.1em; }
#rd-gate-input:focus {
  border-color: #1f9bb3;
  box-shadow: 0 0 0 4px rgba(31, 155, 179, 0.18);
}
#rd-gate-btn {
  width: 100%;
  margin-top: 0.8rem;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(120deg, #15406a, #1f9bb3);
  box-shadow: 0 12px 28px rgba(31, 155, 179, 0.28);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
#rd-gate-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(31, 155, 179, 0.36); }
#rd-gate-btn:active { transform: translateY(0); }
#rd-gate-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.rd-gate-msg {
  min-height: 1.4em;
  margin-top: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
}
.rd-gate-msg.is-error {
  background: rgba(158, 43, 58, 0.16);
  border: 1px solid rgba(200, 80, 95, 0.38);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  color: #ffd9de;
  font-weight: 700;
}
.rd-gate-msg.is-info { color: #a9bed1; }
.rd-gate-foot { margin: 1.35rem 0 0; font-size: 0.8rem; color: #7c93a8; }

/* "Buy now" CTA — same look as the main gate's .access-buy */
.rd-buy-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  color: #7c93a8;
  font-size: 0.82rem;
}
.rd-buy-divider::before,
.rd-buy-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(120, 170, 200, 0.2);
}
.rd-buy-divider[hidden], .rd-buy[hidden] { display: none; }
.rd-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 0.85rem 1.05rem;
  border-radius: 14px;
  background: linear-gradient(110deg, #1c5560 0%, #2a7f8a 55%, #379aa1 100%);
  box-shadow: 0 10px 24px rgba(28, 85, 96, 0.28);
  transition: transform 0.15s, box-shadow 0.2s;
}
.rd-buy:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(28, 85, 96, 0.38); }
.rd-buy:active { transform: translateY(0); }
.rd-buy:focus-visible { outline: 3px solid rgba(52, 210, 224, 0.6); outline-offset: 2px; }
.rd-buy-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}
.rd-buy-ic svg { width: 1.45rem; height: 1.45rem; }
.rd-buy-tx { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; min-width: 0; }
.rd-buy-title {
  font-family: "Cairo", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  line-height: 1.2;
}
.rd-buy-sub {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

/* ── Viewer: THE scroll container (the page itself is frozen) ── */
.rd-viewer {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* no pull-to-refresh / scroll chaining */
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom; /* vertical scroll + pinch zoom only */
  padding: 1.2rem 0.7rem 3rem;
}
.rd-viewer[hidden] { display: none; }
.rd-viewer-inner {
  max-width: 1060px;
  margin: 0 auto;
}
.rd-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--rd-muted);
  padding: 3.5rem 0;
  font-size: 0.95rem;
}
.rd-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(147, 165, 184, 0.3);
  border-top-color: var(--rd-teal-strong);
  border-radius: 50%;
  animation: rd-spin 0.8s linear infinite;
}
@keyframes rd-spin { to { transform: rotate(360deg); } }

.rd-pages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.rd-page {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #0e1626;
  border: 1px solid var(--rd-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.rd-page canvas {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.rd-page .rd-linklayer {
  position: absolute;
  inset: 0;
}
.rd-page .rd-link {
  position: absolute;
  display: block;
  border-radius: 4px;
}
.rd-page .rd-link:hover,
.rd-page .rd-link:focus-visible {
  background: rgba(45, 212, 191, 0.16);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.4) inset;
  outline: none;
}
.rd-page .rd-page-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(147, 165, 184, 0.45);
  font-size: 0.85rem;
}

/* ── Watermark + screenshot guard ── */
#content-watermark {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: none;
  background-repeat: repeat;
}
#content-watermark.is-active { display: block; }

#screenshot-guard {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--rd-bg);
  display: none;
  align-items: center;
  justify-content: center;
}
#screenshot-guard.is-active { display: flex; }
#screenshot-guard .sg-inner {
  color: var(--rd-muted);
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem;
  text-align: center;
}

@media (max-width: 640px) {
  .rd-viewer { padding: 0.7rem 0.35rem 2.2rem; }
  .rd-pages { gap: 9px; }
  .rd-page { border-radius: 7px; }
  .rd-gate-card { padding: 1.7rem 1.2rem; }
}
