/* Kembara Sirah Nabawiyyah Tingkatan 1 - Modern Islamic Theme */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Reem+Kufi:wght@600;700&display=swap');

:root {
  --primary: #065F46;       /* Emerald deep */
  --primary-light: #0D9488; /* Teal vibrant */
  --primary-dark: #044E39;
  --primary-glow: rgba(13, 148, 136, 0.4);
  --gold: #D97706;          /* Desert sand gold */
  --gold-light: #F59E0B;
  --gold-pale: #FEF3C7;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --sand-bg: #F9F6F0;       /* Warm desert parchment */
  --sand-card: #FFFFFF;
  --sand-border: #E6DFD3;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --success: #10B981;
  --danger: #EF4444;
  --info: #0284C7;
  --purple: #7C3AED;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;
  --font-kufi: 'Reem Kufi', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--sand-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#e5ded3 1px, transparent 1px),
    radial-gradient(#e5ded3 1px, var(--sand-bg) 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}

/* ========================================================
   TOP HEADER (MOCKUP ACCURATE)
   ======================================================== */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--sand-border);
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(6, 95, 70, 0.04);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 46px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary) 0%, #064e3b 100%);
  border-radius: 10px 10px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FBBF24;
  box-shadow: 0 4px 10px rgba(6, 95, 70, 0.3);
  position: relative;
  overflow: hidden;
}

.brand-emblem::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1.5px solid rgba(251, 191, 36, 0.4);
  border-radius: inherit;
  pointer-events: none;
}

.brand-emblem svg {
  width: 28px;
  height: 28px;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-title span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.5px;
}

/* Student Profile Pill (Right Side) */
.student-profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--sand-border);
  padding: 5px 16px 5px 8px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #E0E7FF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #C7D2FE;
}

.student-avatar img, .student-avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-info {
  display: flex;
  flex-direction: column;
}

