/* Font faces */
@font-face {
  font-family: 'UthmanicHafs';
  src: url('/assets/fonts/UthmanicHafs1Ver09.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'amha';
  src: url('/assets/fonts/AbyssinicaSIL-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'surah-name-v4';
  src: url('/assets/fonts/surah-name-v4.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #10B981;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* Dark mode select styling */
.dark select option {
  background-color: #1f2937 !important;
  color: white !important;
}

/* Animation */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  outline: none;
}
.dark input[type="range"] {
  background: #374151;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10B981;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Arabic font - Uthmanic Hafs for Quran text */
.font-arabic {
  font-family: 'UthmanicHafs', 'Traditional Arabic', serif;
}

/* Amharic font - Abyssinica SIL for translation text */
.font-amharic {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
}

/* Default Arabic text styling */
.arabic {
  font-family: 'UthmanicHafs', 'Traditional Arabic', serif;
  font-size: 1.75rem;
  font-weight: bold;
}

/* Default Amharic text styling */
.amharic {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
  font-size: 1.5rem;
}

/* Surah grid: Arabic name (right side) */
.grid-arabic {
  font-family: 'surah-name-v4', 'UthmanicHafs', 'Traditional Arabic', serif;
  font-size: 2.5rem;
  line-height: 1;
}

/* Reading page surah name */
.reading-surah-name {
  font-family: 'surah-name-v4', 'UthmanicHafs', 'Traditional Arabic', serif;
  font-size: 3.5rem;
  line-height: 1;
}

/* Reading page: Amharic surah name */
.reading-surah-name-amh {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
  font-size: 1.4rem;
  font-weight: bold;
  color: #6b7280;
  line-height: 1;
  vertical-align: middle;
}

/* Reading page: surah meaning subtitle */
.reading-surah-meaning {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
  font-size: 0.75rem;
  color: #c0c0c0;
  line-height: 1.2;
  margin-top: 0.1rem;
}

/* Reading page: ayah Arabic text */
.ayah-arabic-text {
  font-family: 'UthmanicHafs', 'Traditional Arabic', serif;
  font-size: 23px;
}

/* Reading page: ayah translation text */
.ayah-trans-text {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
  font-size: 21px;
}

/* ============= CLASSIC PAPER MODE ============= */
#reading-container.reading-paper-mode {
  background-color: #f4ecd8 !important;
  color: #1f2937 !important;
}
#reading-container.reading-paper-mode .ayah-arabic-text {
  color: #1f2937 !important;
}
#reading-container.reading-paper-mode .ayah-trans-text {
  color: #374151 !important;
}
#reading-container.reading-paper-mode .border-b,
#reading-container.reading-paper-mode .border-gray-100,
#reading-container.reading-paper-mode .border-gray-200 {
  border-color: #d4c5a0 !important;
}
#reading-container.reading-paper-mode .bg-gray-50,
#reading-container.reading-paper-mode .bg-gray-100 {
  background-color: #e8dcc4 !important;
}
#reading-container.reading-paper-mode .text-gray-400 {
  color: #8b7d5e !important;
}
#reading-container.reading-paper-mode .text-gray-500 {
  color: #7a6d50 !important;
}
#reading-container.reading-paper-mode .text-gray-600 {
  color: #5c5038 !important;
}
#reading-container.reading-paper-mode .text-gray-700 {
  color: #374151 !important;
}
#reading-container.reading-paper-mode .text-slate-400,
#reading-container.reading-paper-mode .text-slate-500 {
  color: #7a6d50 !important;
}
#reading-container.reading-paper-mode .bg-slate-50 {
  background-color: #e8dcc4 !important;
}
#reading-container.reading-paper-mode .rounded-full {
  background-color: #e8dcc4 !important;
  color: #5c5038 !important;
}
#reading-container.reading-paper-mode .sticky {
  background-color: #f4ecd8 !important;
  border-bottom-color: #d4c5a0 !important;
}

