/* ========================================
   QURAN & KHATMAH STYLES
   ======================================== */

/* ===== CSS Variables ===== */
:root {
  --quran-primary: #1a8a5c;
  --quran-gold: #d4a847;
  --quran-gold-dark: #b8860b;
  --quran-bg: #faf6ee;
  --quran-text: #2c1810;
  --quran-border: #d4a847;
  --quran-shadow: rgba(0, 0, 0, 0.1);
  --quran-ornament: #8b6914;
  --quran-page-bg: #fffdf7;
  --quran-header-bg: linear-gradient(135deg, #2c5f3f 0%, #1a4a30 100%);
  --quran-font-size: 1.5rem;
  --quran-line-height: 2.4;
}

/* Dark mode overrides */
.dark-mode {
  --quran-bg: #1a1a2e;
  --quran-text: #e8dcc8;
  --quran-page-bg: #16213e;
  --quran-border: #8b6914;
  --quran-shadow: rgba(0, 0, 0, 0.3);
  --quran-ornament: #d4a847;
  --quran-header-bg: linear-gradient(135deg, #1a3a2a 0%, #0d2818 100%);
}

/* ===== Quran Category Card ===== */
.quran-category-card {
  background: linear-gradient(
    135deg,
    rgba(26, 138, 92, 0.95),
    rgba(44, 95, 63, 0.95)
  ) !important;
  color: white !important;
  position: relative;
  overflow: hidden;
}

.quran-category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d4a847, #b8860b, #d4a847) !important;
}

.quran-category-card::after {
  content: "﷽";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  opacity: 0.3;
  font-family: "Amiri", serif;
}

.quran-category-card .category-icon {
  color: #d4a847 !important;
}

.quran-category-card .category-title,
.quran-category-card .category-description {
  color: white !important;
}

.quran-category-card .category-count {
  background: rgba(212, 168, 71, 0.2) !important;
  color: #d4a847 !important;
}

.quran-category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(26, 138, 92, 0.3);
}

/* ===== Khatmah Setup Section ===== */
.khatmah-setup {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.khatmah-setup-header {
  text-align: center;
  margin-bottom: 2rem;
  color: white;
}

.khatmah-setup-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.khatmah-setup-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.khatmah-setup-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px var(--quran-shadow);
  position: relative;
  overflow: hidden;
}

.dark-mode .khatmah-setup-card {
  background: rgba(30, 30, 50, 0.95);
}

.khatmah-setup-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1a8a5c, #d4a847, #1a8a5c);
}

/* Goal Type Selection */
.goal-type-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.goal-type-btn {
  flex: 1;
  padding: 1.2rem;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-family: "Cairo", serif;
}

.dark-mode .goal-type-btn {
  background: #1a1a2e;
  border-color: #2d3748;
  color: #e8dcc8;
}

.goal-type-btn:hover {
  border-color: var(--quran-primary);
  transform: translateY(-2px);
}

.goal-type-btn.active {
  border-color: var(--quran-primary);
  background: rgba(26, 138, 92, 0.08);
  box-shadow: 0 4px 15px rgba(26, 138, 92, 0.2);
}

.dark-mode .goal-type-btn.active {
  background: rgba(26, 138, 92, 0.15);
}

.goal-type-btn i {
  font-size: 2rem;
  color: var(--quran-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.goal-type-btn .goal-label {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  display: block;
}

.dark-mode .goal-type-btn .goal-label {
  color: #e8dcc8;
}

.goal-type-btn .goal-desc {
  font-size: 0.8rem;
  color: #718096;
  margin-top: 4px;
  display: block;
}

/* Goal Value Input */
.goal-input-group {
  margin-bottom: 2rem;
}

.goal-input-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.8rem;
}

.dark-mode .goal-input-label {
  color: #e8dcc8;
}

.goal-input-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.goal-input-wrapper input[type="range"] {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--quran-primary), var(--quran-gold));
  border-radius: 4px;
  outline: none;
  direction: ltr;
}

.goal-input-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--quran-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 138, 92, 0.4);
  border: 3px solid white;
}

.goal-value-display {
  min-width: 80px;
  text-align: center;
  padding: 8px 12px;
  background: rgba(26, 138, 92, 0.1);
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--quran-primary);
}