.student-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.student-xp {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.xp-badge {
  color: var(--gold);
}

/* Circular Progress Ring */
.progress-ring-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__circle-bg {
  stroke: #E2E8F0;
}

.progress-ring__circle {
  stroke: var(--primary-light);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease-in-out;
}

.progress-text {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
}

/* ========================================================
   SUB-BAR: CONTROLS, SEARCH, AR/BM TOGGLE
   ======================================================== */
.control-bar {
  max-width: 1300px;
  margin: 12px auto 6px auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.control-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-control {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--sand-border);
  background: #FFFFFF;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-icon-control:hover {
  background: var(--sand-bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

.map-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
  text-align: center;
}

.control-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* AR / BM Toggle */
.lang-toggle-btn {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.25);
  transition: all 0.2s;
}

.lang-toggle-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Search Box */
.search-wrapper {
  position: relative;
  width: 220px;
}

.search-input {
  width: 100%;
  background: #FFFFFF;
  border: 1.5px solid var(--sand-border);
  padding: 7px 14px 7px 36px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  width: 260px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* ========================================================
   MAIN MAP CANVAS ("PETA KEMBARA")
   ======================================================== */
.map-viewport-container {
  flex: 1;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 24px 100px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.map-card {
  position: relative;
  width: 100%;
  min-height: 580px;
  background: linear-gradient(175deg, #FEF9EF 0%, #F5EADA 100%);
  border: 2px solid #E4D8C4;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 0 40px rgba(217, 119, 6, 0.05);
  overflow: hidden;
  user-select: none;
}

/* Decorative Map Background Elements */
.map-bg-graphics {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Interactive SVG Journey Track */
.journey-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
}

.track-path-glow {
  fill: none;
  stroke: rgba(217, 119, 6, 0.25);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-path-core {
  fill: none;
  stroke: #B45309;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 6;
}

.track-path-completed {
  fill: none;
  stroke: #059669;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Nodes Container */
.map-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

/* Individual Node Style */
.map-node {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.map-node:hover {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 20;
}

/* Node States */
.map-node.completed {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #FFFFFF;
  border: 3px solid #FEF3C7;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.map-node.active {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #065F46 0%, #0D9488 100%);
  color: #FFFFFF;
  border: 3.5px solid #A7F3D0;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.35), 0 8px 20px rgba(6, 95, 70, 0.5);
  animation: pulse-ring 2s infinite;
  z-index: 30;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5), 0 8px 20px rgba(6, 95, 70, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0), 0 8px 20px rgba(6, 95, 70, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 8px 20px rgba(6, 95, 70, 0.5); }
}

.map-node.locked {
  background: #E2E8F0;
  color: #94A3B8;
  border: 2.5px solid #CBD5E1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.map-node.locked svg {
  width: 18px;
  height: 18px;
  color: #94A3B8;
}

/* Callout Badge (Pill pointing to Active Node) */
.active-node-callout {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 40;
}

.active-node-callout::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
}

/* ========================================================
   POPUP ACTION CARD (EXACT MOCKUP ACCORDING TO USER'S IMAGE)
   ======================================================== */
.node-action-popup {
  position: absolute;
  z-index: 50;
  width: 320px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popup-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-bounce {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.popup-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #FFFFFF;
  transform: rotate(45deg);
  box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.04);
}

.popup-arrow.left {
  left: -8px;
  top: 40px;
}

.popup-arrow.right {
  right: -8px;
  top: 40px;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.popup-header-info {
  display: flex;
  flex-direction: column;
}

.popup-lesson-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-lesson-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.popup-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.popup-close-btn:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

/* 5 Action Tab Pill Buttons */
.popup-tab-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.popup-tab-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.15);
}

.popup-tab-btn:active {
  transform: translateY(0);
}

.tab-btn-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-btn-content svg {
  width: 20px;
  height: 20px;
}

/* Tab Colors Matching User Mockup */
.btn-summary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-text {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
}

.btn-translation {
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
}

.btn-infographic {
  background: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
}

.btn-questions {
  background: linear-gradient(135deg, #4338CA 0%, #3730A3 100%);
  position: relative;
  overflow: visible;
}

/* Mini Audio Play Badge inside Text Button */
.mini-play-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Ribbon Badge inside Questions Button */
.quiz-ribbon-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  line-height: 1.1;
  text-align: center;
}

/* ========================================================
   BOTTOM NAVIGATION BAR (MOCKUP ACCURATE)
   ======================================================== */
.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  border: 1.5px solid var(--sand-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
  z-index: 90;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  color: var(--primary);
  background: #F8FAFC;
}

/* Center Highlighted 'Kembara' Nav Item */
.nav-item.highlight-compass {
  background: linear-gradient(135deg, var(--primary) 0%, #064E3B 100%);
  color: #FFFFFF;
  padding: 10px 18px 8px 18px;
  border-radius: 20px;
  margin-top: -16px;
  box-shadow: 0 6px 18px rgba(6, 95, 70, 0.35);
  transform: translateY(-2px);
}

.nav-item.highlight-compass svg {
  width: 24px;
  height: 24px;
}

.nav-item.highlight-compass:hover {
  transform: translateY(-4px);
  filter: brightness(1.1);
  color: #FFFFFF;
}

/* ========================================================
   FULL LESSON READER MODAL (5 TABS ARCHITECTURE)
   ======================================================== */
.lesson-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lesson-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.lesson-modal-container {
  background: #FFFFFF;
  border-radius: 24px;
  width: 100%;
  max-width: 980px;
  height: 90vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
  0% { transform: translateY(30px) scale(0.98); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Reader Modal Header */
.modal-header {
  background: linear-gradient(135deg, #065F46 0%, #044E39 100%);
  color: #FFFFFF;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-lesson-pages-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: #FEF3C7;
  width: fit-content;
}

.modal-lesson-title-ms {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal-lesson-title-ar {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  font-weight: 700;
  color: #FDE68A;
  direction: rtl;
  margin-top: 2px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Audio Player Bar */
.audio-player-bar {
  background: #F8FAFC;
  border-bottom: 1.5px solid #E2E8F0;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.audio-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-audio-main {
  background: var(--gold);
  color: #FFFFFF;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
  transition: all 0.2s;
}

.btn-audio-main:hover {
  background: #B45309;
}

.audio-speed-btn {
  background: #E2E8F0;
  color: var(--text-main);
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.audio-speed-btn:hover {
  background: #CBD5E1;
}

.karaoke-badge-pill {
  background: #ECFDF5;
  color: #059669;
  border: 1.5px solid #A7F3D0;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.audio-scrubber-center {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.audio-time-label {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace, sans-serif;
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
}

.audio-scrubber-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 4px;
  background: #E2E8F0;
  outline: none;
  cursor: pointer;
}

.audio-scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.4);
  transition: transform 0.15s ease;
}

.audio-scrubber-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.audio-status-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========================================================
   SYNCHRONIZED SENTENCE READING HIGHLIGHT STYLES
   ======================================================== */
.reading-sentence,
.karaoke-sentence {
  display: inline;
  padding: 4px 8px;
  margin: 0 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, color 0.25s ease;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.reading-sentence:hover,
.karaoke-sentence:hover {
  background: rgba(254, 243, 199, 0.5);
  color: #92400E;
}

.reading-sentence.active-sentence,
.karaoke-sentence.active-sentence {
  background: rgba(254, 240, 138, 0.96) !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.5), 0 8px 25px rgba(217, 119, 6, 0.25) !important;
  color: #0F172A !important;
  font-weight: 700 !important;
  position: relative;
  z-index: 5;
}

/* Karaoke Word-by-Word & Arabic Words Hover Styling */
.karaoke-word,
.arabic-word {
  display: inline-block;
  padding: 1px 4px;
  margin: 0 1px;
  border-radius: 6px;
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  cursor: pointer;
  border-bottom: 2px dotted transparent;
}

.karaoke-word:hover,
.arabic-word:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border-bottom: 2px dotted #059669;
  border-radius: 5px;
}

.reading-sentence.active-sentence .karaoke-word.active-word,
.karaoke-word.active-word {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.45) !important;
  border-radius: 7px !important;
  transform: scale(1.05);
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 10;
  border-bottom: none !important;
}

/* Floating Interactive Tooltip for Arabic Words */
.arabic-word-tooltip {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  background: #0F172A;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 9px;
  box-shadow: 0 10px 24px -3px rgba(0, 0, 0, 0.45), 0 4px 10px -2px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  max-width: 280px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) translateY(-10px) scale(0.95);
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.15s;
  backdrop-filter: blur(8px);
}

.arabic-word-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-10px) scale(1);
}

.arabic-word-tooltip.placement-bottom {
  transform: translate(-50%, 0) translateY(10px) scale(0.95);
}

.arabic-word-tooltip.placement-bottom.visible {
  transform: translate(-50%, 0) translateY(10px) scale(1);
}

.arabic-word-tooltip .tooltip-word-ar {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.25rem;
  line-height: 1.35;
  color: #FDE047;
  font-weight: 700;
  direction: rtl;
  margin-bottom: 2px;
}

.arabic-word-tooltip .tooltip-meaning {
  font-size: 0.84rem;
  line-height: 1.35;
  color: #F8FAFC;
  font-weight: 600;
}

.arabic-word-tooltip .tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  overflow: hidden;
}

.arabic-word-tooltip .tooltip-arrow::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #0F172A;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.arabic-word-tooltip.placement-bottom .tooltip-arrow {
  top: -6px;
  bottom: auto;
}

.arabic-word-tooltip.placement-bottom .tooltip-arrow::after {
  top: auto;
  bottom: -6px;
}

/* Reader Tab Navigation Bar (Inside Modal) - FIXED & VISIBLE */
.reader-tabs-nav {
  display: flex;
  background: #FFFFFF;
  border-bottom: 2px solid #E2E8F0;
  padding: 10px 24px;
  overflow-x: auto;
  gap: 10px;
  flex-shrink: 0 !important;
  min-height: 58px !important;
  align-items: center;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.reader-tab-btn {
  padding: 9px 18px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  border-radius: 9999px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 800;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.reader-tab-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  transition: all 0.2s;
}

.reader-tab-btn:hover {
  background: #E2E8F0;
  color: #065F46;
  border-color: #94A3B8;
  transform: translateY(-1px);
}

.reader-tab-btn.active {
  background: #065F46 !important;
  color: #FFFFFF !important;
  border-color: #065F46 !important;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.28);
  transform: translateY(-1px);
}

.reader-tab-btn.active svg {
  stroke: #FFFFFF !important;
}

/* Reader Modal Body */
.modal-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 24px;
  background: #FAF8F5;
}

/* ========================================================
   TAB 1: SUMMARY (RINGKASAN)
   ======================================================== */
.summary-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.summary-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1.5px solid #E8E2D7;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.summary-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1.5px solid #F1F5F9;
  padding-bottom: 8px;
}

.summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
}

.summary-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  flex-shrink: 0;
}

.summary-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-pill {
  background: #FEF3C7;
  color: #92400E;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #FDE68A;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-pill.place {
  background: #E0F2FE;
  color: #0369A1;
  border-color: #BAE6FD;
}

.takeaway-card {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1.5px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 18px;
  color: #065F46;
}

.takeaway-title {
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.takeaway-text {
  font-size: 0.92rem;
  line-height: 1.6;
  font-style: italic;
}

/* ========================================================
   TAB 2: TEXT (TEKS ARAB VERBATIM + INLINE GRAPHICS)
   ======================================================== */
.reader-arabic-flow {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 0 200px 0;
}

.arabic-paragraph-block {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1.5px solid #E6DFD3;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.arabic-paragraph-block.active-block {
  border-color: #F59E0B;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.16), 0 0 0 1.5px #FCD34D;
}

.paragraph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 10px;
}

.paragraph-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: #ECFDF5;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.paragraph-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-paragraph-audio {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-paragraph-audio:hover {
  background: #FDE68A;
}

.btn-toggle-translation {
  background: #F1F5F9;
  color: var(--text-main);
  border: 1px solid #E2E8F0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-toggle-translation:hover {
  background: #E2E8F0;
}

/* Classical Arabic Typography */
.arabic-text-content {
  font-family: var(--font-arabic);
  font-size: 1.42rem;
  line-height: 2.3;
  color: #0F172A;
  direction: rtl;
  text-align: right;
  word-spacing: 2px;
}

/* Inline Footnote Marker */
.footnote-ref {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9em;
  padding: 0 4px;
  cursor: pointer;
}

/* Footnotes Section */
.paragraph-footnotes {
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border-right: 3px solid var(--gold);
  direction: rtl;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footnote-item {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 4px;
}

.footnote-item .footnote-ms {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-main);
  direction: ltr;
  text-align: left;
  display: block;
}

/* Malay Translation Accordion (Open/Close per paragraph) */
.paragraph-translation-content {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border-left: 3.5px solid var(--primary-light);
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #334155;
  display: none;
  animation: fadeIn 0.25s ease;
}

.paragraph-translation-content.open {
  display: block;
}

/* ========================================================
   INLINE GRAPHICS CARDS (EMBEDDED DIRECTLY AT RELEVANT TEXT)
   ======================================================== */
.inline-graphic-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF8F5 100%);
  border-radius: var(--radius-md);
  border: 1.5px solid #E4D8C4;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 6px 0;
}

.graphic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.graphic-badge {
  background: var(--gold-pale);
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.graphic-title-group {
  display: flex;
  flex-direction: column;
}

.graphic-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
}

.graphic-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.graphic-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.graphic-item-box {
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 1px solid #E8E2D7;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.graphic-item-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--item-color, var(--primary));
}

