/* ==========================================================================
   DEVPEGS - Full-Page Reading Book & Crash Course Modal Styles
   ========================================================================== */

/* Fullscreen Book Modal Overlay */
.reading-book-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  padding: 1.5rem;
}

.reading-book-modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* Book Shell Container */
.reading-book-shell {
  width: 100%;
  max-width: 1280px;
  height: 92vh;
  display: grid;
  grid-template-columns: 310px 1fr;
  background: #fbf9f4;
  color: #1e293b;
  border: 1px solid rgba(120, 113, 108, 0.35);
  border-radius: 18px;
  box-shadow: 
    0 25px 65px -10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

[data-paper-theme="blueprint"] .reading-book-shell {
  background: #0d1424;
  color: #f1f5f9;
  border-color: rgba(14, 165, 233, 0.35);
}

/* --------------------------------------------------------------------------
   Book Left Navigation Drawer / Table of Contents
   -------------------------------------------------------------------------- */
.book-toc-sidebar {
  background: #efe9dc;
  border-right: 1px solid rgba(120, 113, 108, 0.25);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  overflow-y: auto;
  position: relative;
}

[data-paper-theme="blueprint"] .book-toc-sidebar {
  background: #080d1a;
  border-right-color: rgba(255, 255, 255, 0.1);
}

.book-header-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
  margin-bottom: 0.5rem;
}

.book-title-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

[data-paper-theme="blueprint"] .book-title-heading {
  color: #ffffff;
}

.toc-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.toc-chapter-item {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

[data-paper-theme="blueprint"] .toc-chapter-item {
  background: rgba(255, 255, 255, 0.04);
}

.toc-chapter-item:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(3px);
}

[data-paper-theme="blueprint"] .toc-chapter-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.toc-chapter-item.active {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  position: relative;
}

[data-paper-theme="blueprint"] .toc-chapter-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
}

.toc-chapter-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: #6366f1;
  border-radius: 0 4px 4px 0;
}

.toc-chap-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6366f1;
}

.toc-chap-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

[data-paper-theme="blueprint"] .toc-chap-title {
  color: #e2e8f0;
}

.toc-chap-meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   Book Reading Canvas (Center Page)
   -------------------------------------------------------------------------- */
.book-reading-viewport {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fdfbf7;
  position: relative;
}

[data-paper-theme="blueprint"] .book-reading-viewport {
  background: #0d1424;
}

/* Top Sticky Control Bar */
.book-top-bar {
  padding: 0.85rem 2rem;
  background: rgba(251, 249, 244, 0.95);
  border-bottom: 1px solid rgba(120, 113, 108, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: blur(6px);
  z-index: 10;
}

[data-paper-theme="blueprint"] .book-top-bar {
  background: rgba(13, 20, 36, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.book-progress-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-close-btn {
  background: #e2d9c5;
  border: 1px solid rgba(120, 113, 108, 0.3);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

[data-paper-theme="blueprint"] .book-close-btn {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

.book-close-btn:hover {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

/* Scrollable Reading Content */
.book-reading-content {
  flex: 1;
  overflow-y: auto;
  padding: 3rem 4rem 5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* 60-Second Exam Blitz Callout Banner */
.blitz-exam-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}

.blitz-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: #f59e0b;
  color: #000;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.blitz-points-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Chapter Heading */
.chap-reading-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

[data-paper-theme="blueprint"] .chap-reading-title {
  color: #ffffff;
}

.chap-reading-subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Inbuilt Interactive Simulator Container inside Chapter */
.embedded-simulator-section {
  background: #f1ebd9;
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  padding: 1.75rem;
  margin: 2.5rem 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

[data-paper-theme="blueprint"] .embedded-simulator-section {
  background: #090e1a;
  border-color: rgba(14, 165, 233, 0.4);
}

.sim-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(120, 113, 108, 0.2);
  padding-bottom: 0.75rem;
}

.sim-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #6366f1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Interview Q&A Accordion in Chapter */
.interview-qa-box {
  background: rgba(99, 102, 241, 0.06);
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.qa-question {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.6rem;
}

[data-paper-theme="blueprint"] .qa-question {
  color: #f8fafc;
}

.qa-answer {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #475569;
}

[data-paper-theme="blueprint"] .qa-answer {
  color: #cbd5e1;
}

/* Bottom Chapter Turn Pager */
.book-chapter-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(120, 113, 108, 0.25);
}

.pager-btn {
  background: #efe9dc;
  border: 1px solid rgba(120, 113, 108, 0.3);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

[data-paper-theme="blueprint"] .pager-btn {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}

.pager-btn:hover {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

@media (max-width: 900px) {
  .reading-book-shell {
    grid-template-columns: 1fr;
    height: 96vh;
  }
  .book-toc-sidebar {
    display: none;
  }
  .book-reading-content {
    padding: 1.5rem 1.25rem;
  }
}