/* Calculation Preview */
.calculation-preview {
  background: rgba(26, 138, 92, 0.05);
  border-radius: 15px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(26, 138, 92, 0.1);
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: #4a5568;
}

.dark-mode .calc-row {
  color: #a0aec0;
}

.calc-row:not(:last-child) {
  border-bottom: 1px dashed rgba(26, 138, 92, 0.15);
}

.calc-row .calc-value {
  font-weight: 700;
  color: var(--quran-primary);
  font-size: 1.05rem;
}

/* Number Input Row */
.goal-input-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.goal-number-input {
  width: 80px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: "Cairo", serif;
  color: var(--quran-primary);
  background: rgba(26, 138, 92, 0.08);
  border: 2px solid rgba(26, 138, 92, 0.3);
  border-radius: 12px;
  padding: 0.5rem;
  outline: none;
  transition: border-color 0.3s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.goal-number-input::-webkit-inner-spin-button,
.goal-number-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.goal-number-input:focus {
  border-color: var(--quran-primary);
  box-shadow: 0 0 0 3px rgba(26, 138, 92, 0.15);
}

.dark-mode .goal-number-input {
  background: rgba(26, 138, 92, 0.12);
  border-color: rgba(26, 138, 92, 0.4);
  color: #4fd1a5;
}

.goal-adjust-btn {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(26, 138, 92, 0.3);
  border-radius: 50%;
  background: white;
  color: var(--quran-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.goal-adjust-btn:hover {
  background: rgba(26, 138, 92, 0.1);
  border-color: var(--quran-primary);
  transform: scale(1.1);
}

.goal-adjust-btn:active {
  transform: scale(0.95);
}

.dark-mode .goal-adjust-btn {
  background: #1a1a2e;
  border-color: rgba(26, 138, 92, 0.4);
  color: #4fd1a5;
}

.goal-unit-label {
  font-size: 1rem;
  font-weight: 600;
  color: #718096;
  min-width: 40px;
}

.dark-mode .goal-unit-label {
  color: #a0aec0;
}

.goal-slider-wrapper {
  padding: 0 0.5rem;
}

.goal-slider-wrapper input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--quran-primary), var(--quran-gold));
  border-radius: 4px;
  outline: none;
  direction: ltr;
}

.goal-slider-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--quran-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 138, 92, 0.4);
  border: 3px solid white;
}

/* Juz Start Picker */
.juz-start-picker {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.juz-start-btn {
  flex-shrink: 0;
  padding: 0.7rem 1.2rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #4a5568;
  font-family: "Cairo", serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.juz-start-btn:hover {
  border-color: var(--quran-primary);
}

.juz-start-btn.active {
  border-color: var(--quran-primary);
  background: rgba(26, 138, 92, 0.1);
  color: var(--quran-primary);
}

.dark-mode .juz-start-btn {
  background: #1a1a2e;
  border-color: #2d3748;
  color: #a0aec0;
}

.dark-mode .juz-start-btn.active {
  border-color: var(--quran-primary);
  background: rgba(26, 138, 92, 0.15);
  color: #4fd1a5;
}

.juz-start-select-wrapper {
  flex: 1;
}

.juz-start-select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #4a5568;
  font-family: "Cairo", serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease;
  direction: rtl;
}

.juz-start-select:focus {
  border-color: var(--quran-primary);
}

.dark-mode .juz-start-select {
  background: #1a1a2e;
  border-color: #2d3748;
  color: #e8dcc8;
}

/* Start Button */
.khatmah-start-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #1a8a5c 0%, #0d6b4e 100%);
  color: white;
  font-family: "Cairo", serif;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(26, 138, 92, 0.3);
}

.khatmah-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 138, 92, 0.4);
}

/* Resume Button */
.khatmah-resume-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.dark-mode .khatmah-resume-section {
  border-top-color: #2d3748;
}

.khatmah-resume-section p {
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 0.8rem;
}