.graphic-item-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.graphic-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Timeline Style Graphic */
.graphic-timeline-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding-left: 20px;
}

.graphic-timeline-flow::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  background: #CBD5E1;
}

.timeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #FFFFFF;
}

.timeline-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-step-year {
  background: #FEF3C7;
  color: #B45309;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.timeline-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.timeline-step-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================================
   TAB 3: TRANSLATION (TERJEMAHAN PENUH)
   ======================================================== */
.translation-full-container {
  max-width: 820px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1.5px solid #E6DFD3;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.translation-text-block {
  font-size: 1rem;
  line-height: 1.85;
  color: #1E293B;
  white-space: pre-line;
}

/* ========================================================
   TAB 4: INFOGRAPHIC (POSTER VISUAL KEMBARA)
   ======================================================== */
.infographic-container {
  max-width: 840px;
  margin: 0 auto;
  background: linear-gradient(145deg, #065F46 0%, #044E39 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.infographic-container::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.1);
  pointer-events: none;
}

.infographic-header {
  text-align: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 14px;
}

.infographic-main-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FDE68A;
}

.infographic-subtitle {
  font-size: 0.9rem;
  color: #E2E8F0;
  margin-top: 4px;
}

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

.infographic-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.infographic-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FBBF24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
}

.infographic-card-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.infographic-card-points li {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #F1F5F9;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.infographic-card-points li::before {
  content: '✦';
  color: #FBBF24;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* ========================================================
   TAB 5: QUESTIONS (KUIZ & SOALAN PEPERIKSAAN BUKU TEKS)
   ======================================================== */
.questions-container {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Section Header */
.quiz-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--sand-border);
  padding-bottom: 8px;
}

.quiz-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Interactive Quiz Question Card */
.quiz-question-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1.5px solid #E6DFD3;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-question-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.5;
}

.quiz-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-main);
  text-align: left;
  transition: all 0.2s ease;
}

.quiz-option-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.quiz-option-btn.selected {
  border-color: var(--primary);
  background: #ECFDF5;
  color: var(--primary-dark);
  font-weight: 700;
}

.quiz-option-btn.correct {
  border-color: var(--success);
  background: #D1FAE5;
  color: #065F46;
  font-weight: 700;
}

.quiz-option-btn.wrong {
  border-color: var(--danger);
  background: #FEE2E2;
  color: #991B1B;
}

.option-letter-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-option-btn.correct .option-letter-badge {
  background: var(--success);
  color: #FFFFFF;
}

.quiz-option-btn.wrong .option-letter-badge {
  background: var(--danger);
  color: #FFFFFF;
}

.quiz-feedback-box {
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--info);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: none;
}

.quiz-feedback-box.open {
  display: block;
}

/* Textbook Exam Question Box (Soalan Peperiksaan ms 73-76) */
.textbook-exam-box {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 2px solid #FCD34D;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.textbook-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.exam-pill-badge {
  background: #B45309;
  color: #FFFFFF;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.exam-book-ref {
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400E;
}

.exam-question-ar {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  line-height: 2;
  color: #78350F;
  direction: rtl;
  text-align: right;
  font-weight: 700;
}

.exam-question-ms {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.6;
}

.btn-toggle-model-answer {
  background: #B45309;
  color: #FFFFFF;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.3);
}

.btn-toggle-model-answer:hover {
  background: #92400E;
}

.model-answer-accordion {
  background: #FFFFFF;
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 18px;
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.25s ease;
}

.model-answer-accordion.open {
  display: flex;
}

.model-answer-ar {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  line-height: 2.1;
  color: #0F172A;
  direction: rtl;
  text-align: right;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 12px;
  white-space: pre-line;
}

.model-answer-ms {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #334155;
  white-space: pre-line;
}

/* ========================================================
   BOTTOM VIEWS: KAD TOKOH, NOTA POKET, PAPAN MARKAH
   ======================================================== */
.aux-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.aux-modal-container {
  background: #FFFFFF;
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.aux-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #064E3B 100%);
  color: #FFFFFF;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aux-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.aux-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--sand-bg);
}

/* Character Cards Grid (Kad Tokoh) */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.character-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1.5px solid #E6DFD3;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.character-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.character-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.character-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid #F59E0B;
}

.character-card-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.character-card-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.character-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Pocket Notes Accordion (Nota Poket) */
.pocket-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pocket-note-item {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1.5px solid #E6DFD3;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pocket-note-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: background 0.2s;
}

.pocket-note-header:hover {
  background: #F8FAFC;
}

.pocket-note-body {
  padding: 16px 18px;
  background: #FAF8F5;
  border-top: 1px solid #E6DFD3;
  display: none;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.6;
}

.pocket-note-body.open {
  display: block;
}

