/* ==========================================================================
   AL-MUHAFFIZ QURAN PLAYER - COMPLETE CSS STYLING & EMBEDDED FONTS
   ========================================================================== */

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

/* Embedded Local Fonts */
@font-face {
  font-family: 'me_quran';
  src: local('me_quran'),
       local('me_quran Regular'),
       url('/static/fonts/me_quran.ttf') format('truetype'),
       url('fonts/me_quran.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Amiri Quran';
  src: local('Amiri Quran'),
       local('AmiriQuran'),
       url('/static/fonts/amiri-quran.ttf') format('truetype'),
       url('fonts/amiri-quran.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Amiri';
  src: local('Amiri'),
       url('/static/fonts/amiri-regular.ttf') format('truetype'),
       url('fonts/amiri-regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanz-al-Marjaan';
  src: local('Kanz-al-Marjaan'),
       local('kanz-al-marjaan'),
       local('Kanz-al-Lulu'),
       local('KMforJamea'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.woff2') format('woff2'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.ttf') format('truetype'),
       url('/static/fonts/kanz-al-marjaan.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanz-al-Lulu';
  src: local('Kanz-al-Lulu'),
       local('Kanz-al-Marjaan'),
       local('KMforJamea'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.woff2') format('woff2'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.ttf') format('truetype'),
       url('/static/fonts/kanz-al-marjaan.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'KMforJamea';
  src: local('KMforJamea'),
       local('Kanz-al-Marjaan'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.woff2') format('woff2'),
       url('/static/fonts/Kanz-al-Marjaan-Regular.ttf') format('truetype'),
       url('/static/fonts/KMforJamea.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="parchment"] {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-quran: 'me_quran', 'Amiri Quran', 'Scheherazade New', 'Amiri', serif;
  --font-dawat: 'Kanz-al-Marjaan', 'Kanz-al-Lulu', 'KMforJamea', 'Scheherazade New', 'Amiri', serif;
  
  /* Permanent Warm Parchment Theme */
  --bg-primary: #f4ecd8;
  --bg-surface: #fdfbf7;
  --bg-card: #ede4ce;
  --bg-glass: rgba(253, 251, 247, 0.95);
  --border-color: rgba(180, 83, 9, 0.18);
  --border-focus: #b45309;
  --text-primary: #3d2f1f;
  --text-secondary: #63503d;
  --text-muted: #9c8a78;
  --gold-primary: #b45309;
  --gold-hover: #92400e;
  --gold-glow: rgba(180, 83, 9, 0.25);
  --gold-highlight: rgba(217, 119, 6, 0.28);
  --gold-border: #b45309;
  --accent-teal: #0d9488;
  --accent-blue: #3b82f6;
  --shadow-lg: 0 10px 25px -5px rgba(61, 47, 31, 0.12), 0 8px 10px -6px rgba(61, 47, 31, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* App Container */
.player-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 100vw;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  backdrop-filter: blur(12px);
  gap: 10px;
  flex-wrap: nowrap;
  min-height: 54px;
  max-width: 100vw;
  box-sizing: border-box;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.brand-logo-img, .protected-logo {
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  pointer-events: none !important;
}

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

.brand-title h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.brand-title h1 span {
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Navigation Controls in Header */
.nav-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.select-control {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 5px 8px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  max-width: 170px;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

#select-surah {
  max-width: 160px;
  min-width: 110px;
}

#select-juz {
  max-width: 105px;
  min-width: 75px;
}

#select-qari {
  max-width: 180px;
  min-width: 110px;
}

#select-pub {
  max-width: 150px;
  min-width: 100px;
}

.select-control:focus, .select-control:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.page-jump-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3px 6px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.page-input {
  width: 42px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.page-total {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dossier-nav-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.dossier-nav-btn i {
  color: var(--gold-primary);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.dossier-nav-btn:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
  transform: translateY(-1px);
}

.dossier-nav-btn.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
  box-shadow: 0 2px 10px var(--gold-glow);
}

.dossier-nav-btn.active i {
  color: #000;
}

.icon-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.icon-btn.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.icon-btn.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Main Workspace (Mushaf Viewer) */
.mushaf-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
  padding: 12px 24px;
}

.page-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 20;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.page-nav-arrow:hover {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
  box-shadow: 0 4px 16px var(--gold-glow);
}

.page-nav-arrow.prev-page {
  right: 16px;
}

.page-nav-arrow.next-page {
  left: 16px;
}

/* Mushaf Page Container & Canvas Layer */
.mushaf-stage {
  position: relative;
  max-height: 100%;
  max-width: 100%;
  display: inline-flex;
  width: fit-content;
  height: fit-content;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: transform 0.2s ease;
  line-height: 0;
}

.mushaf-image {
  max-height: calc(100vh - 180px);
  max-width: calc(100vw - 140px);
  height: auto;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* SVG Interactive Glyphs Overlay */
.mushaf-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ayah-glyph-box {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.ayah-glyph-box:hover {
  fill: rgba(245, 158, 11, 0.18);
  stroke: rgba(245, 158, 11, 0.4);
  stroke-width: 1.5;
  stroke-dasharray: 4,2;
}

/* Active Playing Ayah Highlight */
.ayah-glyph-box.active-ayah {
  fill: var(--gold-highlight);
  stroke: var(--gold-border);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px var(--gold-glow));
  animation: pulse-active 2s infinite ease-in-out;
}

@keyframes pulse-active {
  0%, 100% { fill-opacity: 0.35; }
  50% { fill-opacity: 0.55; }
}

/* Hifz Masking Curtain Overlay */
.hifz-mask-box {
  fill: #1e293b;
  fill-opacity: 0.96;
  cursor: pointer;
  transition: fill-opacity 0.3s ease;
}

.hifz-mask-box:hover {
  fill-opacity: 0.15;
}

.hifz-mask-box.revealed {
  fill-opacity: 0 !important;
  pointer-events: none;
}

/* Sub-Ayah Phrase Subtitle Pill */
.subayah-pill {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-quran);
  font-size: 1.25rem;
  color: var(--gold-hover);
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 30;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
}

/* Bottom Control Deck */
.control-deck {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

/* Scrubber Bar */
.scrubber-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  direction: ltr !important;
  user-select: none;
}

.time-display {
  font-size: 0.82rem;
  font-family: var(--font-sans), monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
  font-weight: 600;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: var(--radius-full);
  width: 0%;
  position: relative;
  pointer-events: none;
}

.progress-handle {
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 2.5px solid var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 1;
  pointer-events: none;
}

.progress-track:hover {
  height: 10px;
}

/* Main Controls Bar */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.left-controls, .right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.right-controls {
  justify-content: flex-end;
}

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

/* Play/Pause Button */
.play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--gold-glow);
  transition: all 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px var(--gold-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Toggle Pill Badges */
.badge-toggle {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.badge-toggle:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.badge-toggle.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
}

/* Volume Control */
.volume-control-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.volume-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.volume-slider {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold-primary);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Repeat Count Badge */
.repeat-counter {
  font-size: 0.75rem;
  background: #000;
  color: var(--gold-primary);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* Modal Dialogs (A-B Repeat, Shortcuts) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-close:hover {
  color: var(--text-primary);
}

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

.form-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.input-control {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 0.9rem;
}

.btn-submit {
  background: var(--gold-primary);
  color: #000;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background: var(--gold-hover);
  box-shadow: 0 4px 12px var(--gold-glow);
}

/* ==========================================================================
   COLLAPSIBLE AYAH DATA SIDEBAR & DOSSIER STYLING
   ========================================================================== */

.main-stage-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 128px);
}

.mushaf-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
  padding: 12px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsible Side Panel */
.ayah-sidebar {
  width: 440px;
  max-width: 90vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 50;
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  right: 0;
  top: 0;
  backdrop-filter: blur(16px);
}

.ayah-sidebar.open {
  transform: translateX(0);
}

[dir="rtl"] .ayah-sidebar {
  border-left: none;
  border-right: 1px solid var(--border-color);
  transform: translateX(-100%);
  left: 0;
  right: auto;
  box-shadow: 6px 0 25px rgba(0, 0, 0, 0.4);
}

[dir="rtl"] .ayah-sidebar.open {
  transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-ayah-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-ayah-badge .badge-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.sidebar-ayah-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-ayah-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sidebar Search Bar */
.sidebar-search-wrapper {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.sidebar-search-box:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.sidebar-search-box .search-icon {
  color: var(--gold-primary);
  font-size: 0.85rem;
}

.sidebar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-sans);
  direction: rtl;
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  padding: 0 4px;
}

.btn-clear-search:hover {
  color: var(--text-primary);
}

.btn-clear-search.visible {
  display: block;
}

/* Sidebar Scrollable Body */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-body::-webkit-scrollbar {
  width: 6px;
}
.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Quran Text Card */
.ayah-text-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 4px solid var(--gold-primary);
}

.ayah-arabic-text {
  font-family: var(--font-quran);
  font-size: 1.45rem;
  line-height: 2.2;
  color: var(--text-primary);
  text-align: justify;
  direction: rtl;
}

.ayah-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.action-chip {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-chip:hover {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

/* Section Containers */
.dossier-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.section-title span.count-pill {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

/* Bayan / Tafseer Card */
.bayan-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.bayan-item-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bayan-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.bayan-kitab {
  font-weight: 700;
  color: var(--gold-hover);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bayan-source {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bayan-content-text {
  font-family: var(--font-dawat);
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-primary);
  direction: rtl;
  text-align: justify;
}

/* Cross-reference list */
.cross-ref-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cross-ref-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cross-ref-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.cross-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.cross-ref-badge {
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.cross-ref-content {
  font-family: var(--font-quran);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  direction: rtl;
}

/* Loading skeleton */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
}

.skeleton-line {
  height: 16px;
  background: var(--bg-card);
  border-radius: 4px;
  animation: pulse-skeleton 1.5s infinite ease-in-out;
}

@keyframes pulse-skeleton {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Responsive Progressive Navbar & Player Rules */
@media (max-width: 1380px) {
  .brand-subtitle {
    display: none;
  }
  #select-qari {
    max-width: 155px;
  }
  #select-pub {
    max-width: 140px;
  }
}

@media (max-width: 1180px) {
  #select-qari {
    max-width: 135px;
  }
  #select-pub {
    max-width: 125px;
  }
  #select-surah {
    max-width: 130px;
  }
  .dossier-nav-btn span {
    display: none;
  }
  .dossier-nav-btn {
    padding: 5px 9px;
    width: 34px;
    justify-content: center;
  }
}

@media (max-width: 960px) {
  .brand-title {
    display: none;
  }
  #select-pub {
    display: none;
  }
  .top-navbar {
    padding: 4px 8px;
    gap: 6px;
  }
}

@media (max-width: 768px) {
  .top-navbar {
    min-height: 48px;
    padding: 4px 8px;
    gap: 4px;
  }
  .brand-section {
    gap: 4px;
  }
  .brand-title, .brand-subtitle {
    display: none;
  }
  .page-nav-arrow {
    width: 32px;
    height: 44px;
    font-size: 1rem;
  }
  .mushaf-viewport {
    padding: 6px;
  }
  .bottom-player-bar {
    padding: 8px 12px;
  }
  .controls-row {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }
  .left-controls, .right-controls {
    justify-content: center;
    width: auto;
  }
  .center-controls {
    order: -1;
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
  }
  .play-btn {
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }
  .ayah-sidebar {
    width: 100vw;
    max-width: 100vw;
    z-index: 150;
  }
  .sidebar-header {
    padding: 12px 14px;
  }
  .sidebar-title {
    font-size: 1rem;
  }
  .ayah-arabic-text {
    font-size: 1.3rem;
    line-height: 2;
  }
  .bayan-content-text {
    font-family: var(--font-dawat);
    font-size: 1.15rem;
    line-height: 1.9;
  }
}
EOF