.khatmah-resume-btn {
  padding: 0.8rem 2rem;
  border: 2px solid var(--quran-gold-dark);
  border-radius: 12px;
  background: transparent;
  color: var(--quran-gold-dark);
  font-family: "Cairo", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.khatmah-resume-btn:hover {
  background: var(--quran-gold-dark);
  color: white;
}

/* ===== Khatmah Dashboard ===== */
.khatmah-dashboard {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.khatmah-dashboard-header {
  text-align: center;
  color: white;
  margin-bottom: 2rem;
}

.khatmah-dashboard-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Progress Ring */
.khatmah-progress-ring-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.progress-ring-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.progress-ring-svg {
  transform: rotate(-90deg);
  width: 200px;
  height: 200px;
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 12;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--quran-gold);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502.6;
  stroke-dashoffset: 502.6;
  transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
}

.progress-ring-percent {
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
  line-height: 1;
}

.progress-ring-label {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Dashboard Stats Grid */
.khatmah-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.khatmah-stat-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 4px 15px var(--quran-shadow);
}

.dark-mode .khatmah-stat-card {
  background: rgba(30, 30, 50, 0.95);
}

.khatmah-stat-card i {
  font-size: 1.5rem;
  color: var(--quran-primary);
  margin-bottom: 0.5rem;
}

.khatmah-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d3748;
  display: block;
}

.dark-mode .khatmah-stat-value {
  color: #e8dcc8;
}

.khatmah-stat-label {
  font-size: 0.8rem;
  color: #718096;
}

/* Dashboard Actions */
.khatmah-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.khatmah-read-btn {
  flex: 2;
  padding: 1rem;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #1a8a5c 0%, #0d6b4e 100%);
  color: white;
  font-family: "Cairo", serif;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(26, 138, 92, 0.3);
}

.khatmah-read-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 138, 92, 0.4);
}

.khatmah-reset-btn {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e53e3e;
  border-radius: 15px;
  background: transparent;
  color: #e53e3e;
  font-family: "Cairo", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.khatmah-reset-btn:hover {
  background: #e53e3e;
  color: white;
}

/* Today's Goal Card */
.today-goal-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px var(--quran-shadow);
  text-align: center;
}

.dark-mode .today-goal-card {
  background: rgba(30, 30, 50, 0.95);
}

.today-goal-card h4 {
  font-size: 1rem;
  color: #718096;
  margin-bottom: 0.8rem;
}

.today-goal-pages {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--quran-primary);
}

.today-goal-progress {
  margin-top: 1rem;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.dark-mode .today-goal-progress {
  background: #2d3748;
}

.today-goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--quran-primary), var(--quran-gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ===== Mushaf Viewer ===== */
.mushaf-viewer {
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem;
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* ===== NEW MUSHAF HEADER (Screenshot Style) ===== */
.mushaf-header {
  background: var(--quran-header-bg);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 15px 15px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  direction: rtl;
  position: relative;
}

.mushaf-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mushaf-back-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mushaf-back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mushaf-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Amiri", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--quran-gold);
  flex-shrink: 0;
  border: 1.5px solid rgba(212, 168, 71, 0.4);
}

.mushaf-header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.mushaf-surah-name {
  font-weight: 700;
  font-size: 1.15rem;
  font-family: "Amiri", serif;
  display: block;
  line-height: 1.3;
}

.mushaf-page-info {
  font-size: 0.78rem;
  opacity: 0.8;
  display: block;
  line-height: 1.2;
}

.mushaf-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mushaf-action-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mushaf-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mushaf-action-btn.bookmarked {
  color: var(--quran-gold);
  background: rgba(212, 168, 71, 0.25);
}

/* Settings Dropdown */
.mushaf-settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--quran-page-bg);
  border-radius: 14px;
  padding: 1rem;
  min-width: 240px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
  display: none;
  direction: rtl;
  border: 1px solid var(--quran-border);
}

.mushaf-settings-dropdown.show {
  display: block;
  animation: settingsSlideIn 0.2s ease;
}

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

.settings-section {
  margin-bottom: 1rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--quran-primary);
  margin-bottom: 0.5rem;
  display: block;
  font-family: "Cairo", serif;
}

.settings-font-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.settings-font-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--quran-border);
  border-radius: 8px;
  background: transparent;
  color: var(--quran-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-font-btn:hover {
  background: rgba(26, 138, 92, 0.1);
  border-color: var(--quran-primary);
}

.settings-font-size-label {
  font-size: 0.85rem;
  color: var(--quran-text);
  min-width: 50px;
  text-align: center;
  font-family: "Cairo", serif;
}

/* Page Jump in Settings */
.settings-page-jump {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-page-jump input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--quran-border);
  border-radius: 8px;
  background: transparent;
  color: var(--quran-text);
  font-family: "Cairo", serif;
  font-size: 0.9rem;
  text-align: center;
  outline: none;
  direction: ltr;
}