/* ========================================================
   RESPONSIVE DESIGN (MOBILE & TABLET ADAPTATION)
   ======================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 8px 14px;
  }
  
  .brand-title h1 {
    font-size: 0.95rem;
  }
  
  .control-bar {
    padding: 0 14px;
    flex-wrap: wrap;
  }
  
  .search-wrapper {
    width: 140px;
  }
  
  .search-input:focus {
    width: 180px;
  }
  
  .map-card {
    min-height: 480px;
  }
  
  .node-action-popup {
    width: 290px;
    padding: 14px;
  }
  
  .popup-tab-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  
  .modal-header {
    padding: 14px 16px;
  }
  
  .modal-lesson-title-ms {
    font-size: 1.05rem;
  }
  
  .modal-lesson-title-ar {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 16px 12px;
  }
  
  .arabic-text-content {
    font-size: 1.25rem;
    line-height: 2.1;
  }
  
  .bottom-nav {
    padding: 4px 8px;
    gap: 6px;
  }
  
  .nav-item {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}

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


/* ========================================================
   MAIN PAGE LANGUAGE OPTION BAR [Bahasa Melayu / العربية]
   ======================================================== */
.main-page-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 9999px;
  padding: 8px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.main-lang-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1E293B;
}

.main-lang-prompt svg {
  color: var(--primary);
  flex-shrink: 0;
}

.main-lang-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid #E2E8F0;
}

.main-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748B;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.main-lang-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
}

.main-lang-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.25);
}

.main-lang-btn .lang-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.main-lang-btn .lang-name {
  letter-spacing: 0.01em;
}

/* ========================================================
   MAIN PAGE HERO SECTION (TITLE + DEVELOPER + ADVANTAGES)
   ======================================================== */
.main-hero-section {
  max-width: 1300px;
  margin: 18px auto 24px auto;
  padding: 0 24px;
  width: 100%;
}

.hero-card-container {
  background: linear-gradient(160deg, #FFFFFF 0%, #FAF6EE 50%, #F5EFE3 100%);
  border: 2px solid #E6DFD3;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 10px 30px -5px rgba(6, 95, 70, 0.08), 0 0 0 1px rgba(217, 119, 6, 0.08);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-card-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--gold) 50%, var(--primary-light) 100%);
}

.hero-card-container::after {
  content: '۞';
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 5rem;
  color: rgba(217, 119, 6, 0.06);
  pointer-events: none;
  font-family: var(--font-arabic);
}

/* 1. The Title Section */
.hero-title-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  align-items: center;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  color: var(--primary);
  border: 1.5px solid #A7F3D0;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.08);
}

