/**
 * 부안임씨 전서공파 대종회 - 대용량 스트리밍 PDF 고문서 뷰어 스타일
 */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pdf-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* 뷰어 상단 헤더 */
.pdf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.4rem;
  background: #1e293b;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pdf-modal__title-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

.pdf-modal__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-modal__badge {
  font-size: 0.75rem;
  background: #0284c7;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}

.pdf-modal__size {
  font-size: 0.8rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.pdf-modal__close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s ease;
}

.pdf-modal__close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 뷰어 제어 툴바 */
.pdf-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: #0f172a;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.8rem;
  flex-shrink: 0;
}

.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-tool-btn {
  background: #334155;
  border: 1px solid #475569;
  color: #f1f5f9;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.pdf-tool-btn:hover:not(:disabled) {
  background: #475569;
  border-color: #64748b;
  color: #fff;
}

.pdf-tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-page-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.pdf-page-input {
  width: 48px;
  text-align: center;
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  border-radius: 4px;
  padding: 0.25rem 0.2rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.pdf-scale-select {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* 뷰어 메인 뷰포트 */
.pdf-modal__body {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
  position: relative;
  background: #090d16;
}

.pdf-canvas-container {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #fff;
  position: relative;
  margin: auto;
  line-height: 0;
}

.pdf-canvas-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 뷰어 로딩 오버레이 */
.pdf-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: #fff;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.pdf-loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.pdf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: pdfSpin 0.8s linear infinite;
}

@keyframes pdfSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .pdf-modal__toolbar {
    padding: 0.5rem;
    gap: 0.4rem;
    justify-content: center;
  }
  .pdf-modal__body {
    padding: 0.5rem;
  }
  .pdf-tool-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
}