/* Highlight in paper mode */
#reading-container.reading-paper-mode .bg-green-50 {
  background-color: #d4c5a0 !important;
}

/* ============= BLOG ARTICLE WRAPPER ============= */
.blog-article {
  background: #fefce8;
}
.dark .blog-article {
  background: rgba(31, 41, 55, 0.7);
}

/* ============= BLOG CONTENT TYPOGRAPHY ============= */
.blog-content p {
  margin-bottom: 1.3em;
  line-height: 1.85;
  font-size: 1.05rem;
  color: #374151;
}
.dark .blog-content p {
  color: #d1d5db;
}

.blog-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 2em;
  margin-bottom: 0.6em;
  color: #1f2937;
  letter-spacing: -0.01em;
}
.dark .blog-content h2 {
  color: #f3f4f6;
}

.blog-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #374151;
}
.dark .blog-content h3 {
  color: #e5e7eb;
}

.blog-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  color: #4b5563;
}
.dark .blog-content h4 {
  color: #d1d5db;
}

.blog-content strong {
  font-weight: 700;
}

.blog-content em {
  font-style: italic;
}

.blog-content ul,
.blog-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

.blog-content li {
  margin-bottom: 0.4em;
  line-height: 1.7;
}

.blog-content blockquote {
  border-left: 4px solid #f59e0b;
  padding: 0.8em 1.2em;
  margin: 1.5em 0;
  background: #fefce8;
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: #4b5563;
}
.dark .blog-content blockquote {
  background: rgba(31, 41, 55, 0.5);
  color: #d1d5db;
  border-left-color: #f59e0b;
}

.blog-content a {
  color: #d97706;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-content a:hover {
  color: #b45309;
}
.dark .blog-content a {
  color: #fbbf24;
}
.dark .blog-content a:hover {
  color: #fcd34d;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5em 0;
}

/* ============= VERSE BLOCK IN BLOG ============= */
.verse-block {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-right: 4px solid #10B981;
  direction: ltr;
}
.dark .verse-block {
  background: #064e3b20;
  border-color: #065f4630;
}

.verse-block .verse-arabic {
  font-family: 'UthmanicHafs', 'Traditional Arabic', serif;
  font-size: 1.3rem;
  line-height: 2;
  text-align: right;
  direction: rtl;
  color: #1f2937;
  margin-bottom: 0.5rem;
}
.dark .verse-block .verse-arabic {
  color: #f3f4f6;
}

.verse-block .verse-translation {
  font-family: 'amha', 'AbyssinicaSIL', 'Noto Sans Ethiopic', 'Ethiopic', serif;
  font-size: 1.1rem;
  line-height: 1.7;
  text-align: left;
  direction: ltr;
  color: #374151;
}
.dark .verse-block .verse-translation {
  color: #d1d5db;
}

.verse-block .verse-ref {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #d1d5db;
  font-weight: 600;
}
.dark .verse-block .verse-ref {
  color: #6b7280;
  border-top-color: #374151;
}

.verse-block .verse-ayah-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #10B981;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 0.4rem;
  flex-shrink: 0;
}
.dark .verse-block .verse-ayah-num {
  background: #059669;
}

/* ============= RESPONSIVE: MOBILE ============= */
@media (max-width: 640px) {
  .ayah-arabic-text {
    font-size: 20px;
    line-height: 1.9 !important;
  }
  .ayah-trans-text {
    font-size: 18px;
  }
  #reading-container .sticky {
    padding-left: 12px;
    padding-right: 12px;
  }
  #reading-container .max-w-4xl {
    padding-left: 12px;
    padding-right: 12px;
  }
  #settings-panel {
    right: 8px !important;
    width: calc(100% - 16px) !important;
    max-width: 320px !important;
  }
  .ayah-detail-modal-content {
    margin: 8px;
    max-height: 90vh;
    overflow-y: auto;
  }
}