.hero-title-ar {
  font-family: var(--font-arabic);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  direction: rtl;
  line-height: 1.4;
  margin-top: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.hero-title-ms {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.hero-subtitle-desc {
  max-width: 820px;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 2. Developer Section */
.developer-section-card {
  background: #FFFFFF;
  border: 1.5px solid #E6DFD3;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.developer-info-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.developer-avatar-crest {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #064E3B 100%);
  color: #FDE68A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.25);
  flex-shrink: 0;
  border: 2px solid #FEF3C7;
}

.developer-text-details {
  display: flex;
  flex-direction: column;
}

.developer-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.developer-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.developer-role-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.developer-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dev-tag-pill {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dev-tag-pill.verified {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: var(--primary);
}

/* 3. The Advantages Section */
.advantages-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.advantages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 2px solid #E6DFD3;
  padding-bottom: 12px;
}

.advantages-title-group {
  display: flex;
  flex-direction: column;
}

.advantages-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.advantages-subheading {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.advantages-count-badge {
  background: var(--gold-pale);
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

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

.advantage-card {
  background: #FFFFFF;
  border: 1.5px solid #E8E2D7;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.advantage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-light);
}

.advantage-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.advantage-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.advantage-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.advantage-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 4. Action CTA Bar */
.hero-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #044E39 100%);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(6, 95, 70, 0.25);
}

.cta-buttons-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-cta-main {
  background: var(--gold);
  color: #FFFFFF;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transition: all 0.2s ease;
}

.btn-cta-main:hover {
  background: #B45309;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

.btn-cta-secondary {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.cta-stats-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #FEF3C7;
  flex-wrap: wrap;
}

.cta-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Quick Lesson Navigator Grid */
.lesson-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.lesson-quick-card {
  background: #FFFFFF;
  border: 1.5px solid #E6DFD3;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.lesson-quick-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lesson-quick-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lesson-quick-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.lesson-quick-title-ms {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-quick-title-ar {
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  color: var(--gold);
  direction: rtl;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ========================================================
   PAGE 2: TOC (TABLE OF CONTENTS / JADUAL KANDUNGAN)
   ======================================================== */
.page-nav-bar {
  max-width: 1300px;
  margin: 10px auto 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-nav-wrapper {
  background: #FFFFFF;
  border: 1.5px solid var(--sand-border);
  padding: 5px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.page-nav-btn {
  background: none;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.page-nav-btn:hover {
  color: var(--primary);
  background: #F8FAFC;
}

.page-nav-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #064E3B 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.25);
}

/* Page Container View Visibility */
.app-view-page {
  display: none;
  animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-view-page.active-page {
  display: block;
}

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

/* TOC Container */
.toc-container {
  max-width: 1100px;
  margin: 18px auto 90px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.toc-header-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #FAF7F0 100%);
  border: 2px solid #E6DFD3;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.toc-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--primary) 100%);
}

.toc-header-badge {
  background: var(--gold-pale);
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.toc-header-title-ar {
  font-family: var(--font-arabic);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  direction: rtl;
  margin-top: 4px;
}

.toc-header-title-ms {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.toc-header-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 760px;
  line-height: 1.5;
}

/* Phase Grouping Card */
.toc-phase-card {
  background: #FFFFFF;
  border: 1.5px solid #E6DFD3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.toc-phase-header {
  background: linear-gradient(135deg, #065F46 0%, #044E39 100%);
  color: #FFFFFF;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toc-phase-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toc-phase-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.toc-phase-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
}

.toc-phase-name-ar {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  color: #FDE68A;
  direction: rtl;
}

.toc-phase-range-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #FEF3C7;
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Lesson Items List inside Phase */
.toc-lessons-list {
  display: flex;
  flex-direction: column;
}

.toc-lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #F1F5F9;
  gap: 16px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  background: #FFFFFF;
  cursor: pointer;
}

.toc-lesson-item:last-child {
  border-bottom: none;
}

.toc-lesson-item:hover {
  background: #F8FAFC;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.toc-lesson-item:hover .toc-lesson-title-ms {
  color: var(--primary);
}

.toc-lesson-item:active {
  transform: scale(0.995);
  background: #F1F5F9;
}

.toc-lesson-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #94A3B8;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toc-lesson-item:hover .toc-lesson-arrow {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.25);
}

.toc-lesson-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.toc-lesson-number-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(6, 95, 70, 0.2);
  border: 2px solid #A7F3D0;
}

.toc-lesson-item.completed .toc-lesson-number-circle {
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  border-color: #FCD34D;
}

.toc-lesson-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-lesson-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toc-lesson-page-tag {
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.toc-lesson-title-ar {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  direction: rtl;
  text-align: right;
  line-height: 1.3;
}

.toc-lesson-title-ms {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.toc-lesson-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 650px;
}

/* Action Buttons inside Lesson Item */
.toc-lesson-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-toc-action {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-toc-action:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-toc-action.primary {
  background: var(--gold);
  color: #FFFFFF;
  border-color: var(--gold);
}

.btn-toc-action.primary:hover {
  background: #B45309;
  border-color: #B45309;
}

/* Special Exam Section Card inside TOC */
.toc-exam-special-card {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 2px solid #FCD34D;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.toc-exam-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toc-exam-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #B45309;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.3);
}

.toc-exam-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-exam-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #92400E;
  text-transform: uppercase;
}

.toc-exam-title-ar {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  font-weight: 700;
  color: #78350F;
  direction: rtl;
}

.toc-exam-title-ms {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1E293B;
}

.toc-exam-desc {
  font-size: 0.84rem;
  color: #64748B;
}

@media (max-width: 768px) {
  .toc-lesson-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 12px;
  }
  
  .toc-lesson-left {
    gap: 12px;
  }

  .toc-lesson-number-circle {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .toc-lesson-arrow {
    width: 32px;
    height: 32px;
  }
  
  .toc-header-card {
    padding: 20px 16px;
  }
  
  .toc-header-title-ar {
    font-size: 1.6rem;
  }
  
  .toc-header-title-ms {
    font-size: 1.2rem;
  }
}

/* ==========================================
   ARABIC LANGUAGE MODE (RTL & TYPOGRAPHY)
   ========================================== */
body.lang-arabic {
  direction: rtl;
  text-align: right;
}

body.lang-arabic .brand-section {
  flex-direction: row-reverse;
}

body.lang-arabic .student-profile-pill {
  flex-direction: row-reverse;
}

body.lang-arabic .brand-title {
  text-align: right;
}

body.lang-arabic .page-nav-wrapper {
  flex-direction: row-reverse;
}

body.lang-arabic .main-page-lang-bar {
  flex-direction: row-reverse;
}

body.lang-arabic .hero-title-section {
  text-align: right;
}

body.lang-arabic .developer-info-group {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .developer-pills {
  justify-content: flex-start;
}

body.lang-arabic .advantages-header {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .advantages-heading {
  text-align: right;
}

body.lang-arabic .advantage-card-header {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .advantage-desc {
  text-align: right;
}

body.lang-arabic .hero-cta-bar {
  flex-direction: row-reverse;
}

body.lang-arabic .cta-buttons-left {
  flex-direction: row-reverse;
}

body.lang-arabic .cta-stats-right {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-header-card {
  text-align: right;
}

body.lang-arabic .control-bar {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-phase-header {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-phase-title-group {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .toc-lesson-item {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .toc-lesson-left {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-lesson-header-row {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-lesson-details {
  text-align: right;
}

body.lang-arabic .toc-lesson-arrow {
  transform: scaleX(-1);
}

body.lang-arabic .toc-exam-special-card {
  flex-direction: row-reverse;
  text-align: right;
}

body.lang-arabic .toc-exam-left {
  flex-direction: row-reverse;
}

body.lang-arabic .toc-exam-details {
  text-align: right;
}

body.lang-arabic .bottom-nav {
  flex-direction: row-reverse;
}

body.lang-arabic .modal-header {
  flex-direction: row-reverse;
}

body.lang-arabic .modal-header-left {
  text-align: right;
}

/* Audio Player bar remains LTR for intuitive audio scrubber progress */
body.lang-arabic .audio-player-bar {
  direction: ltr !important;
  text-align: left;
}

body.lang-arabic .reader-tabs-nav {
  flex-direction: row-reverse;
}

body.lang-arabic .paragraph-toolbar {
  flex-direction: row-reverse;
}

body.lang-arabic .paragraph-actions {
  flex-direction: row-reverse;
}

body.lang-arabic .summary-card {
  text-align: right;
}

body.lang-arabic .summary-card-title {
  flex-direction: row-reverse;
}

body.lang-arabic .takeaway-card {
  text-align: right;
}

body.lang-arabic .takeaway-title {
  flex-direction: row-reverse;
}

body.lang-arabic .quiz-section-header {
  flex-direction: row-reverse;
}

body.lang-arabic .quiz-section-title {
  flex-direction: row-reverse;
}

body.lang-arabic .quiz-question-card {
  text-align: right;
}

body.lang-arabic .quiz-option-btn {
  flex-direction: row-reverse;
  justify-content: flex-end;
  text-align: right;
}

body.lang-arabic .textbook-exam-header {
  flex-direction: row-reverse;
}

body.lang-arabic .exam-question-ms,
body.lang-arabic .model-answer-ms {
  text-align: right;
}

body.lang-arabic .aux-modal-header {
  flex-direction: row-reverse;
}

body.lang-arabic .aux-modal-title {
  flex-direction: row-reverse;
}

body.lang-arabic .character-card {
  text-align: right;
}

body.lang-arabic .character-card-header {
  flex-direction: row-reverse;
}

body.lang-arabic .pocket-note-header {
  flex-direction: row-reverse;
}

body.lang-arabic .pocket-note-body {
  text-align: right;
}

/* ========================================================
   TAB: I'RAB & TATABAHASA NAHU STYLES (TWO-VIEW WORKFLOW)
   ======================================================== */
.irab-tab-wrapper {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

/* 1. MAIN TEXT VIEW */
.irab-main-text-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.irab-header-card {
  background: linear-gradient(135deg, #064E3B 0%, #065F46 60%, #047857 100%);
  color: #FFFFFF;
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 10px 25px -5px rgba(6, 78, 59, 0.25);
  position: relative;
  overflow: hidden;
}

.irab-header-card::after {
  content: 'إعراب';
  position: absolute;
  right: 18px;
  bottom: -15px;
  font-family: var(--font-arabic-calligraphy, 'Amiri', serif);
  font-size: 5.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  line-height: 1;
}

.irab-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.irab-header-badge svg {
  width: 15px;
  height: 15px;
}

.irab-header-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.irab-header-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #D1FAE5;
  margin: 0 0 14px 0;
  max-width: 720px;
}

.irab-instruction-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #FDE047;
}

/* Paragraph Blocks List */
.irab-paragraphs-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.irab-paragraph-block {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
}

.irab-paragraph-block:hover {
  border-color: #CBD5E1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.irab-paragraph-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F1F5F9;
}

.irab-p-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #065F46;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 3px 10px;
  border-radius: 6px;
}

.irab-p-hint {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0F766E;
}

.irab-paragraph-content {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.48rem;
  line-height: 2.25;
  color: #1E293B;
}

/* Clickable Sentence in I'rab Tab */
.irab-clickable-sentence {
  display: inline;
  padding: 3px 6px;
  margin: 0 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #10B981;
  text-underline-offset: 6px;
}

.irab-clickable-sentence:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #064E3B;
  outline: 2px dashed #059669;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18);
}

/* Return Highlight Animation */
@keyframes irabReturnPulse {
  0% {
    background-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
    transform: scale(1.008);
  }
  50% {
    background-color: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
    transform: scale(1);
  }
}

.irab-clickable-sentence.irab-return-highlight {
  animation: irabReturnPulse 2.2s ease-out forwards;
}

.irab-paragraph-block.irab-return-highlight {
  animation: irabReturnPulse 2.2s ease-out forwards;
  border-color: #10B981;
}

/* 2. I'RAB DETAIL SCREEN */
.irab-detail-screen {
  animation: irabFadeIn 0.25s ease-out forwards;
}

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

.irab-screen-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Topbar in Detail Screen */
.irab-screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.btn-irab-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-irab-back:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #065F46;
  transform: translateX(-2px);
}

.irab-screen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #065F46;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 4px 12px;
  border-radius: 9999px;
}

.btn-irab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  color: #64748B;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-irab-close:hover {
  background: #FEE2E2;
  border-color: #F87171;
  color: #DC2626;
}

/* Spotlight Card: Selected Sentence Display */
.irab-spotlight-card {
  background: #FFFFFF;
  border: 2px solid #A7F3D0;
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 8px 24px rgba(6, 95, 70, 0.07);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spotlight-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: #047857;
  background: #ECFDF5;
  padding: 3px 10px;
  border-radius: 6px;
}

.spotlight-arabic-text {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.7rem;
  line-height: 2.2;
  color: #0F172A;
  direction: rtl;
  text-align: right;
  font-weight: 700;
  padding: 14px 18px;
  background: #F0FDF4;
  border-radius: 14px;
  border-right: 5px solid #059669;
}

/* Spotlight Action Buttons (Sound + Translate) */
.spotlight-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-spotlight-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-spotlight-action.btn-sound {
  background: #065F46;
  border: 1.5px solid #064E3B;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.2);
}

.btn-spotlight-action.btn-sound:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-spotlight-action.btn-sound.playing {
  background: #DC2626;
  border-color: #991B1B;
  animation: pulse 1.5s infinite;
}

.btn-spotlight-action.btn-translate {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  color: #334155;
}

.btn-spotlight-action.btn-translate:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
  transform: translateY(-1px);
}

.btn-spotlight-action.btn-translate.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #1D4ED8;
}

/* Translation Box */
.spotlight-translation-box {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.spotlight-translation-box .trans-label {
  font-size: 0.8rem;
  color: #64748B;
  margin-bottom: 6px;
}

.spotlight-translation-box .trans-content {
  font-size: 0.96rem;
  line-height: 1.6;
  color: #1E293B;
  font-style: italic;
  font-weight: 500;
}

/* Analysis Card */
.irab-analysis-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.analysis-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px solid #F1F5F9;
  padding-bottom: 14px;
}

.analysis-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-title h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
}

.analysis-focus-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: #047857;
  background: #ECFDF5;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #A7F3D0;
}

/* I'rab Table Styling */
.irab-breakdown-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.irab-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.irab-table thead {
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0;
}

.irab-table th {
  padding: 12px 14px;
  font-weight: 800;
  color: #334155;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.irab-table tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
}

.irab-table tbody tr:hover {
  background: #F8FAFC;
}

.irab-table td {
  padding: 12px 14px;
  vertical-align: top;
}

.irab-word-ar {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #065F46;
  direction: rtl;
  display: inline-block;
}

.irab-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.badge-case-marfu {
  background: #DEF7EC;
  color: #03543F;
  border: 1px solid #BCF0DA;
}

.badge-case-mansub {
  background: #FEF08A;
  color: #854D0E;
  border: 1px solid #FDE047;
}

.badge-case-majrur {
  background: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #DDD6FE;
}

.badge-case-mabni {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

.irab-text-ar {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: #0F172A;
  direction: rtl;
  text-align: right;
  margin-bottom: 6px;
}

.irab-text-ms {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.irab-tip-text {
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.45;
}

/* Golden Rule Box */
.irab-golden-rule {
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: 12px;
  padding: 16px 18px;
}

.golden-rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 800;
  color: #92400E;
  margin-bottom: 8px;
}

.golden-rule-body {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #78350F;
}

/* Mini Practice Box */
.irab-practice-box {
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
  border-radius: 14px;
  padding: 16px 18px;
}

.practice-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.practice-box-title h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #166534;
  flex: 1;
}

.practice-xp-tag {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.practice-question {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 12px;
}

.practice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.practice-opt-btn {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.15s;
  text-align: left;
}

.practice-opt-btn:hover:not(:disabled) {
  border-color: #059669;
  background: #F0FDF4;
  transform: translateY(-1px);
}

.practice-opt-btn .opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #F1F5F9;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  flex-shrink: 0;
}

.practice-opt-btn.correct {
  background: #D1FAE5 !important;
  border-color: #059669 !important;
  color: #065F46 !important;
}

.practice-opt-btn.correct .opt-letter {
  background: #059669;
  color: #FFFFFF;
}

.practice-opt-btn.wrong {
  background: #FEE2E2 !important;
  border-color: #DC2626 !important;
  color: #991B1B !important;
}

.practice-opt-btn.wrong .opt-letter {
  background: #DC2626;
  color: #FFFFFF;
}

.practice-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.feedback-correct {
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
  color: #065F46;
}

.feedback-wrong {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.feedback-badge {
  font-weight: 800;
  margin-bottom: 4px;
}

/* Large Bottom Return Button */
.irab-bottom-bar {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.btn-irab-back-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #065F46;
  border: 1.5px solid #064E3B;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.25);
  transition: all 0.2s;
}

.btn-irab-back-large:hover {
  background: #047857;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(6, 95, 70, 0.35);
}

/* RTL / Arabic Mode adjustments for I'rab */
body.lang-arabic .irab-header-card::after {
  right: auto;
  left: 18px;
}

body.lang-arabic .irab-paragraph-bar {
  flex-direction: row-reverse;
}

body.lang-arabic .irab-screen-topbar {
  flex-direction: row-reverse;
}

body.lang-arabic .btn-irab-back {
  flex-direction: row-reverse;
}

body.lang-arabic .spotlight-header {
  flex-direction: row-reverse;
}

body.lang-arabic .spotlight-arabic-text {
  border-right: none;
  border-left: 5px solid #059669;
}

body.lang-arabic .spotlight-actions-bar {
  flex-direction: row-reverse;
}

body.lang-arabic .spotlight-translation-box {
  text-align: right;
  direction: rtl;
}

body.lang-arabic .analysis-section-header {
  flex-direction: row-reverse;
}

body.lang-arabic .irab-table th,
body.lang-arabic .irab-table td {
  text-align: right;
  direction: rtl;
}

body.lang-arabic .golden-rule-header {
  flex-direction: row-reverse;
}

body.lang-arabic .golden-rule-body {
  text-align: right;
  direction: rtl;
}

body.lang-arabic .practice-box-title {
  flex-direction: row-reverse;
}

body.lang-arabic .practice-question {
  text-align: right;
  direction: rtl;
}

body.lang-arabic .practice-opt-btn {
  text-align: right;
  direction: rtl;
  flex-direction: row-reverse;
}

body.lang-arabic .btn-irab-back-large {
  flex-direction: row-reverse;
}