.settings-page-jump input:focus {
  border-color: var(--quran-primary);
}

.settings-page-jump-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--quran-primary);
  color: white;
  font-family: "Cairo", serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-page-jump-btn:hover {
  background: #157a4f;
}

/* Mushaf Page Container */
.mushaf-page-container {
  flex: 1;
  position: relative;
  background: var(--quran-page-bg);
  border-right: 4px solid var(--quran-border);
  border-left: 4px solid var(--quran-border);
  overflow: hidden;
}

/* Ornamental inner frame */
.mushaf-page-container::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(212, 168, 71, 0.25);
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}

/* Page Content */
.mushaf-page-content {
  padding: 1.5rem 1.2rem;
  min-height: 400px;
  font-family: "Amiri", serif;
  font-size: var(--quran-font-size);
  line-height: var(--quran-line-height);
  color: var(--quran-text);
  text-align: justify;
  direction: rtl;
  position: relative;
  z-index: 2;
  word-spacing: 2px;
}

/* Loading State */
.mushaf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--quran-text);
  gap: 1rem;
}

.mushaf-loading i {
  font-size: 2rem;
  color: var(--quran-primary);
}

.mushaf-loading p {
  font-size: 1rem;
  opacity: 0.7;
}

/* Error State */
.mushaf-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--quran-text);
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.mushaf-error i {
  font-size: 2rem;
  color: #e53e3e;
}

.mushaf-error-retry {
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  background: var(--quran-primary);
  color: white;
  font-family: "Cairo", serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Surah Header Ornament */
.surah-header-ornament {
  text-align: center;
  margin: 1rem 0 0.8rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(26, 138, 92, 0.08),
    rgba(212, 168, 71, 0.08)
  );
  border-radius: 30px;
  border: 1px solid rgba(212, 168, 71, 0.3);
  position: relative;
}

.surah-header-ornament::before,
.surah-header-ornament::after {
  content: "❋";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--quran-gold);
  font-size: 0.8rem;
  opacity: 0.6;
}

.surah-header-ornament::before {
  right: 12px;
}

.surah-header-ornament::after {
  left: 12px;
}

.surah-header-name {
  font-family: "Amiri", serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--quran-primary);
}

.dark-mode .surah-header-name {
  color: var(--quran-gold);
}

/* Bismillah */
.bismillah-text {
  text-align: center;
  font-family: "Amiri", serif;
  font-size: 1.3rem;
  color: var(--quran-text);
  margin: 0.5rem 0 1rem;
  opacity: 0.85;
}

/* Ayah Text */
.ayah-text {
  unicode-bidi: embed;
}

/* Ayah Number - Green Circle Style */
.ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: #4caf50;
  color: #fff;
  border-radius: 50%;
  font-family: "Cairo", serif;
  font-size: 0.6em;
  font-weight: 700;
  margin: 0 4px;
  vertical-align: middle;
  line-height: 1;
  direction: rtl;
  unicode-bidi: embed;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: 0;
  text-indent: 0;
}

.dark-mode .ayah-number {
  background: #388e3c;
  color: #e8e8e8;
}

/* Mushaf Page Footer */
.mushaf-page-footer {
  background: var(--quran-header-bg);
  border-radius: 0 0 15px 15px;
  overflow: hidden;
}

/* Navigation */
.mushaf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem;
}

.mushaf-nav-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-family: "Cairo", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mushaf-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.mushaf-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mushaf-nav-current {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

/* Progress Bar */
.mushaf-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.mushaf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--quran-primary), var(--quran-gold));
  transition: width 0.5s ease;
  border-radius: 3px;
}

/* Font Size Controls (now inside settings dropdown - old styles kept for compat) */
.mushaf-font-controls {
  display: none; /* hidden - moved to settings dropdown */
}

