/* 
 * Custom Styling & Print-Ready Academic Stylesheet
 * Aplikasi Penilaian Filsafat Pendidikan Islam Berbasis AI
 */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-emerald: #047857;
  --primary-dark: #064e3b;
  --accent-gold: #f59e0b;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Amiri', Georgia, serif;
}

body {
  font-family: var(--font-sans);
  background-color: #f8fafc;
  color: #0f172a;
}

.font-serif {
  font-family: var(--font-serif);
}

/* Islamic Geometric Background Pattern Overlay */
.islamic-pattern {
  background-image: radial-gradient(#10b981 0.75px, transparent 0.75px), radial-gradient(#059669 0.75px, #f8fafc 0.75px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  opacity: 0.04;
}

/* Tab Navigation Styling */
.exam-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.exam-tab-btn.active-tab {
  background-color: #047857;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.25);
}

.exam-tab-btn.inactive-tab {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.exam-tab-btn.inactive-tab:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.tab-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.2);
}

.inactive-tab .tab-badge {
  background-color: #cbd5e1;
  color: #334155;
}

/* Lecturer Tab Navigation */
.lecturer-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.lecturer-tab-btn.active-lecturer-tab {
  background-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.28);
}

.lecturer-tab-btn.inactive-lecturer-tab {
  background-color: #f1f5f9;
  color: #475569;
}

.lecturer-tab-btn.inactive-lecturer-tab:hover {
  background-color: #e2e8f0;
  color: #1e1b4b;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  background-color: #065f46;
  color: #ffffff;
  border: 1px solid #10b981;
}

.toast-error {
  background-color: #991b1b;
  color: #ffffff;
  border: 1px solid #f87171;
}

.toast-warning {
  background-color: #92400e;
  color: #ffffff;
  border: 1px solid #fbbf24;
}

