/* Custom Quran Experience Styling */

/* Font Family Classes */
.font-cairo {
  font-family: 'Cairo', sans-serif;
}

.font-amiri {
  font-family: 'Amiri', serif;
}

.font-quran {
  font-family: 'Amiri Quran', 'Amiri', serif;
}

/* ========================================================= */
/* --- TAJWEED AUTOMATIC COLORING SYSTEM (مصحف التجويد) --- */
/* ========================================================= */

/* 1. المدود (المتصل، المنفصل، اللازم - ٤ إلى ٦ حركات) - أحمر قرمزي */
.tajweed-madd {
  color: #dc2626;
  display: inline;
  font-weight: 700;
  text-shadow: 0 0 1px rgba(220, 38, 38, 0.2);
}

.dark .tajweed-madd {
  color: #f87171;
  text-shadow: 0 0 2px rgba(248, 113, 113, 0.4);
}

/* 2. الغنة والإخفاء والإدغام بغنة - أخضر زمردي نضر */
.tajweed-ghunnah {
  color: #059669;
  display: inline;
  font-weight: 700;
  text-shadow: 0 0 1px rgba(5, 150, 105, 0.2);
}

.dark .tajweed-ghunnah {
  color: #34d399;
  text-shadow: 0 0 2px rgba(52, 211, 153, 0.4);
}

/* 3. القلقلة (قطبجد ساكنة) - أزرق سماوي صافٍ */
.tajweed-qalqalah {
  color: #0284c7;
  display: inline;
  font-weight: 700;
  text-shadow: 0 0 1px rgba(2, 132, 199, 0.2);
}

.dark .tajweed-qalqalah {
  color: #38bdf8;
  text-shadow: 0 0 2px rgba(56, 189, 248, 0.4);
}

/* 4. الإقلاب (قلب النون أو التنوين ميماً مخفاة) - تركوازي / فيروزي */
.tajweed-iqlab {
  color: #0d9488;
  display: inline;
  font-weight: 700;
}

.dark .tajweed-iqlab {
  color: #2dd4bf;
}

/* 5. الحروف التي لا تنطق (صلة الوصل، الإدغام الكامل) - رمادي خافت */
.tajweed-silent {
  color: #94a3b8 !important;
  display: inline;
  opacity: 0.72;
}

.dark .tajweed-silent {
  color: #64748b !important;
  opacity: 0.65;
}

/* Uthmani Quranic Verse Numbers Motif */
.ayah-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: 'Amiri', serif;
  font-size: 0.8em;
  color: #9E7830;
  vertical-align: middle;
  margin: 0 4px;
  cursor: pointer;
  padding: 0 2px;
  user-select: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.ayah-num-badge:hover {
  transform: scale(1.15);
  color: #C5A059;
}

/* Audio Waveform Animation for Recitation with Reading */
@keyframes wave1 {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}
@keyframes wave2 {
  0%, 100% { height: 12px; }
  50% { height: 6px; }
}
@keyframes wave3 {
  0%, 100% { height: 6px; }
  50% { height: 14px; }
}
.animate-wave-1 { animation: wave1 0.8s ease-in-out infinite; }
.animate-wave-2 { animation: wave2 0.7s ease-in-out infinite 0.2s; }
.animate-wave-3 { animation: wave3 0.9s ease-in-out infinite 0.4s; }

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Islamic ornamental bracket representation around numbers */
.ayah-symbol {
  font-family: 'Amiri Quran', 'Amiri', serif;
  color: #C5A059;
  font-size: 1.15em;
  margin-right: 2px;
  margin-left: 2px;
}

/* Active Reciting Verse Highlight */
.mushaf-ayah {
  border-radius: 8px;
  padding: 2px 4px;
  margin: 0 2px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

/* Offline & Download Badges */
.badge-downloaded {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.dark .badge-downloaded {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Toast styling types */
.toast-success {
  background-color: rgba(16, 185, 129, 0.95);
  border-color: rgba(5, 150, 105, 0.4);
  color: #ffffff;
}

.toast-info {
  background-color: rgba(30, 41, 59, 0.95);
  border-color: rgba(197, 160, 89, 0.4);
  color: #ffffff;
}

.toast-error {
  background-color: rgba(220, 38, 38, 0.95);
  border-color: rgba(185, 28, 28, 0.4);
  color: #ffffff;
}

.mushaf-ayah:hover {
  background-color: rgba(197, 160, 89, 0.12);
}

.mushaf-ayah.is-active {
  background-color: rgba(197, 160, 89, 0.28) !important;
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.45);
  border-radius: 8px;
}

.dark .mushaf-ayah.is-active {
  background-color: rgba(197, 160, 89, 0.35) !important;
  box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.6);
}

/* Smooth continuous Mushaf paragraph layout */
.mushaf-continuous {
  font-family: 'Amiri Quran', 'Amiri', serif;
  text-align: justify;
  text-justify: inter-word;
  word-spacing: 2px;
}

/* Islamic decorative border for the top banner */
.islamic-border {
  background-image: radial-gradient(#C5A059 0.75px, transparent 0.75px);
  background-size: 12px 12px;
}

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

.animate-fadeIn {
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom scrollbar for Quran reading */
#quranViewport::-webkit-scrollbar,
#surahListContainer::-webkit-scrollbar,
#tafsirContentArea::-webkit-scrollbar,
#downloadsListContainer::-webkit-scrollbar,
#modalTajweedGuide::-webkit-scrollbar {
  width: 6px;
}

#quranViewport::-webkit-scrollbar-thumb,
#surahListContainer::-webkit-scrollbar-thumb,
#tafsirContentArea::-webkit-scrollbar-thumb,
#downloadsListContainer::-webkit-scrollbar-thumb,
#modalTajweedGuide::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.35);
  border-radius: 10px;
}

#quranViewport::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 160, 89, 0.7);
}

/* Touch and active state responsiveness */
button:active {
  -webkit-tap-highlight-color: transparent;
}