/* ===== Swipe Indicator ===== */
.swipe-indicator {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(26, 138, 92, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

.swipe-indicator.left {
  left: 10px;
}

.swipe-indicator.right {
  right: 10px;
}

.swipe-indicator.show {
  opacity: 1;
}

/* ===== Animations ===== */
@keyframes mushafPageIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mushaf-page-animate-in {
  animation: mushafPageIn 0.35s ease forwards;
}

.mushaf-slide-right {
  animation: slideFromRight 0.35s ease forwards;
}

.mushaf-slide-left {
  animation: slideFromLeft 0.35s ease forwards;
}

/* ===== Responsive Design (Mobile First) ===== */
@media (max-width: 480px) {
  .khatmah-setup-header h2 {
    font-size: 1.5rem;
  }

  .khatmah-setup-card {
    padding: 1.2rem;
    border-radius: 15px;
  }

  .goal-type-selector {
    flex-direction: column;
    gap: 0.8rem;
  }

  .goal-type-btn {
    padding: 1rem;
  }

  .goal-type-btn i {
    font-size: 1.5rem;
  }

  .mushaf-page-content {
    padding: 1rem 0.8rem;
    font-size: 1.25rem;
    line-height: 2.2;
  }

  .mushaf-header {
    padding: 0.5rem 0.7rem;
    gap: 0.4rem;
  }

  .mushaf-back-btn,
  .mushaf-action-btn {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .mushaf-header-logo {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .mushaf-surah-name {
    font-size: 1rem;
  }

  .mushaf-page-info {
    font-size: 0.7rem;
  }

  .mushaf-nav-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .khatmah-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .khatmah-stat-card {
    padding: 1rem;
  }

  .khatmah-actions {
    flex-direction: column;
  }

  .mushaf-settings-dropdown {
    min-width: 200px;
    left: -10px;
  }

  .ayah-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.55em;
  }

  .progress-ring-wrapper {
    width: 160px;
    height: 160px;
  }

  .progress-ring-svg {
    width: 160px;
    height: 160px;
  }

  .progress-ring-percent {
    font-size: 2rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .mushaf-page-content {
    font-size: 1.4rem;
    line-height: 2.3;
  }
}

@media (min-width: 769px) {
  .mushaf-page-content {
    padding: 2rem 2.5rem;
    font-size: 1.6rem;
  }

  .mushaf-viewer {
    max-width: 750px;
  }
}

/* ===== Khatmah Completion Modal ===== */
.khatmah-complete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.khatmah-complete-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  margin: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dark-mode .khatmah-complete-card {
  background: #1a1a2e;
}

.khatmah-complete-card .complete-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.khatmah-complete-card h3 {
  font-size: 1.8rem;
  color: var(--quran-primary);
  margin-bottom: 0.5rem;
}

.khatmah-complete-card p {
  color: #718096;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.khatmah-complete-card button {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 12px;
  background: var(--quran-primary);
  color: white;
  font-family: "Cairo", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Quick Read (No Khatmah) Button ===== */
.quick-read-btn {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: transparent;
  color: white;
  font-family: "Cairo", serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quick-read-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ───── Image-based Mushaf Page ───── */
.mushaf-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
  padding: 0;
}

.mushaf-page-image {
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

body.dark-mode .mushaf-page-image {
  filter: invert(0.88) hue-rotate(180deg);
}

/* ===== SURAH LIST STYLES ===== */

.surah-list-view {
  padding: 1rem 0;
  max-width: 600px;
  margin: 0 auto;
}

.surah-list-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.surah-list-header h2 {
  font-size: 1.4rem;
  color: var(--quran-primary);
  margin-bottom: 0.3rem;
  font-family: "Amiri", serif;
}

.surah-list-header h2 i {
  margin-left: 0.4rem;
}

.surah-list-header p {
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
}

.surah-bookmark-resume {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--quran-primary), #2c8a5c);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: "Cairo", sans-serif;
  margin-bottom: 1rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.surah-bookmark-resume:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 138, 92, 0.3);
}

.surah-bookmark-resume i:first-child {
  font-size: 1.1rem;
}

.surah-bookmark-resume span {
  flex: 1;
  text-align: right;
}

.surah-bookmark-resume i:last-child {
  font-size: 0.8rem;
  opacity: 0.7;
}

.surah-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.surah-list-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--quran-page-bg);
  border: 1px solid var(--quran-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Cairo", sans-serif;
  text-align: right;
}

.surah-list-card:hover {
  background: var(--quran-bg);
  transform: translateX(-3px);
  box-shadow: 0 2px 8px var(--quran-shadow);
}

.surah-list-card:active {
  transform: scale(0.98);
}

.surah-list-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: linear-gradient(
    135deg,
    var(--quran-gold),
    var(--quran-gold-dark)
  );
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: "Amiri", serif;
}

.surah-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.surah-list-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--quran-text);
  font-family: "Amiri", serif;
}

