*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Primary Palette — Deep Emerald */
  --primary: #0B4D3B;
  --primary-light: #E6F2EC;
  --primary-dark: #063A2A;
  --primary-muted: #1A7A5A;
  /* Gold Accents */
  --gold: #D4A843;
  --gold-light: #FDF6E3;
  --gold-dark: #9A7D2E;
  /* Text Palette */
  --text: #1a2a3a;
  --text-light: #3d4f5f;
  --text-muted: #5f6f7f;
  /* Surfaces */
  --bg: #F9F6F0;
  --white: #FFFFFF;
  --border: #E2DDD5;
  /* Elevation */
  --shadow: 0 2px 16px rgba(11, 77, 59, 0.06);
  --shadow-lg: 0 6px 32px rgba(11, 77, 59, 0.10);
  --shadow-glow: 0 0 20px rgba(212, 168, 67, 0.15);
  /* Radii */
  --radius: 16px;
  --radius-sm: 10px;
  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TYPOGRAPHY ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #FFFFFF;
  padding: 0.1rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

/* Islamic geometric pattern overlay */
.header-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(255, 255, 255, 0.5) 20px, rgba(255, 255, 255, 0.5) 21px),
    repeating-linear-gradient(60deg, transparent, transparent 20px, rgba(255, 255, 255, 0.5) 20px, rgba(255, 255, 255, 0.5) 21px),
    repeating-linear-gradient(120deg, transparent, transparent 20px, rgba(255, 255, 255, 0.5) 20px, rgba(255, 255, 255, 0.5) 21px);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-title {
  font-family: 'El Messiri', 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 2px 8px rgba(212, 168, 67, 0.3));
  animation: logoShimmer 4s ease-in-out infinite;
  cursor: pointer;
}

@keyframes logoShimmer {

  0%,
  100% {
    filter: drop-shadow(0 2px 8px rgba(212, 168, 67, 0.3));
  }

  50% {
    filter: drop-shadow(0 2px 14px rgba(212, 168, 67, 0.55));
  }
}

/* Gold accent line below header */
.header-gold-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
  z-index: 101;
}

/* ===== MAIN ===== */
main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem;
}

/* ===== JUZ SELECTOR ===== */
.juz-selector-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease);
}

.juz-selector-bar:hover {
  box-shadow: var(--shadow-lg);
}

.juz-nav-btn {
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.juz-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.08);
}

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

.juz-selector-display {
  flex: 1;
  text-align: center;
}

.juz-selector-label {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-weight: 700;
  font-size: 1.05rem;
  display: block;
  color: var(--text);
}

.juz-selector-range {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.1rem;
}

.juz-picker-btn {
  background: var(--primary-light);
  border: none;
  color: var(--primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}

.juz-picker-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.08);
}

/* ===== PROGRESS BAR ===== */
.juz-progress-container {
  max-width: 600px;
  margin: 0.75rem auto 0.5rem;
  padding: 0 1rem;
}

.juz-progress-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.juz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-muted), var(--gold));
  background-size: 200% 100%;
  border-radius: 20px;
  transition: width 0.8s var(--ease);
  animation: progressShimmer 3s ease infinite;
}

@keyframes progressShimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.juz-progress-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

/* ===== STAT PILLS ===== */
.stats-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.stat-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.5rem;
  box-shadow: 0 1px 6px rgba(11, 77, 59, 0.05);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease);
}

.stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-pill-icon {
  font-size: 1rem;
  color: var(--gold);
  display: flex;
  align-items: center;
}

.stat-pill-icon svg {
  stroke: var(--gold);
}

.stat-pill-label {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.72rem;
}

/* ===== THEME CHIPS ===== */
.themes-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.theme-chip {
  background: var(--gold-light);
  color: var(--gold-dark);
  padding: 0.22rem 0.65rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid rgba(212, 168, 67, 0.2);
  transition: all 0.2s var(--ease);
}

.theme-chip:hover {
  background: var(--gold);
  color: var(--white);
}

