@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Cinzel+Decorative:wght@700&family=Cinzel:wght@500;600;700&family=Dancing+Script:wght@500;700&family=Dongle:wght@400;700&family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Gamja+Flower&family=Gowun+Batang:wght@400;700&family=Great+Vibes&family=Hi+Melody&family=Nanum+Brush+Script&family=Nanum+Myeongjo:wght@400;700;800&family=Nanum+Pen+Script&family=Parisienne&family=Playfair+Display:ital,wght@0,500;0,700;1,400&family=Pretendard:wght@300;400;500;600;700&family=Song+Myung&family=Yeon+Sung&display=swap');

:root {
  /* 성스러운 대성당 & 순백의 제대 필사노트 테마 시스템 */
  --bg-deep: #090d16;
  --bg-sacred-overlay: rgba(9, 13, 22, 0.78);
  
  --card-glass: rgba(15, 23, 42, 0.82);
  --card-glass-subtle: rgba(30, 41, 59, 0.75);
  --card-border: rgba(217, 119, 6, 0.28);
  --card-border-subtle: rgba(255, 255, 255, 0.08);
  
  --gold-primary: #d97706;
  --gold-glow: #f59e0b;
  --gold-light: #fef3c7;
  --gold-pale: #fffbeb;
  --gold-dark: #92400e;
  --gold-border: rgba(217, 119, 6, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* 제대 위 순백색 양장본 필사 종이 (Pure White Manuscript Paper) */
  --notebook-paper: #ffffff;
  --notebook-border: rgba(217, 119, 6, 0.35);
  --ink-black: #0f172a;
  --ink-body: #1e293b;
  --ink-guide: #94a3b8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --font-latin: 'Playfair Display', 'Cinzel', serif;
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-serif);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ========================================================
   0. 거룩한 대성당 배경 시스템 (Cathedral Sacred Ambience)
   ======================================================== */
.cathedral-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../bg-sacred.png') no-repeat center center fixed;
  background-size: cover;
  z-index: -2;
  filter: brightness(0.68) contrast(1.12);
  transform: scale(1.02);
  pointer-events: none;
}

.cathedral-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.45) 0%, rgba(9, 13, 22, 0.90) 100%);
  z-index: -1;
  pointer-events: none;
}

/* ========================================================
   1. 상단 글로벌 신앙 생태계 배너
   ======================================================== */
.sacred-banner {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 119, 6, 0.22);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--gold-light);
  z-index: 60;
  position: relative;
}

.sacred-banner .banner-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sacred-banner a {
  color: #fef08a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.2s;
}

.sacred-banner a:hover {
  color: #ffffff;
}

/* ========================================================
   2. 메인 헤더 (다크 글래스모피즘 바)
   ======================================================== */
.bible-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.header-brand .icon-cross {
  color: var(--gold-glow);
  font-size: 24px;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

.header-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-title span {
  font-size: 11px;
  font-family: var(--font-sans);
  background: rgba(217, 119, 6, 0.25);
  color: #fef08a;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.4);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-sans);
}

.lang-selector {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.lang-selector:focus {
  border-color: var(--gold-glow);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

/* ========================================================
   3. 메인 작업 레이아웃
   ======================================================== */
.bible-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 20px auto;
  padding: 0 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 10;
}

/* ========================================================
   4. 컨트롤 카드 (다크 글래스모피즘 성경 제어기)
   ======================================================== */
.control-card {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.55), 0 0 25px rgba(217, 119, 6, 0.08);
}

/* 6대 분류 탭 */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-sans);
}

.category-btn {
  padding: 7px 15px;
  font-size: 12px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.category-btn.active {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.45) 0%, rgba(180, 83, 9, 0.35) 100%);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fef08a;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.25);
}

/* 셀렉터 그리드 */
.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  font-family: var(--font-sans);
}

.select-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.select-group label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.select-control {
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.select-control:focus {
  border-color: var(--gold-glow);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

/* 챕터 네비게이션 버튼 */
.chapter-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-nav-step {
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-sm);
  color: #fef08a;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.btn-nav-step:hover:not(:disabled) {
  background: rgba(217, 119, 6, 0.3);
  border-color: var(--gold-glow);
  color: #ffffff;
}

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

/* 필사 모드 토글 */
.mode-toggle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 23, 42, 0.8);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.mode-btn {
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #ffffff;
}

.mode-btn.active {
  background: #b45309;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.4);
}

/* ========================================================
   툴바 행 및 아이템 (서체, 만년필 잉크, 펜 굵기, 농도 가로 정렬)
   ======================================================== */
.toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-top: 16px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-sans);
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-item > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 잉크 팔레트 (원형 잉크 버튼 5종) */
.ink-palette {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ink-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  display: inline-block;
  vertical-align: middle;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s;
}

.ink-color-btn:hover {
  transform: scale(1.25);
}

.ink-color-btn.active {
  box-shadow: 0 0 0 2px var(--gold-glow), 0 0 12px rgba(245, 158, 11, 0.8);
  transform: scale(1.18);
}

/* 성경 낭독 오디오 위젯 */
.audio-widget {
  display: flex;
  align-items: center;
}

.btn-audio {
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid var(--gold-border);
  color: #fef08a;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-audio:hover {
  background: rgba(217, 119, 6, 0.35);
  color: #ffffff;
}