/* Smooth Transitions */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* =======================================================
   PRINT SPECIFIC STYLES (ACADEMIC OFFICIAL REPORT FORMAT)
   ======================================================= */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide all interactive UI headers, navbars, modals background, and buttons */
  header, 
  nav, 
  footer, 
  #toast-container,
  .no-print,
  button,
  .exam-tab-btn,
  .lecturer-tab-btn {
    display: none !important;
  }

  /* Force print container to fill page */
  .fixed.inset-0 {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  #printable-report-card,
  .print-container {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  table {
    page-break-inside: auto !important;
  }

  tr {
    page-break-inside: avoid !important;
    page-break-after: auto !important;
  }

  thead {
    display: table-header-group !important;
  }

  /* Ensure text colors are sharp for black/white or color print */
  .bg-slate-100 {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .border-slate-800 {
    border-color: #000000 !important;
  }
}

/* =======================================================
   3D BOOK COVER & REALISTIC PAPER-OPENING ANIMATION
   ======================================================= */
.book-3d-wrapper {
  perspective: 1200px;
}

.book-3d-cover {
  transform: rotateY(-10deg) rotateX(4deg);
  box-shadow: 
    -10px 10px 25px rgba(0, 0, 0, 0.4),
    -2px 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-3d-wrapper:hover .book-3d-cover {
  transform: rotateY(0deg) rotateX(0deg) scale(1.03);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
}

/* 3D Realistic Book Stage for Cuplikan */
.book-opening-stage {
  perspective: 2000px;
  perspective-origin: center center;
}

.book-spread-container {
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.book-paper-sheet {
  background-color: #fdfbf7;
  background-image: 
    radial-gradient(circle at 100% 50%, rgba(0,0,0,0.03) 0%, transparent 70%),
    linear-gradient(to right, #f4eee1 0%, #fdfbf7 5%, #fdfbf7 95%, #f4eee1 100%);
  box-shadow: 
    inset 0 0 30px rgba(180, 160, 130, 0.15),
    0 20px 50px -10px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.book-spine-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  z-index: 15;
}

.book-spine-shadow-left {
  right: 0;
  background: linear-gradient(to right, transparent, rgba(60, 40, 20, 0.12) 80%, rgba(40, 25, 10, 0.22) 100%);
}

.book-spine-shadow-right {
  left: 0;
  background: linear-gradient(to left, transparent, rgba(60, 40, 20, 0.12) 80%, rgba(40, 25, 10, 0.22) 100%);
}

/* Page Open Keyframe Animation */
@keyframes bookCoverOpen {
  0% {
    transform: rotateY(0deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  }
  30% {
    transform: rotateY(-40deg) rotateX(2deg);
    box-shadow: -15px 20px 40px rgba(0, 0, 0, 0.4);
  }
  70% {
    transform: rotateY(-130deg) rotateX(1deg);
    box-shadow: -25px 25px 50px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: rotateY(-180deg);
    box-shadow: -5px 10px 25px rgba(0, 0, 0, 0.2);
  }
}

.book-cover-flap {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 1.2s ease;
  backface-visibility: hidden;
}

.book-cover-flap.is-open {
  transform: rotateY(-180deg);
}

.book-cover-flap.is-closed {
  transform: rotateY(0deg);
}

/* Drop Cap styling for Islamic Academic Texts */
.academic-dropcap::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 3.2rem;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  padding-bottom: 2px;
  color: #064e3b;
  font-weight: 700;
  text-shadow: 1px 1px 0px rgba(245, 158, 11, 0.4);
}

/* Paper Deckle / Edge effect */
.paper-edge {
  border-right: 4px solid #e7dfd3;
  box-shadow: 
    1px 0 0 #d8cebe,
    2px 0 0 #eae3d7,
    3px 0 0 #cfc4b2,
    4px 0 0 #f0eae0;
}

/* E-Reader Themes */
.reader-body.light {
  background-color: #ffffff;
  color: #1e293b;
}

.reader-body.sepia {
  background-color: #fbf0d9;
  color: #433422;
}

.reader-body.dark {
  background-color: #0f172a;
  color: #e2e8f0;
}
.reader-body.dark h1,
.reader-body.dark h2,
.reader-body.dark h3,
.reader-body.dark strong {
  color: #f8fafc;
}

/* ==================== RUNNING TEXT MARQUEE ANIMATION ==================== */
@keyframes marquee-scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.animate-marquee {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 28s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

.ticker-wrapper {
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

/* ==================== TOKEN VOUCHER CARD STYLING ==================== */
.token-card-box {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 45%, #0f172a 100%);
  border: 2px solid #f59e0b;
  position: relative;
  overflow: hidden;
}

.token-card-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(#fbbf24 0.6px, transparent 0.6px);
  background-size: 16px 16px;
  opacity: 0.12;
  pointer-events: none;
}

@media print {
  .no-print {
    display: none !important;
  }
  .print-page-break {
    page-break-after: always;
  }
}

/* =======================================================
   FLIPHTML5 3D FLIPBOOK & INTERACTIVE LINE ANNOTATOR (DOSEN)
   ======================================================= */
.fliphtml5-stage {
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 70%, #020617 100%);
  position: relative;
  overflow: hidden;
}

.fliphtml5-stage::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  pointer-events: none;
}

.flipbook-desk-shadow {
  box-shadow: 
    0 35px 70px -15px rgba(0, 0, 0, 0.7),
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.flipbook-paper-page {
  background-color: #fbf8f0;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0.015) 0%, transparent 80%),
    linear-gradient(to right, #f4eee2 0%, #fdfbf7 4%, #fdfbf7 96%, #ede4d4 100%);
  color: #1e293b;
  position: relative;
  user-select: text;
}

.flipbook-page-left {
  box-shadow: inset -20px 0 30px -12px rgba(60, 40, 20, 0.18);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.flipbook-page-right {
  box-shadow: inset 20px 0 30px -12px rgba(60, 40, 20, 0.18);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* 3D Realistic Spine Gutter */
.flipbook-spine-gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 32px;
  transform: translateX(-50%);
  background: linear-gradient(to right, 
    rgba(40, 25, 10, 0.28) 0%, 
    rgba(0, 0, 0, 0.5) 46%, 
    rgba(0, 0, 0, 0.5) 54%, 
    rgba(40, 25, 10, 0.28) 100%
  );
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.5),
    inset 0 0 8px rgba(0, 0, 0, 0.8);
  z-index: 25;
  pointer-events: none;
}

/* Page Corner Curl with Shadow */
.page-curl-corner-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, transparent 50%, #e2d7c5 50%, #f8f4ec 100%);
  box-shadow: -3px -3px 8px rgba(0, 0, 0, 0.2);
  border-top-left-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.page-curl-corner-right:hover {
  width: 52px;
  height: 52px;
  box-shadow: -5px -5px 14px rgba(0, 0, 0, 0.3);
}

.page-curl-corner-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 44px;
  height: 44px;
  background: linear-gradient(225deg, transparent 50%, #e2d7c5 50%, #f8f4ec 100%);
  box-shadow: 3px -3px 8px rgba(0, 0, 0, 0.2);
  border-top-right-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.page-curl-corner-left:hover {
  width: 52px;
  height: 52px;
  box-shadow: 5px -5px 14px rgba(0, 0, 0, 0.3);
}

/* Interactive Line / Paragraph Highlighter Styles */
.book-line-hoverable {
  position: relative;
  border-radius: 0.375rem;
  padding: 0.2rem 0.4rem;
  margin: -0.2rem -0.4rem;
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.book-line-hoverable:hover {
  background-color: rgba(245, 158, 11, 0.12);
  outline: 1px dashed rgba(217, 119, 6, 0.4);
}

/* Stabilo Highlighter Variants */
.annotated-hl-yellow {
  background: linear-gradient(104deg, rgba(254, 240, 138, 0.88) 0%, rgba(253, 224, 71, 0.8) 100%);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-bottom: 2px solid #eab308;
  color: #0f172a;
  font-weight: 600;
}

.annotated-hl-green {
  background: linear-gradient(104deg, rgba(187, 247, 208, 0.88) 0%, rgba(134, 239, 172, 0.8) 100%);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-bottom: 2px solid #22c55e;
  color: #064e3b;
  font-weight: 600;
}

.annotated-hl-pink {
  background: linear-gradient(104deg, rgba(254, 205, 211, 0.88) 0%, rgba(253, 164, 175, 0.8) 100%);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-bottom: 2px solid #f43f5e;
  color: #881337;
  font-weight: 600;
}

.annotated-hl-blue {
  background: linear-gradient(104deg, rgba(186, 230, 253, 0.88) 0%, rgba(125, 211, 252, 0.8) 100%);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  border-bottom: 2px solid #0ea5e9;
  color: #0c4a6e;
  font-weight: 600;
}

.annotated-strike {
  text-decoration: line-through 2px #ef4444;
  background-color: rgba(254, 226, 226, 0.7);
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  color: #991b1b;
  font-weight: 500;
}

/* Floating Editorial Comment Pin on the Line */
.editorial-comment-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: #4338ca;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  vertical-align: middle;
  margin-left: 0.35rem;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.editorial-comment-pin:hover {
  transform: scale(1.1);
  background-color: #3730a3;
}

/* FlipHTML5 Glassmorphic Control Dock */
.fliphtml5-dock-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flip-tool-btn {
  padding: 0.45rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.flip-tool-btn.active-tool {
  background: #4338ca;
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}
.flip-tool-btn:not(.active-tool) {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.1);
}
.flip-tool-btn:not(.active-tool):hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* ==================== 3D REALISTIC DYNAMIC FLIPBOOK STYLES ==================== */

.flipbook-stage-3d {
  perspective: 2500px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

.flipbook-desk-spread {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Dynamic Page Turning Animations */
.page-flip-animating-forward {
  animation: dynamicPageFlipForward 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.page-flip-animating-backward {
  animation: dynamicPageFlipBackward 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes dynamicPageFlipForward {
  0% {
    transform: perspective(2200px) rotateY(0deg) scale(1);
    filter: brightness(1);
  }
  40% {
    transform: perspective(2200px) rotateY(-12deg) rotateZ(-0.5deg) scale(0.985);
    filter: brightness(0.92);
    box-shadow: 0 40px 80px -10px rgba(0, 0, 0, 0.8), -30px 15px 45px rgba(0, 0, 0, 0.5);
  }
  100% {
    transform: perspective(2200px) rotateY(0deg) scale(1);
    filter: brightness(1);
  }
}

@keyframes dynamicPageFlipBackward {
  0% {
    transform: perspective(2200px) rotateY(0deg) scale(1);
    filter: brightness(1);
  }
  40% {
    transform: perspective(2200px) rotateY(12deg) rotateZ(0.5deg) scale(0.985);
    filter: brightness(0.92);
    box-shadow: 0 40px 80px -10px rgba(0, 0, 0, 0.8), 30px 15px 45px rgba(0, 0, 0, 0.5);
  }
  100% {
    transform: perspective(2200px) rotateY(0deg) scale(1);
    filter: brightness(1);
  }
}

/* 3D Dynamic Turning Leaf Overlay */
.turning-page-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 40;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}

.turning-page-leaf-right {
  right: 0;
  transform-origin: left center;
  animation: leafTurnRightToLeft 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  background: linear-gradient(to right, #e8dfcc 0%, #fdfbf7 10%, #f8f4eb 100%);
}

.turning-page-leaf-left {
  left: 0;
  transform-origin: right center;
  animation: leafTurnLeftToRight 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  background: linear-gradient(to left, #e8dfcc 0%, #fdfbf7 10%, #f8f4eb 100%);
}

@keyframes leafTurnRightToLeft {
  0% {
    transform: rotateY(0deg);
    opacity: 0.95;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: rotateY(-90deg) scale(1.02);
    opacity: 1;
    box-shadow: -30px 0 60px rgba(0, 0, 0, 0.6);
  }
  100% {
    transform: rotateY(-180deg);
    opacity: 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  }
}

@keyframes leafTurnLeftToRight {
  0% {
    transform: rotateY(0deg);
    opacity: 0.95;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: rotateY(90deg) scale(1.02);
    opacity: 1;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.6);
  }
  100% {
    transform: rotateY(180deg);
    opacity: 0;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
  }
}

/* Realistic Book Paper Stack Effect on Sides */
.flipbook-page-stack-left {
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 8px;
  background: repeating-linear-gradient(
    to bottom,
    #d1c7b7,
    #d1c7b7 2px,
    #ede5d8 2px,
    #ede5d8 4px
  );
  border-radius: 4px 0 0 4px;
  box-shadow: -4px 4px 10px rgba(0, 0, 0, 0.4);
}

.flipbook-page-stack-right {
  position: absolute;
  right: -8px;
  top: 6px;
  bottom: 6px;
  width: 8px;
  background: repeating-linear-gradient(
    to bottom,
    #d1c7b7,
    #d1c7b7 2px,
    #ede5d8 2px,
    #ede5d8 4px
  );
  border-radius: 0 4px 4px 0;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
}

/* Bookmark Ribbon */
.flipbook-ribbon {
  position: absolute;
  top: -12px;
  right: 60px;
  width: 24px;
  height: 90px;
  background: linear-gradient(180deg, #b91c1c 0%, #dc2626 70%, #991b1b 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  z-index: 35;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 80%, 0% 100%);
  transition: all 0.3s ease;
  cursor: pointer;
}
.flipbook-ribbon:hover {
  height: 105px;
  filter: brightness(1.15);
}

/* Academic Rich Formatting inside Book Pages */
.book-academic-quote {
  border-left: 3px solid #b45309;
  background: rgba(254, 243, 199, 0.4);
  padding: 0.6rem 0.85rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 0.5rem 0;
  font-style: italic;
}

.book-table-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin: 0.5rem 0;
  background: #ffffff;
  border: 1px solid #d6cebf;
  border-radius: 0.5rem;
  overflow: hidden;
}
.book-table-matrix th {
  background: #292524;
  color: #fef08a;
  padding: 0.4rem 0.5rem;
  font-family: serif;
  text-align: left;
}
.book-table-matrix td {
  padding: 0.35rem 0.5rem;
  border-top: 1px solid #e7e0d3;
  color: #1c1917;
}

.book-dialogue-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
}





