/* ═══════════════════════════════════════════════════════════════
   reading-room.css — Reading Room drawer + Xaman auth gate
   Shared across all PayWithXRP pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Reading Room overlay ────────────────────────────────────── */
.rr-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(1, 9, 20, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.rr-overlay.rr-open { opacity: 1; pointer-events: all; }

/* ── Reading Room panel ──────────────────────────────────────── */
.rr-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 801;
  width: min(68vw, 860px);
  background: #011627;
  border-left: 1px solid rgba(0, 201, 177, 0.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 40px rgba(0, 0, 0, 0.5);
}
.rr-panel.rr-open { transform: translateX(0); }

/* ── Panel header ────────────────────────────────────────────── */
.rr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 201, 177, 0.1);
  flex-shrink: 0; gap: 12px;
}
.rr-header-left {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.rr-logo { font-weight: 700; color: #00C9B1; font-size: 0.9rem; white-space: nowrap; }
.rr-chapter-title {
  font-size: 0.82rem; color: rgba(176, 207, 201, 0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-chapter-sep { color: rgba(0, 201, 177, 0.3); font-size: 0.75rem; }
.rr-close {
  background: none; border: 1px solid rgba(0, 201, 177, 0.2);
  border-radius: 4px; color: rgba(0, 201, 177, 0.6);
  width: 30px; height: 30px; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rr-close:hover { border-color: #00C9B1; color: #00C9B1; background: rgba(0, 201, 177, 0.07); }

/* ── Body: sidebar + content ─────────────────────────────────── */
.rr-body { display: flex; flex: 1; overflow: hidden; }

/* ── Chapter sidebar ─────────────────────────────────────────── */
.rr-sidebar {
  width: 172px; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto; padding: 12px 0;
  background: #011e30;
}
.rr-chapter-btn {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; cursor: pointer;
  transition: all 0.15s; line-height: 1.3;
}
.rr-chapter-btn:hover {
  background: rgba(0, 201, 177, 0.05);
  border-left-color: rgba(0, 201, 177, 0.3);
}
.rr-chapter-btn.rr-active {
  background: rgba(0, 201, 177, 0.08);
  border-left-color: #00C9B1;
}
.rr-ch-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.rr-ch-label {
  font-size: 0.8rem; color: #7aa8a0;
  transition: color 0.15s;
}
.rr-chapter-btn:hover .rr-ch-label { color: #d0e8e2; }
.rr-chapter-btn.rr-active .rr-ch-label { color: #00C9B1; font-weight: 600; }

/* ── Content area ────────────────────────────────────────────── */
.rr-content {
  flex: 1; overflow-y: auto;
  padding: 28px 36px;
  scroll-behavior: smooth;
}
.rr-content-loading {
  text-align: center; padding: 60px 20px;
  color: #7aa8a0; font-size: 0.88rem;
}
.rr-content-loading::before {
  content: '';
  display: block;
  width: 32px; height: 32px;
  border: 3px solid rgba(0, 201, 177, 0.2);
  border-top-color: #00C9B1;
  border-radius: 50%;
  animation: rr-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* ── Content typography overrides (compact inside drawer) ────── */
.rr-content h1, .rr-content h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 800; color: #f0faf8; line-height: 1.2;
  margin-bottom: 12px; letter-spacing: -0.01em;
}
.rr-content h3 { font-size: 1rem; font-weight: 700; color: #f0faf8; margin-bottom: 8px; }
.rr-content p  { font-size: 0.9rem; color: #d0e8e2; line-height: 1.75; margin-bottom: 1em; }
.rr-content p:last-child { margin-bottom: 0; }
.rr-content strong { color: #f0faf8; }
.rr-content a  { color: #00C9B1; }
.rr-content a:hover { color: #64FFDA; }

/* Reduce section padding inside the drawer */
.rr-content .section { padding: 0 0 32px; }
.rr-content .section:last-child { padding-bottom: 0; }
.rr-content .section--alt { background: none; }
.rr-content .inner { max-width: none; margin: 0; padding: 0; }
.rr-content .section-sub { margin-bottom: 24px; font-size: 0.9rem; }
.rr-content .section-heading { font-size: clamp(1.2rem, 2.5vw, 1.7rem); margin-bottom: 12px; }
.rr-content hr { border: none; border-top: 1px solid rgba(0, 201, 177, 0.1); margin: 28px 0; }

.rr-chapter-header {
  margin-bottom: 28px; padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 201, 177, 0.12);
}
.rr-chapter-eyebrow {
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: #00C9B1; margin-bottom: 8px;
}
.rr-chapter-heading {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 800; color: #f0faf8; line-height: 1.15;
  letter-spacing: -0.02em;
}
.rr-chapter-sub {
  font-size: 0.88rem; color: #7aa8a0; margin-top: 8px; line-height: 1.65;
}

/* ── Spinner ─────────────────────────────────────────────────── */
@keyframes rr-spin { to { transform: rotate(360deg); } }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .rr-panel  { width: 100%; border-left: none; }
  .rr-sidebar { display: none; }
  .rr-content { padding: 20px 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   Xaman Auth Gate
   ═══════════════════════════════════════════════════════════════ */

#xaman-gate {
  position: fixed; inset: 0; z-index: 850;
  background: rgba(1, 9, 20, 0.94);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.xg-box {
  background: #011e30;
  border: 1px solid rgba(0, 201, 177, 0.22);
  border-radius: 12px;
  padding: 40px 32px 32px;
  max-width: 400px; width: 100%;
  text-align: center;
}
.xg-brand {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: #00C9B1; margin-bottom: 16px;
}
.xg-heading {
  font-size: 1.2rem; font-weight: 800; color: #f0faf8;
  margin-bottom: 10px; letter-spacing: -0.01em;
}
.xg-sub {
  font-size: 0.85rem; color: #7aa8a0;
  margin-bottom: 24px; line-height: 1.65;
}
.xg-qr {
  background: #fff; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px; margin-bottom: 16px;
  min-width: 200px; min-height: 200px;
}
.xg-qr img { display: block; width: 180px; height: 180px; }
.xg-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(0, 201, 177, 0.2);
  border-top-color: #00C9B1;
  border-radius: 50%;
  animation: rr-spin 0.8s linear infinite;
}
.xg-status {
  font-size: 0.84rem; color: #7aa8a0;
  margin-bottom: 10px; min-height: 1.2em;
}
.xg-status.xg-ok  { color: #00C9B1; font-weight: 600; }
.xg-status.xg-err { color: #ff8080; }
.xg-deeplink {
  display: none; color: #00C9B1;
  font-size: 0.82rem; margin-bottom: 14px;
  font-weight: 600;
}
.xg-deeplink.xg-visible { display: block; }
.xg-note {
  font-size: 0.72rem; color: rgba(100, 160, 150, 0.45);
  margin-bottom: 18px; line-height: 1.55;
}
.xg-cancel {
  background: none; border: 1px solid rgba(255,255,255,0.1);
  color: #7aa8a0; border-radius: 6px;
  padding: 8px 20px; font-size: 0.85rem; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.xg-cancel:hover { border-color: rgba(255,255,255,0.25); color: #d0e8e2; }

/* ── Connected wallet badge (shown in place of gate after auth) ── */
.wallet-badge {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 201, 177, 0.08);
  border: 1px solid rgba(0, 201, 177, 0.2);
  border-radius: 8px; padding: 12px 16px;
  margin-bottom: 24px;
}
.wallet-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00C9B1; flex-shrink: 0;
  animation: rr-pulse 2s infinite;
}
@keyframes rr-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.wallet-badge-addr {
  flex: 1; font-family: monospace; font-size: 0.82rem; color: #d0e8e2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wallet-badge-disconnect {
  background: none; border: none; color: #7aa8a0;
  font-size: 0.75rem; cursor: pointer; white-space: nowrap;
  padding: 2px 6px; border-radius: 4px;
  transition: color 0.15s;
}
.wallet-badge-disconnect:hover { color: #ff8080; }
