/* ── Overlay ─────────────────────────────────────────────────────── */
#pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ── Modal box ───────────────────────────────────────────────────── */
#pdf-modal {
  position: relative;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: min(90vw, 860px);
  height: min(90vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  animation: slideUp 0.35s ease forwards;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────────────────── */
#pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #1a1a2e;
  color: #fff;
  flex-shrink: 0;
}

#pdf-modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#pdf-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

#pdf-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Tabs ────────────────────────────────────────────────────────── */
#pdf-modal-tabs {
  display: flex;
  background: #f0f0f5;
  border-bottom: 2px solid #ddd;
  flex-shrink: 0;
}

.pdf-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.pdf-tab-btn:hover {
  background: #e2e2ea;
  color: #222;
}

.pdf-tab-btn.active {
  color: #1a1a2e;
  border-bottom-color: #1a1a2e;
  background: #fff;
  font-weight: 700;
}

/* ── Image viewer area ───────────────────────────────────────────── */
#pdf-modal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.pdf-panel {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  background: #e8e8e8;
}

.pdf-panel.active {
  display: block;
}

.pdf-panel img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* ── Footer nav ──────────────────────────────────────────────────── */
#pdf-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #f8f8fb;
  border-top: 1px solid #e0e0e8;
  flex-shrink: 0;
  font-family: system-ui, sans-serif;
}

#pdf-modal-footer span {
  font-size: 0.85rem;
  color: #666;
}

.pdf-nav-btn {
  padding: 7px 18px;
  border: 1.5px solid #1a1a2e;
  border-radius: 6px;
  background: transparent;
  color: #1a1a2e;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: system-ui, sans-serif;
}

.pdf-nav-btn:hover:not(:disabled) {
  background: #1a1a2e;
  color: #fff;
}

.pdf-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