/* ===== UTILITY ===== */
.hidden {
  display: none !important;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'El Messiri', 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  transition: all 0.25s var(--ease);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-muted));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(11, 77, 59, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(11, 77, 59, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-next {
  flex: 1;
  min-width: 0;
}

/* ===== MOMENT CARD ===== */
.moment-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.5rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Islamic geometric corner accent */
.moment-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(225deg, var(--gold-light) 0%, transparent 60%);
  border-bottom-left-radius: 60px;
  opacity: 0.8;
  pointer-events: none;
}

.moment-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, var(--primary-light) 0%, transparent 60%);
  border-top-right-radius: 60px;
  opacity: 0.5;
  pointer-events: none;
}

/* ===== PLACEHOLDER ===== */
.moment-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  gap: 0.75rem;
  padding: 1rem 0;
  position: relative;
  z-index: 1;
}

.moment-placeholder-icon {
  font-size: 3rem;
  line-height: 1;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

.moment-placeholder h2 {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 700;
}

.moment-placeholder p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 320px;
}

/* ===== LOADING ===== */
.moment-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1rem;
  padding: 2rem 0;
}

.moment-loading p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: 'El Messiri', sans-serif;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== MOMENT CONTENT ===== */
.moment-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.moment-type-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-light), var(--gold-light));
  color: var(--primary);
  padding: 0.22rem 0.75rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(11, 77, 59, 0.1);
}

.moment-title {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.moment-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-light);
}

/* ===== VERSE SECTION ===== */
.verse-section {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  position: relative;
}

/* Decorative top border on verse sections */
.verse-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

.verse-section .verse-arabic {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 1.7rem;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.verse-section .verse-translation {
  font-style: italic;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--gold);
}

.verse-section .verse-ref {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold-dark);
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.35rem;
  border: 1px solid rgba(212, 168, 67, 0.2);
}

/* ===== INTERACTION ===== */
.interaction-section {
  margin-top: 0.5rem;
}

