/* =============================================
   LODESTONE BANKING — PDF VIEWER MODAL
   Design: refined dark glass / editorial luxury
   Shared by testimonials.html & articles.html
   ============================================= */

/* ── OVERLAY ──────────────────────────────────── */
.pdf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 14, 24, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pdf-modal-overlay.open {
  display: flex;
  animation: overlayIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── MODAL SHELL ──────────────────────────────── */
.pdf-modal {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  height: min(90vh, 940px);
  overflow: hidden;
  border-radius: 12px;
  /* Layered glass effect */
  background: linear-gradient(
    160deg,
    rgba(28, 42, 64, 0.98) 0%,
    rgba(16, 26, 44, 0.99) 100%
  );
  border: 1px solid rgba(184, 160, 122, 0.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 40px 100px rgba(0,0,0,0.65),
    0 8px 32px rgba(0,0,0,0.4),
    0 0 80px rgba(184,160,122,0.04);
  animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(24px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── HEADER ───────────────────────────────────── */
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  height: 56px;
  flex-shrink: 0;
  /* Subtle glass top bar */
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(184,160,122,0.12);
  position: relative;
}

/* Thin gold accent line at very top */
.pdf-modal-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(184,160,122,0.6) 20%,
    rgba(205,184,150,0.9) 50%,
    rgba(184,160,122,0.6) 80%,
    transparent 100%
  );
}

.pdf-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(205,184,150,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  letter-spacing: 0.01em;
}

.pdf-modal-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── ZOOM BUTTON GROUP ────────────────────────── */
.pdf-zoom-group {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  gap: 0;
}

.pdf-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  background: transparent;
  border: none;
  color: rgba(205,184,150,0.8);
  font-size: 1rem;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.pdf-ctrl-btn:hover:not(:disabled) {
  background: rgba(184,160,122,0.15);
  color: #fff;
}
.pdf-ctrl-btn:active:not(:disabled) {
  background: rgba(184,160,122,0.25);
}
.pdf-ctrl-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.pdf-zoom-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.pdf-zoom-label {
  font-family: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
}

/* ── CLOSE BUTTON ─────────────────────────────── */
.pdf-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
.pdf-close-btn:hover {
  background: rgba(220, 60, 60, 0.18);
  border-color: rgba(220, 60, 60, 0.35);
  color: #ff8080;
  transform: scale(1.05);
}
.pdf-close-btn:active {
  transform: scale(0.95);
}

/* ── SCROLLABLE BODY ──────────────────────────── */
.pdf-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  /* Deep dark canvas for pages to float on */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184,160,122,0.04) 0%, transparent 60%),
    #0d141f;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;
  gap: 16px;
}

/* Refined scrollbars */
.pdf-modal-body::-webkit-scrollbar { width: 5px; height: 5px; }
.pdf-modal-body::-webkit-scrollbar-track { background: transparent; }
.pdf-modal-body::-webkit-scrollbar-thumb {
  background: rgba(184,160,122,0.25);
  border-radius: 10px;
}
.pdf-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(184,160,122,0.55);
}

/* Page wrappers — floating card style */
.pdf-page-wrapper {
  background: white;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    0 12px 40px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.06);
  transition: box-shadow 0.3s;
}
.pdf-page-wrapper:hover {
  box-shadow:
    0 4px 16px rgba(0,0,0,0.35),
    0 20px 60px rgba(0,0,0,0.55),
    0 0 0 1px rgba(184,160,122,0.12);
}
.pdf-page-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* Page separator label between pages */
.pdf-page-separator {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(184,160,122,0.3);
  user-select: none;
}

/* Loading & error states */
.pdf-loading {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.35);
  padding: 64px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Animated loading spinner */
.pdf-loading::before {
  content: '';
  width: 28px;
  height: 28px;
  border: 2px solid rgba(184,160,122,0.15);
  border-top-color: rgba(184,160,122,0.7);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.pdf-error {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  color: rgba(240,128,128,0.85);
  padding: 48px 32px;
  text-align: center;
  line-height: 1.7;
}

/* ── FOOTER ───────────────────────────────────── */
.pdf-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  height: 48px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.pdf-page-info {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.25);
  min-width: 90px;
  text-align: center;
  letter-spacing: 0.04em;
  user-select: none;
}

/* Pill-style nav buttons */
.pdf-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  color: rgba(205,184,150,0.7);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.pdf-nav-btn:hover:not(:disabled) {
  background: rgba(184,160,122,0.1);
  border-color: rgba(184,160,122,0.25);
  color: rgba(205,184,150,1);
  transform: translateY(-1px);
}
.pdf-nav-btn:active:not(:disabled) {
  transform: translateY(0);
}
.pdf-nav-btn:disabled {
  opacity: 0.18;
  cursor: not-allowed;
}

/* ── TRIGGER BUTTON ON CARDS / ROWS ───────────── */
.view-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(28, 45, 69, 0.75);
  background: transparent;
  border: 1px solid rgba(184, 160, 122, 0.5);
  border-radius: 20px;
  padding: 7px 18px 7px 14px;
  cursor: pointer;
  transition: all 0.44s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.view-doc-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #1C2D45;
  transform: translateX(-102%);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  border-radius: 20px;
}
.view-doc-btn:hover::before {
  transform: translateX(0);
}
.view-doc-btn:hover {
  color: #CDB896;
  border-color: #1C2D45;
}
.view-doc-btn svg,
.view-doc-btn span {
  position: relative;
  z-index: 1;
}

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  .pdf-modal-overlay { padding: 12px; }
  .pdf-modal        { width: 100%; height: 96vh; border-radius: 8px; }
  .pdf-modal-header { height: 52px; padding: 0 14px; }
  .pdf-modal-title  { font-size: 0.82rem; }
  .pdf-modal-body   { padding: 14px 10px; gap: 10px; }
  .pdf-modal-footer { height: 46px; gap: 12px; }
  .pdf-nav-btn      { padding: 5px 14px; font-size: 0.72rem; }
  .pdf-zoom-label   { min-width: 36px; font-size: 0.72rem; }
  .pdf-ctrl-btn     { width: 30px; height: 30px; }
  .pdf-close-btn    { width: 30px; height: 30px; }
}

@media (max-width: 480px) {
  .pdf-modal-overlay { padding: 6px; }
  .pdf-modal        { height: 98vh; border-radius: 6px; }
  .pdf-modal-header { height: 48px; gap: 8px; padding: 0 12px; }
  .pdf-modal-title  { font-size: 0.75rem; }
  .pdf-modal-body   { padding: 10px 8px; }
  .pdf-modal-footer { height: 42px; gap: 8px; }
  .pdf-nav-btn      { padding: 4px 10px; font-size: 0.68rem; border-radius: 14px; }
  .pdf-page-info    { font-size: 0.68rem; min-width: 60px; }
  .pdf-ctrl-btn     { width: 28px; height: 28px; font-size: 0.9rem; }
  .pdf-close-btn    { width: 28px; height: 28px; margin-left: 4px; }
  .pdf-zoom-label   { min-width: 32px; font-size: 0.68rem; }
}

/* Landscape phone — maximize viewport use */
@media (max-height: 500px) and (orientation: landscape) {
  .pdf-modal        { height: 98vh; width: min(700px, 96vw); }
  .pdf-modal-body   { padding: 10px; }
}