/* ========================================================
   5. 제대 위 순백의 성경 필사노트 (The Illuminated Manuscript Paper)
   대성당의 장엄한 분위기 속에 펼쳐진 순백색 종이 패드
   ======================================================== */
.practice-stage {
  background: #ffffff !important;
  border: 1px solid var(--notebook-border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(217, 119, 6, 0.18);
  color: var(--ink-black);
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-black);
}

.stage-badge {
  font-size: 11px;
  color: var(--gold-dark);
  font-family: var(--font-sans);
  font-weight: 600;
  background: var(--gold-light);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

/* 캔버스 및 타이핑 래퍼 (기본: 손글씨 드로잉 레이어) */
.canvas-wrapper {
  position: relative;
  width: 100%;
  min-height: 500px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.03);
}

/* 따라쓰기용 가이드 텍스트 (흐린 글씨 레이어) */
.transcription-guide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 28px 32px;
  color: var(--ink-guide);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 2.5;
  font-size: 22px;
  user-select: none;
  pointer-events: none;
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0;
  border: none;
}

.drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* 키보드 타이핑 입력창 (흐린 글씨 바로 위에 투명하게 겹쳐서 따라치기) */
.typing-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 28px 32px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 2.5;
  font-size: 22px;
  font-family: inherit;
  letter-spacing: inherit;
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0;
  caret-color: #d97706;
}

/* 필사 액션 툴바 (지우기, 입력모드 전환) */
.stage-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #475569;
}

#tipContainer {
  background: #fffbeb;
  border-left: 3px solid #d97706;
  padding: 8px 14px;
  border-radius: 4px;
  color: #92400e;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-action:hover {
  background: var(--gold-light);
  border-color: var(--gold-border);
  color: var(--gold-dark);
}

/* ========================================================
   6. 렉시오 디비나 묵상 가이드 및 신앙 섹션 (다크 글래스모피즘)
   ======================================================== */
.meditation-guide {
  background: var(--card-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.guide-card {
  background: var(--card-glass-subtle);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fef08a;
}

.guide-card p {
  line-height: 1.65;
  color: var(--text-secondary);
}

/* FAQ 아코디언 */
.faq-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-item summary {
  font-weight: 600;
  color: #f8fafc;
  outline: none;
}

.faq-item p {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 사전 성령 기도 박스 */
.pre-prayer-box {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.btn-prayer-link {
  background: #b45309;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-prayer-link:hover {
  background: #d97706;
}

.btn-pax-link {
  background: rgba(15, 23, 42, 0.6);
  color: #fef08a;
  border: 1px solid rgba(217, 119, 6, 0.4);
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-pax-link:hover {
  background: rgba(217, 119, 6, 0.2);
  color: #ffffff;
}

/* ========================================================
   7. 모달 창 (전세계 1,200+ 성경 검색)
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trans-item-btn {
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: all 0.2s;
}

.trans-item-btn:hover {
  background: var(--gold-light);
  border-color: var(--gold-border);
  color: var(--gold-dark);
}

/* ========================================================
   8. 푸터 (대성당 일체형 다크 글래스모피즘)
   ======================================================== */
.bible-footer {
  background: rgba(9, 13, 22, 0.95);
  border-top: 1px solid rgba(217, 119, 6, 0.25);
  padding: 44px 20px;
  text-align: center;
  font-family: var(--font-sans);
  position: relative;
  z-index: 20;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.bible-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.bible-footer a:hover {
  color: var(--gold-glow);
}

/* ========================================================
   9. A4 인쇄 / PDF 저장 스타일 (완전한 순백색 깨끗한 필사노트)
   인쇄 시에는 대성당 배경과 모든 컨트롤 UI가 숨겨지고
   순수 백색 A4 용지에 흐린 가이드 말씀만 완벽하게 출력됩니다.
   ======================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 15mm 15mm 15mm;
  }
  
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }
  
  /* 인쇄 시 불필요한 모든 요소 완벽 은닉 */
  .cathedral-bg,
  .cathedral-overlay,
  .sacred-banner, 
  .bible-header, 
  .control-card, 
  .stage-actions, 
  .meditation-guide, 
  .btn-action, 
  .drawing-canvas, 
  .typing-input, 
  .modal-overlay, 
  .bible-footer,
  #btnPrintPdf {
    display: none !important;
  }
  
  .bible-main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .practice-stage {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: auto !important;
    background: #ffffff !important;
  }
  
  .stage-header {
    border-bottom: 2px solid #333333 !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
  }
  
  .stage-title {
    font-size: 18pt !important;
    color: #000000 !important;
  }
  
  .stage-badge {
    border: 1px solid #666666 !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-size: 10pt !important;
  }
  
  .canvas-wrapper {
    border: none !important;
    box-shadow: none !important;
    min-height: auto !important;
    background: #ffffff !important;
  }
  
  /* 인쇄 시 글씨를 흐리게 출력하여 따라 쓰거나 그 아래에 쓸 수 있도록 유도 */
  .transcription-guide {
    position: static !important;
    color: #718096 !important;
    font-size: 16pt !important;
    line-height: 2.8 !important;
    padding: 0 !important;
    white-space: pre-wrap !important;
    opacity: 0.8 !important;
    page-break-inside: auto !important;
  }
}