.challenge-question {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.context-text {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.scenario-text {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ===== WORD HIGHLIGHT ===== */
.word-highlight {
  text-align: center;
  margin-bottom: 1rem;
}

.word-arabic {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 2.6rem;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(11, 77, 59, 0.1);
}

.word-details {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.word-detail-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.22rem 0.65rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(11, 77, 59, 0.1);
}

/* ===== QUIZ OPTIONS ===== */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quiz-option {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  font-size: 0.88rem;
  text-align: left;
}

.quiz-option:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.quiz-option.incorrect {
  border-color: #D4574E;
  background: #FDF2F1;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.quiz-result {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.6;
}

.quiz-result.correct-result {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
}

.quiz-result.incorrect-result {
  background: #FDF2F1;
  color: #B03A33;
  border-left: 3px solid #D4574E;
}

/* ===== TAKEAWAY ===== */
.takeaway-box {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1rem;
  color: var(--primary-dark);
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.6;
}

.section-heading {
  font-family: 'El Messiri', sans-serif;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  font-size: 0.87rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.explanation-text {
  margin-bottom: 0.75rem;
}

/* ===== REFLECTION ===== */
.reflection-section {
  margin-top: 0.5rem;
}

.reflection-prompt-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  margin-bottom: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.reflection-prompt-item:hover {
  border-color: var(--primary);
  transform: translateX(3px);
}

.reflection-prompt-item.checked {
  background: var(--primary-light);
  border-color: var(--primary);
}

.reflection-prompt-item span {
  color: var(--text);
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1.5;
}

.reflection-check {
  margin-top: 0.15rem;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.journaling-prompt-text {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.reflection-textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  color: var(--text);
  background: var(--bg);
}

.reflection-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(11, 77, 59, 0.08);
}

.btn-save-reflection {
  display: block;
  margin-top: 0.75rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.25rem;
  font-family: 'El Messiri', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.btn-save-reflection:hover {
  background: linear-gradient(135deg, var(--gold-dark), #7A601E);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.25);
}

.btn-save-reflection.saved {
  background: var(--primary);
  cursor: default;
}

.moment-actions {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-share {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(11, 77, 59, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
  padding: 0;
}

.btn-share:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(11, 77, 59, 0.2);
}

.btn-share:active {
  transform: translateY(0);
}

.btn-share:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-share.share-generating {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== JUZ PICKER MODAL ===== */
.juz-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 58, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: overlayIn 0.25s var(--ease);
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.juz-picker-modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.25rem;
  animation: slideUp 0.3s var(--ease);
  box-shadow: 0 -8px 40px rgba(6, 58, 42, 0.15);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.juz-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.juz-picker-header h3 {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  transition: color 0.2s;
}

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

.juz-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}

.juz-picker-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.juz-picker-tile:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.06);
}

.juz-picker-tile.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(11, 77, 59, 0.15);
}

.juz-picker-tile.locked {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.juz-picker-tile .tile-studied {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.juz-picker-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.optional-notes .btn-save-reflection:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== SCROLLABLE VERSE WINDOW ===== */
.verse-scroll-container {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--border);
  position: relative;
}

.scroll-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem;
  font-weight: 600;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.verse-scroll-window {
  max-height: 400px;
  overflow-y: auto;
  scroll-behavior: smooth;
  border-radius: var(--radius);
  background: var(--bg);
  padding: 1rem;
  margin: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--bg);
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}

.verse-scroll-window::-webkit-scrollbar {
  width: 6px;
}

.verse-scroll-window::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.verse-scroll-window::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

.verse-scroll-window::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* ===== VERSE ITEMS ===== */
.verse-item {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--white);
  border-left: 3px solid var(--border);
  transition: all 0.3s var(--ease);
}

.verse-item:hover {
  border-left-color: var(--gold);
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

.verse-item:last-child {
  margin-bottom: 0;
}

.verse-item .verse-arabic {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 1.4rem;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.verse-item .verse-translation {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  font-style: italic;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
}

.verse-featured {
  border-left-color: var(--gold);
  background: var(--gold-light);
  box-shadow: var(--shadow-glow);
}

.verse-featured .verse-arabic {
  color: var(--primary-dark);
  font-size: 1.5rem;
}

.verse-featured .verse-translation {
  font-size: 0.95rem;
  color: var(--text);
}

.verse-item .verse-footer {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.verse-item .verse-ref {
  font-size: 0.8rem;
  color: var(--gold-dark);
  font-weight: 600;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.5s var(--ease);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== AUDIO CONTROLS ===== */
.verse-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.audio-btn {
  background: var(--primary-light);
  border: 1px solid rgba(11, 77, 59, 0.1);
  color: var(--primary);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.audio-btn:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-1px);
}

.audio-btn.playing {
  background: var(--primary);
  color: var(--white);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.word-audio-btn {
  margin: 0.75rem auto;
  display: flex;
}

/* ===== CONTEMPLATION ===== */
.contemplation-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.contemplation-item {
  background: var(--bg);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: all 0.3s var(--ease);
}

.contemplation-label {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.6;
}

.contemplation-label.checked {
  opacity: 0.6;
}

.contemplation-label.checked .contemplation-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.contemplation-check {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.contemplation-text {
  color: var(--text);
  font-weight: 500;
}

/* ===== PAUSE TIMER ===== */
.pause-timer-btn {
  background: var(--gold-light);
  border: 2px solid var(--gold);
  color: var(--gold-dark);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.pause-timer-btn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-1px);
}

.pause-timer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.pause-timer-btn.timer-active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  animation: timerPulse 1s ease-in-out infinite;
}

.pause-timer-btn.timer-complete {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

@keyframes timerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.timer-text {
  font-variant-numeric: tabular-nums;
}

/* ===== OPTIONAL NOTES ===== */
.optional-notes {
  margin-top: 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  background: var(--white);
}

.optional-notes summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: 'El Messiri', sans-serif;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}

.optional-notes summary::-webkit-details-marker {
  display: none;
}

.optional-notes summary:hover {
  background: var(--primary-light);
}

.optional-notes[open] summary {
  border-bottom: 2px dashed var(--border);
  background: var(--primary-light);
}

.optional-notes .journaling-prompt-text {
  padding: 1rem 1rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}

.optional-notes .reflection-textarea {
  margin: 0.5rem 1rem;
  width: calc(100% - 2rem);
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
}

.optional-notes .reflection-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.optional-notes .btn-save-reflection {
  margin: 0 1rem 1rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.optional-notes .btn-save-reflection:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  header {
    padding: 1rem;
  }

  .header-content h1 {
    font-size: 1.35rem;
  }

  .header-arabic {
    font-size: 1rem;
  }

  .logo svg {
    width: 36px;
    height: 36px;
  }

  main {
    padding: 0.5rem;
  }

  .moment-card {
    padding: 1.25rem 1rem;
  }

  .juz-picker-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .stat-pill {
    padding: 0.4rem;
    font-size: 0.75rem;
  }

  .verse-section .verse-arabic {
    font-size: 1.4rem;
  }

  .moment-card::before,
  .moment-card::after {
    width: 40px;
    height: 40px;
  }

  /* Bug report mobile optimizations */
  .bug-report-content {
    max-height: 80vh;
    width: 95vw;
  }

  .bug-report-body {
    padding: 0.75rem 1rem 1rem;
    gap: 0.6rem;
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-header h2 {
    font-size: 1.15rem;
  }

  .bug-textarea {
    min-height: 80px;
    max-height: 80px;
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .bug-screenshot-preview {
    max-height: 100px;
    min-height: 60px;
  }

  .bug-screenshot-img {
    max-height: 100px;
  }

  .bug-screenshot-loading {
    padding: 0.75rem;
    font-size: 0.75rem;
  }

  .bug-label {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }

  .bug-submit-btn {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .bug-nub {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    bottom: 15px;
    right: 15px;
  }
}

/* ===== INTERACTION DIVERSIFICATION ===== */

/* 1. Verse Spotlight - Hidden Translation */
.verse-translation-hidden {
  filter: blur(8px);
  user-select: none;
  opacity: 0.6;
  transition: all 0.8s ease-out;
  position: relative;
}

.verse-translation-hidden::after {
  content: "Answer to reveal translation";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  filter: blur(0);
}

.verse-translation-revealed {
  filter: blur(0);
  opacity: 1;
  user-select: text;
}

.verse-translation-revealed::after {
  display: none;
}

/* 2. Historical Context - Grid Cards */
.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.quiz-option-card {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
  font-weight: 500;
  color: var(--text);
  min-height: 100px;
}

.quiz-option-card:hover:not(.disabled) {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-color: var(--gold);
}

/* Story Reveal Animation */
.story-reveal {
  margin-top: 1.5rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border-left: 4px solid var(--gold);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: all 0.5s ease-out;
}

.story-reveal-animate {
  max-height: 500px;
  opacity: 1;
  margin-top: 1.5rem;
}

.story-insight {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.story-matters {
  font-size: 0.9rem;
  color: var(--text-light);
  border-top: 1px dashed rgba(11, 77, 59, 0.2);
  padding-top: 0.75rem;
}

/* 3. Quick Quiz - Hint System */
.hint-btn {
  display: block;
  margin: 1rem auto 0;
  background: transparent;
  border: 1px dashed var(--gold);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.hint-btn:hover:not(:disabled) {
  background: var(--gold-light);
  color: var(--gold-dark);
  border-style: solid;
}

.hint-btn:disabled {
  border-color: transparent;
  color: var(--gold);
  cursor: default;
  opacity: 0.8;
}

.quiz-option.eliminated {
  opacity: 0.4;
  text-decoration: line-through;
  pointer-events: none;
  background: var(--bg);
  border-color: transparent;
}

/* 4. Life Lesson - Think First */
.think-first-section {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.scenario-box {
  background: var(--white);
  border-left: 3px solid var(--gold);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: var(--text-light);
}

.think-first-prompt {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.think-first-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.think-first-input:focus {
  outline: none;
  border-color: var(--primary);
}

.think-first-reveal-btn {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.think-first-reveal-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.life-lesson-options {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}

.life-lesson-options.options-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Poll & Social Features */
.poll-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(16, 185, 129, 0.15);
  /* Emerald tint */
  width: 0%;
  transition: width 1s ease-out;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
}

.quiz-option {
  position: relative;
  overflow: hidden;
}

.poll-pct {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--emerald-700);
  z-index: 1;
}

.takeaway-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-card);
  border-left: 3px solid var(--emerald-500);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-secondary);
  animation: fadeIn 0.5s ease-out;
}

.takeaway-box p {
  margin-bottom: 0.5rem;
}

.takeaway-box p:last-child {
  margin-bottom: 0;
}

/* Share Card Styles */
.share-card-container {
  z-index: -1;
  pointer-events: none;
}

.share-card {
  width: 1080px;
  height: 1080px;
  background: radial-gradient(circle at center, #065F46 0%, #064E3B 100%);
  padding: 80px;
  display: flex;
  flex-direction: column;
  color: white;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  border: 40px solid transparent;
  border-image: linear-gradient(to bottom, #d97706, #fbbf24, #d97706) 1;
}

/* Subtle Geometric Pattern Overlay */
.share-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(#fbbf24 0.5px, transparent 0.5px);
  background-size: 40px 40px;
  opacity: 0.05;
  pointer-events: none;
}

.share-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  z-index: 2;
}

.share-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.share-logo {
  font-size: 80px;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.share-app-name {
  font-family: 'El Messiri', serif;
  font-size: 56px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 2px;
}

.share-ref {
  font-size: 36px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  letter-spacing: 1px;
}

.share-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.share-arabic {
  font-family: 'Scheherazade New', serif;
  font-size: 110px;
  line-height: 1.8;
  text-align: center;
  color: #FFFFFF;
  direction: rtl;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(251, 191, 36, 0.2);
  margin: 0;
}

.share-footer {
  text-align: center;
  margin-top: 40px;
  z-index: 2;
}

.share-link {
  font-size: 32px;
  color: #fbbf24;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 0.9;
}

.share-divider {
  display: none;
}

.share-insight {
  display: none;
}

.share-footer {
  margin-top: 60px;
  text-align: center;
}

.share-link {
  font-size: 28px;
  color: #94a3b8;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Enhanced Reflections */
.gratitude-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 1.5rem 0;
}

.gratitude-input,
.dua-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.gratitude-input:focus,
.dua-input:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--surface-card);
}

.dua-generator {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 1.5rem 0;
}

.dua-result {
  margin-top: 1rem;
  background: var(--surface-hover);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  animation: fadeIn 0.5s ease;
}

.dua-text {
  font-family: 'Scheherazade New', serif;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-style: italic;
}

.mood-slider-container {
  margin: 2rem 0;
  text-align: center;
}

.mood-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 8px;
  background: var(--surface-hover);
  border-radius: 4px;
  outline: none;
  margin-bottom: 1rem;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.mood-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.mood-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mood-value {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ===== MODAL OVERLAY ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 58, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.2s var(--ease);
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.3s var(--ease);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: 'El Messiri', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* ===== BUG REPORT NUB ===== */
.bug-nub {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(11, 77, 59, 0.7);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bug-nub:hover {
  background: rgba(11, 77, 59, 0.9);
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(11, 77, 59, 0.4);
}

/* ===== BUG REPORT MODAL ===== */
.bug-report-content {
  max-width: 500px;
  width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bug-report-body {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.bug-screenshot-preview {
  width: 100%;
  max-height: 120px;
  min-height: 80px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bug-screenshot-loading {
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
}

.bug-screenshot-img {
  width: 100%;
  height: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.bug-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: block;
}

.bug-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  min-height: 100px;
  max-height: 100px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s var(--ease);
  flex-shrink: 0;
}

.bug-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(11, 77, 59, 0.1);
}

.bug-char-count {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.bug-submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.bug-submit-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.bug-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bug-status {
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.bug-status-success {
  background: #E6F2EC;
  color: #0B4D3B;
}

.bug-status-error {
  background: #FFE6E6;
  color: #D32F2F;
}

.quiz-option-text {
  position: relative;
  z-index: 2;
}

.header-logo-img {
  object-fit: contain;
  width: 44px;
  height: 44px;
}

/* ===== PROFILE MODAL ===== */
.profile-modal-content {
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.profile-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.profile-stat-card {
  background: var(--surface-hover);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Inter', sans-serif;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.soul-mirror-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid var(--emerald-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.soul-mirror-section h3 {
  font-family: 'El Messiri', sans-serif;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mirror-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.refresh-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0.5;
  margin-left: 8px;
}

.refresh-btn:hover {
  opacity: 1;
  background: rgba(16, 185, 129, 0.1);
  transform: rotate(180deg);
}

/* Word Cloud Tags */
.theme-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.theme-tag {
  background: var(--white);
  border: 1px solid var(--emerald-200);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: popIn 0.3s ease-out backwards;
}

.theme-tag:nth-child(2n) {
  animation-delay: 0.1s;
}

.theme-tag:nth-child(3n) {
  animation-delay: 0.2s;
}

/* Insight Card */
.insight-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--gold);
  text-align: left;
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.insight-icon {
  font-size: 1.5rem;
}

.insight-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(16, 185, 129, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.privacy-note {
  text-align: center;
  opacity: 0.7;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Premium Icon Button */
.icon-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

.icon-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  transition: all 0.2s ease;
}

.icon-btn:hover svg {
  stroke-width: 2.2;
  /* Slightly bolder on hover */
}

/* Specific button tweaks for Profile (Gold/Amber) */
#profile-btn:hover {
  color: #B45309 !important;
  /* Amber-700 */
  background: #FEF3C7 !important;
  /* Amber-100 */
  border-color: #FCD34D !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  /* Gold glow */
}

/* Specific button tweaks for Juz Picker (Emerald) */
#juz-picker-btn:hover {
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
}

/* ===== FONT SIZE CONTROLS ===== */
.icon-btn-sm {
  font-size: 0.75rem;
  font-weight: 700;
  height: 30px;
  min-width: 30px;
  padding: 0 0.35rem;
  letter-spacing: -0.5px;
}

html.font-size-1 {
  font-size: 14px;
}

html.font-size-2 {
  font-size: 16px;
}

html.font-size-3 {
  font-size: 18px;
}

html.font-size-4 {
  font-size: 20px;
}

html.font-size-5 {
  font-size: 22px;
}

/* ===== DARK MODE ===== */
html.dark-mode {
  --primary: #10B981;
  --primary-light: #1a2e26;
  --primary-dark: #0d9668;
  --primary-muted: #34d399;
  --gold: #FBBF24;
  --gold-light: #2a2515;
  --gold-dark: #D97706;
  --text: #E8E8E8;
  --text-light: #B0B8C4;
  --text-muted: #8A96A3;
  --bg: #121212;
  --white: #1E1E1E;
  --border: #333333;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 6px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.15);
}

html.dark-mode body {
  background: var(--bg);
  color: var(--text);
}

html.dark-mode header {
  background: linear-gradient(145deg, #0d3325, #091f18);
  color: #FFFFFF;
}

html.dark-mode .moment-card,
html.dark-mode .juz-selector-bar,
html.dark-mode .stats-bar .stat-pill,
html.dark-mode .juz-picker-modal,
html.dark-mode .modal-content {
  background: var(--white);
  border-color: var(--border);
}

html.dark-mode .verse-section {
  background: #1a2820;
  border-color: #2a3d32;
}

html.dark-mode .verse-ref-badge {
  background: #1a2e26;
  color: var(--primary);
  border-color: #2a3d32;
}

html.dark-mode .option-btn {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

html.dark-mode .option-btn:hover {
  background: #252525;
  border-color: var(--primary);
}

html.dark-mode .btn-primary {
  background: var(--primary);
  color: #fff;
}

html.dark-mode .themes-bar .theme-pill {
  background: #1a2e26;
  color: var(--primary);
  border-color: #2a3d32;
}

html.dark-mode .moment-type-badge {
  background: #1a2e26;
  color: var(--primary);
}

html.dark-mode .explanation-text,
html.dark-mode .context-text {
  color: var(--text-light);
}

html.dark-mode .insight-card {
  background: #1a2820;
  border-color: #2a3d32;
}

html.dark-mode .profile-stat-card {
  background: #252525;
  border-color: var(--border);
}

html.dark-mode .juz-progress-bar-bg {
  background: #252525;
}

html.dark-mode .icon-btn {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .icon-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

html.dark-mode #dark-mode-btn svg {
  fill: var(--gold);
  stroke: var(--gold);
}

html.dark-mode .soul-mirror-section {
  background: linear-gradient(135deg, #1a2e26, #152420);
  border-color: #2a3d32;
}

html.dark-mode .soul-mirror-section h3 {
  color: var(--primary);
}

html.dark-mode .mirror-subtitle {
  color: var(--text-muted);
}

html.dark-mode .theme-tag {
  background: #252525;
  border-color: var(--border);
  color: var(--primary);
}

html.dark-mode .profile-body {
  color: var(--text);
}

html.dark-mode .stat-label {
  color: var(--text-muted);
}

html.dark-mode .profile-modal-content {
  background: var(--white);
  border-color: var(--border);
}

html.dark-mode .juz-tile {
  background: #252525;
  border-color: var(--border);
  color: var(--text);
}

html.dark-mode .juz-tile.unlocked:hover {
  background: #1a2e26;
  border-color: var(--primary);
}

html.dark-mode .juz-tile.current {
  background: #1a2e26;
  border-color: var(--primary);
}

html.dark-mode .reflection-prompt-item {
  background: #252525;
  border-color: var(--border);
}

html.dark-mode .journaling-textarea {
  background: #252525;
  border-color: var(--border);
  color: var(--text);
}

html.dark-mode .privacy-note {
  color: var(--text-muted);
}

/* Ensure responsiveness */
@media (max-width: 600px) {
  .header-actions {
    gap: 0.2rem;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
  }

  .profile-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 1000;
  animation: slideUpBanner 0.4s var(--ease);
}

@keyframes slideUpBanner {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pwa-install-banner.hidden {
  display: none;
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.pwa-install-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-install-text strong {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-text span {
  font-size: 0.78rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.pwa-install-btn:hover {
  background: var(--primary-dark);
}

.pwa-dismiss-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.pwa-dismiss-btn:hover {
  color: var(--text);
}

/* Saved Duas Modal Override */
#saved-duas-modal .modal-content {
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#saved-duas-full-list {
  overflow-y: auto;
  flex: 1;
  padding-right: 5px;
}

.dua-detail-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.external-link-btn {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.external-link-btn:hover {
  color: var(--primary);
}

/* Duas List Styles (Global) */
.saved-duas-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* Removed max-height here as it is controlled by modal container or preview limit */
}

.dua-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.dua-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.dua-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.dua-card-preview {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== BOOKMARK STYLES ===== */

/* Bookmark button in header */
#bookmark-btn {
  position: relative;
}

#bookmark-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--gold);
  color: var(--primary-dark);
  font-size: 0.6rem;
  font-weight: bold;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Bookmark modal */
.bookmarks-content {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.bookmarks-section {
  margin-bottom: 2rem;
}

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

.bookmarks-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bookmarks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bookmarks-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-subtext {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Bookmark card */
.bookmark-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.bookmark-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.bookmark-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.bookmark-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  flex: 1;
}

.bookmark-remove-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.bookmark-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bookmark-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.bookmark-card-type {
  background: rgba(11, 77, 59, 0.1);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: capitalize;
}

.bookmark-card-juz {
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.bookmark-card-date {
  opacity: 0.7;
}

.bookmark-card-preview {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bookmark button in moment actions */
.btn-bookmark {
  background: rgba(212, 168, 67, 0.1) !important;
  color: var(--gold-dark) !important;
  border: 1px solid rgba(212, 168, 67, 0.3) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-bookmark:hover {
  background: rgba(212, 168, 67, 0.2) !important;
}

.btn-bookmark.bookmarked {
  background: rgba(212, 168, 67, 0.2) !important;
  color: var(--gold-dark) !important;
  border-color: var(--gold) !important;
}

/* Dark mode adjustments */
.dark-mode .bookmark-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .bookmark-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .bookmark-card-type {
  background: rgba(11, 77, 59, 0.3);
}

.dark-mode .bookmark-card-juz {
  background: rgba(212, 168, 67, 0.2);
}

/* Profile sections */
.profile-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.heartbeat-graph {
  min-height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}