/* ========================================
   AL-QUR'AN PAGE - SINGLE PAGE VIEW
   ======================================== */

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

:root {
  --bg-primary: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #064e3b;
  --text-secondary: #047857;
  --text-tertiary: #6b7280;
  --border-solid: #e2e8f0;
  --accent: #10b981;
  --accent-dark: #059669;
  --accent-soft: #d1fae5;
  --accent-mist: #ecfdf5;
  --arabic-gold: #2d5a3b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
}

body.dark {
  --bg-primary: linear-gradient(145deg, #0a0f1c 0%, #0f172a 100%);
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-tertiary: #9ca3af;
  --border-solid: #1f2a3e;
  --accent-soft: #1a3a2c;
  --accent-mist: #0b241b;
  --arabic-gold: #c8f0e0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ========================================
   QURAN CONTAINER (LIST VIEW)
   ======================================== */
.quran-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px 20px 80px;
}

/* Last Read Card */
.last-read-card {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-mist));
  border-radius: 24px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0.5px solid var(--border-solid);
  cursor: pointer;
  transition: all 0.2s ease;
}
.last-read-card:active { transform: scale(0.98); }
.last-read-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}
.last-read-info { flex: 1; }
.last-read-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: block;
}
.last-read-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.last-read-btn {
  background: var(--accent);
  border: none;
  padding: 8px 16px;
  border-radius: 40px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.last-read-btn:active { transform: scale(0.95); }

/* Welcome Card */
.welcome-card {
  background: linear-gradient(145deg, var(--accent-mist), var(--bg-primary));
  margin-bottom: 16px;
  padding: 22px 20px;
  border-radius: 32px;
  border: 0.5px solid var(--border-solid);
  text-align: center;
}
.welcome-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.welcome-card h1 span { color: var(--accent); }
.welcome-card p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Search Section */
.search-section { padding: 8px 0 12px; }
.search-container {
  background: var(--bg-secondary);
  border-radius: 44px;
  border: 1px solid var(--border-solid);
  display: flex;
  align-items: center;
  padding: 4px 8px 4px 20px;
}
.search-container i { color: var(--text-tertiary); }
.search-container input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 12px;
  font-size: 0.95rem;
  outline: none;
  color: var(--text-primary);
}
.clear-search {
  background: none;
  border: none;
  padding: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  display: none;
}

/* Surah List */
.surah-list { padding: 8px 0 20px; }
.surah-item {
  background: var(--bg-secondary);
  border-radius: 20px;
  margin-bottom: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0.5px solid var(--border-solid);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.surah-item:active { transform: scale(0.98); }
.surah-item.has-last-read {
  border-left: 4px solid var(--accent);
}
.last-read-badge {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 600;
}
.surah-num {
  width: 48px;
  height: 48px;
  background: var(--accent-soft);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-dark);
}
.surah-info { flex: 1; }
.surah-title {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  color: var(--text-primary);
}
.surah-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--arabic-gold);
  margin-top: 4px;
}
.surah-meta-badge {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 2px 10px;
  border-radius: 50px;
}

/* ========================================
   DETAIL VIEW (SINGLE PAGE)
   ======================================== */
.detail-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 480px;
  right: 0;
  margin: 0 auto;
  background: var(--bg-primary);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  overflow-y: auto;
}
.detail-view.open {
  transform: translateX(0);
}

/* Detail Header */
.detail-header {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-solid);
  z-index: 12;
}
.detail-back {
  background: var(--accent-soft);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 30px;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.2rem;
  transition: all 0.2s;
}
.detail-back:active { transform: scale(0.95); }
.detail-title {
  flex: 1;
  font-weight: 700;
  color: var(--text-primary);
}
.detail-bookmark {
  background: var(--accent-soft);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 30px;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.1rem;
  transition: all 0.2s;
}
.detail-bookmark.active {
  background: var(--accent);
  color: white;
}

/* Detail Content */
.detail-content {
  padding: 20px 20px 100px;
}
.surah-info-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-solid);
}
.surah-name-arabic {
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--arabic-gold);
  margin-bottom: 10px;
}
.surah-info-header h2 {
  font-size: 1.3rem;
  color: var(--text-primary);
}
.surah-info-header p {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Ayat Container */
.ayat-container {
  margin-bottom: 30px;
}
.ayat-block {
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 1.2rem;
  margin-bottom: 12px;
  border: 0.5px solid var(--border-solid);
  transition: all 0.2s;
  cursor: pointer;
}
.ayat-block:active { transform: scale(0.98); }
.ayat-block.last-read-ayat {
  border: 2px solid var(--accent);
  background: linear-gradient(145deg, var(--accent-mist), var(--bg-secondary));
  position: relative;
}
.ayat-block.last-read-ayat::before {
  content: 'Terakhir Baca';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 600;
}
.ayat-number {
  background: var(--accent-soft);
  width: 34px;
  height: 34px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent-dark);
}
.arabic-verse {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  line-height: 1.7;
  text-align: right;
  direction: rtl;
  color: var(--arabic-gold);
  margin: 10px 0 8px;
}
.translation-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 0.5px dashed var(--border-solid);
  padding-top: 10px;
  margin-top: 6px;
  line-height: 1.5;
}

/* Detail Navigation */
.detail-navigation {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-solid);
}
.nav-btn {
  flex: 1;
  background: var(--bg-tertiary);
  border: none;
  padding: 12px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav-btn:active { transform: scale(0.97); }
.nav-btn.primary {
  background: var(--accent);
  color: white;
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 30px;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 95;
  transition: all 0.2s;
}
.scroll-top-btn:active { transform: scale(0.95); }
.scroll-top-btn.show { display: flex; }

/* Responsive */
@media (max-width: 480px) {
  .arabic-verse { font-size: 1.3rem; }
  .surah-num { width: 40px; height: 40px; }
  .quran-container { padding: 16px 16px 80px; }
  .last-read-card { padding: 12px 14px; }
  .last-read-btn { padding: 6px 12px; font-size: 0.7rem; }
  .detail-navigation { flex-wrap: wrap; }
  .nav-btn { padding: 10px; font-size: 0.75rem; }
}