.surah-list-meta {
  font-size: 0.78rem;
  color: var(--text-secondary, #888);
}

.surah-list-arrow {
  color: var(--quran-gold);
  font-size: 0.75rem;
  opacity: 0.6;
}

.surah-list-back {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem;
  background: transparent;
  border: 1px solid var(--quran-border);
  border-radius: 10px;
  color: var(--quran-primary);
  font-size: 0.95rem;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.surah-list-back:hover {
  background: var(--quran-bg);
}

.surah-list-back i {
  margin-left: 0.4rem;
}

/* ===== WIRD CARD STYLES (Dashboard) ===== */

.wird-card {
  background: var(--quran-page-bg);
  border: 2px solid var(--quran-gold);
  border-radius: 16px;
  padding: 1.2rem;
  margin: 1rem 0;
  text-align: center;
}

.wird-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.wird-card-header h3 {
  font-size: 1.1rem;
  color: var(--quran-primary);
  font-family: "Cairo", sans-serif;
  margin: 0;
}

.wird-card-header h3 i {
  margin-left: 0.3rem;
}

.wird-badge {
  background: linear-gradient(
    135deg,
    var(--quran-gold),
    var(--quran-gold-dark)
  );
  color: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.wird-card-pages {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--quran-text);
  margin-bottom: 0.3rem;
  font-family: "Amiri", serif;
}

.wird-card-surahs {
  font-size: 0.85rem;
  color: var(--text-secondary, #888);
  margin-bottom: 0.8rem;
}

.wird-card-progress {
  margin-top: 0.5rem;
}

.wird-card-progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.wird-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--quran-primary), #2eb872);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.wird-card-progress-text {
  font-size: 0.82rem;
  color: var(--text-secondary, #888);
}

.wird-complete-badge {
  margin-top: 0.8rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
}

.wird-complete-badge i {
  margin-left: 0.3rem;
}

/* Khatmah Complete Card in Dashboard */
.khatmah-complete-card-dashboard {
  text-align: center;
  padding: 2rem 1rem;
  margin: 1rem 0;
  background: var(--quran-page-bg);
  border: 2px solid var(--quran-gold);
  border-radius: 16px;
}

.khatmah-complete-card-dashboard .complete-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.khatmah-complete-card-dashboard h3 {
  font-size: 1.3rem;
  color: var(--quran-primary);
  margin-bottom: 0.5rem;
}

.khatmah-complete-card-dashboard p {
  color: var(--text-secondary, #666);
  font-size: 0.95rem;
}

/* ===== WIRD BANNER (Mushaf Viewer) ===== */

.wird-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: linear-gradient(
    135deg,
    var(--quran-gold),
    var(--quran-gold-dark)
  );
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  margin: 0 0.5rem 0.5rem;
}

.wird-banner-label,
.wird-banner-pages {
  font-family: "Cairo", sans-serif;
}

/* ===== WIRD COMPLETE BUTTON (Mushaf Footer) ===== */

.wird-complete-btn {
  display: block;
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  animation: wirdCompleteGlow 2s ease-in-out infinite;
}

.wird-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.wird-complete-btn i {
  margin-left: 0.4rem;
}

@keyframes wirdCompleteGlow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
  }
}

/* ===== Dark Mode Overrides for New Components ===== */

.dark-mode .surah-list-card {
  background: var(--quran-page-bg);
  border-color: rgba(212, 168, 71, 0.3);
}

.dark-mode .surah-list-card:hover {
  background: var(--quran-bg);
}

.dark-mode .wird-card {
  background: var(--quran-page-bg);
  border-color: rgba(212, 168, 71, 0.5);
}

.dark-mode .wird-card-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .khatmah-complete-card-dashboard {
  background: var(--quran-page-bg);
  border-color: rgba(212, 168, 71, 0.5);
}

.dark-mode .surah-list-back {
  border-color: rgba(212, 168, 71, 0.3);
}
