/**
 * Shared Learning Mode Styles
 *
 * Common styles for word-by-word learning pages (Dua, Hadith, etc.)
 * Each module defines --lm-* CSS variables on its container for theming.
 *
 * Required CSS variables (set on .[module]-learning-container):
 *   --lm-primary, --lm-secondary, --lm-gradient,
 *   --lm-text-dark, --lm-text-muted, --lm-bg-tint, --lm-bg-card,
 *   --lm-a06, --lm-a08, --lm-a10 (alpha overlays),
 *   --lm-b12, --lm-b15, --lm-b18 (borders),
 *   --lm-s25, --lm-s30, --lm-s35 (shadows),
 *   --lm-audio-shadow, --lm-audio-shadow-lg,
 *   --lm-ring-low, --lm-ring-mid, --lm-ring-high, --lm-ring-complete
 */

/* =============================================================================
 * List View
 * ============================================================================= */

.dua-learning-list,
.hadith-learning-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dua-learning-list-item,
.hadith-learning-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(145deg, #ffffff 0%, var(--lm-bg-tint) 100%);
  border: 1px solid var(--lm-b12);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dua-learning-list-item:hover,
.hadith-learning-list-item:hover {
  transform: translateX(4px);
  border-color: var(--lm-primary);
  box-shadow: 0 4px 16px var(--lm-b12);
}

.dua-learning-list-title,
.hadith-learning-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lm-text-dark);
  white-space: nowrap;
}

.dua-learning-list-preview,
.hadith-learning-list-preview {
  flex: 1;
  min-width: 0;
  font-family: 'Noto Naskh Arabic', 'Scheherazade New', serif;
  font-size: 1rem;
  color: var(--lm-text-muted);
  direction: rtl;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dua-learning-list-chevron,
.hadith-learning-list-chevron {
  color: var(--lm-secondary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.dua-learning-list-item:hover .dua-learning-list-chevron,
.hadith-learning-list-item:hover .hadith-learning-list-chevron {
  transform: translateX(4px);
}

/* List Progress Badge */
.dua-learning-list-progress,
.hadith-learning-list-progress {
  display: inline-flex;
  align-items: center;
  background: var(--lm-a10);
  color: var(--lm-primary);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.dua-learning-list-progress.complete,
.hadith-learning-list-progress.complete {
  background: var(--lm-gradient);
  color: white;
}

/* =============================================================================
 * Detail View
 * ============================================================================= */

.dua-learning-detail,
.hadith-learning-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dua-learning-occasion,
.hadith-learning-occasion {
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  background: var(--lm-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dua-learning-words-container,
.hadith-learning-words-container {
  background: linear-gradient(145deg, #ffffff 0%, var(--lm-bg-tint) 100%);
  border: 2px solid var(--lm-b15);
  border-radius: 20px;
  padding: 2rem;
}

.dua-learning-words,
.hadith-learning-words {
  font-family: 'Noto Naskh Arabic', 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: 2.2rem;
  line-height: 2.4;
  direction: rtl;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  color: var(--lm-text-dark);
}

.dua-learning-section,
.hadith-learning-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dua-learning-section-title,
.hadith-learning-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lm-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.dua-learning-audio-hint,
.hadith-learning-audio-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--lm-secondary);
  opacity: 0.8;
}

.dua-learning-audio-hint svg,
.hadith-learning-audio-hint svg {
  flex-shrink: 0;
}

.dua-learning-translation,
.hadith-learning-translation {
  background: var(--lm-a06);
  border-radius: 14px;
  padding: 1.25rem;
  font-size: 1.05rem;
  color: #333;
  line-height: 1.7;
}

.dua-learning-metadata,
.hadith-learning-metadata {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dua-learning-source-badge,
.hadith-learning-source-badge,
.hadith-learning-narrator-badge {
  display: inline-flex;
  align-items: center;
  background: var(--lm-a08);
  color: var(--lm-primary);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--lm-b15);
}

/* =============================================================================
 * Navigation (Prev / Next)
 * ============================================================================= */

.dua-learning-nav,
.hadith-learning-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
}

.dua-learning-nav-btn,
.hadith-learning-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--lm-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dua-learning-nav-btn:hover:not(:disabled),
.hadith-learning-nav-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px var(--lm-s35);
  transform: translateY(-2px);
}

.dua-learning-nav-btn:disabled,
.hadith-learning-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dua-learning-nav-btn svg,
.hadith-learning-nav-btn svg {
  flex-shrink: 0;
}

.dua-learning-counter,
.hadith-learning-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lm-primary);
}

/* =============================================================================
 * Audio Button
 * ============================================================================= */

.dua-learning-audio-btn,
.hadith-learning-audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--lm-gradient);
  color: white;
  cursor: pointer;
  margin: 1.5rem auto 0;
  box-shadow: var(--lm-audio-shadow);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dua-learning-audio-btn svg,
.hadith-learning-audio-btn svg {
  width: 24px;
  height: 24px;
}

.dua-learning-audio-btn:hover,
.hadith-learning-audio-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--lm-audio-shadow-lg);
}

/* =============================================================================
 * Tracker Card
 * ============================================================================= */

.dua-learning-tracker-card,
.hadith-learning-tracker-card {
  background: var(--lm-bg-card);
  border: 1px solid var(--lm-b12);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dua-learning-tracker-main,
.hadith-learning-tracker-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* --- Circular Progress --- */

.dua-learning-circular-progress,
.hadith-learning-circular-progress {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.dua-learning-circular-progress svg,
.hadith-learning-circular-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dua-learning-progress-bg,
.hadith-learning-progress-bg {
  fill: none;
  stroke: var(--lm-a10);
  stroke-width: 6;
}

.dua-learning-progress-ring,
.hadith-learning-progress-ring {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

/* Progress ring levels */
.dua-learning-circular-progress.progress-low .dua-learning-progress-ring,
.hadith-learning-circular-progress.progress-low .hadith-learning-progress-ring {
  stroke: var(--lm-ring-low);
}

.dua-learning-circular-progress.progress-mid .dua-learning-progress-ring,
.hadith-learning-circular-progress.progress-mid .hadith-learning-progress-ring {
  stroke: var(--lm-ring-mid);
}

.dua-learning-circular-progress.progress-high .dua-learning-progress-ring,
.hadith-learning-circular-progress.progress-high .hadith-learning-progress-ring {
  stroke: var(--lm-ring-high);
}

.dua-learning-circular-progress.progress-complete .dua-learning-progress-ring,
.hadith-learning-circular-progress.progress-complete .hadith-learning-progress-ring {
  stroke: var(--lm-ring-complete);
}

.dua-learning-circular-center,
.hadith-learning-circular-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.dua-learning-reps-count,
.hadith-learning-reps-count {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--lm-primary);
  line-height: 1;
}

.dua-learning-reps-separator,
.hadith-learning-reps-separator {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 400;
}

.dua-learning-reps-target,
.hadith-learning-reps-target {
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}

/* --- Tracker Info (right side) --- */

.dua-learning-tracker-info,
.hadith-learning-tracker-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.dua-learning-tracker-info-row,
.hadith-learning-tracker-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dua-learning-timer-badge,
.hadith-learning-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--lm-a08);
  color: var(--lm-primary);
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--lm-b12);
  font-variant-numeric: tabular-nums;
}

.dua-learning-timer-badge svg,
.hadith-learning-timer-badge svg {
  flex-shrink: 0;
}

.dua-learning-total-count,
.hadith-learning-total-count {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
  font-variant-numeric: tabular-nums;
}

/* --- Target Select --- */

.dua-learning-target-select-wrapper,
.hadith-learning-target-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--lm-text-muted);
}

.dua-learning-target-select,
.hadith-learning-target-select {
  width: 5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--lm-b18);
  border-radius: 8px;
  background: white;
  color: var(--lm-primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.dua-learning-target-select:focus,
.hadith-learning-target-select:focus {
  outline: 2px solid var(--lm-primary);
  outline-offset: 1px;
}

/* --- Repetition Section --- */

.dua-learning-rep-section,
.hadith-learning-rep-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.dua-learning-rep-label,
.hadith-learning-rep-label {
  font-size: 0.78rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.dua-learning-rep-buttons,
.hadith-learning-rep-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 360px;
}

.dua-learning-rep-btn,
.hadith-learning-rep-btn {
  flex: 1;
  max-width: 100px;
  padding: 0.65rem 0;
  border-radius: 12px;
  border: 1.5px solid var(--lm-b18);
  background: white;
  color: var(--lm-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.dua-learning-rep-btn:hover,
.hadith-learning-rep-btn:hover {
  background: var(--lm-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--lm-s25);
}

.dua-learning-rep-btn:active,
.hadith-learning-rep-btn:active {
  transform: translateY(0) scale(0.97);
}

/* --- Progress Bar --- */

.dua-learning-progress-bar,
.hadith-learning-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--lm-a08);
  border-radius: 3px;
  overflow: hidden;
}

.dua-learning-progress-fill,
.hadith-learning-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background 0.3s ease;
}

.dua-learning-progress-fill.progress-low,
.hadith-learning-progress-fill.progress-low {
  background: var(--lm-ring-low);
}

.dua-learning-progress-fill.progress-mid,
.hadith-learning-progress-fill.progress-mid {
  background: var(--lm-ring-mid);
}

.dua-learning-progress-fill.progress-high,
.hadith-learning-progress-fill.progress-high {
  background: var(--lm-ring-high);
}

.dua-learning-progress-fill.progress-complete,
.hadith-learning-progress-fill.progress-complete {
  background: var(--lm-gradient);
}

/* --- Completion Banner --- */

.dua-learning-complete-banner,
.hadith-learning-complete-banner {
  text-align: center;
  padding: 0.7rem 1.25rem;
  background: var(--lm-gradient);
  color: white;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--lm-s30);
  animation: lm-slideIn 0.4s ease;
}

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

/* =============================================================================
 * Learned Button & Badge
 * ============================================================================= */

.dua-learning-learned-btn,
.hadith-learning-learned-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid var(--lm-primary);
  border-radius: 10px;
  background: transparent;
  color: var(--lm-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dua-learning-learned-btn svg,
.hadith-learning-learned-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dua-learning-learned-btn:hover,
.hadith-learning-learned-btn:hover {
  background: var(--lm-a08);
}

.dua-learning-learned-btn.is-learned,
.hadith-learning-learned-btn.is-learned {
  background: var(--lm-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--lm-s30);
}

.dua-learning-learned-btn.is-learned:hover,
.hadith-learning-learned-btn.is-learned:hover {
  opacity: 0.9;
}

/* Learned badge in list view */
.dua-learning-list-learned-badge,
.hadith-learning-list-learned-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lm-gradient);
  color: white;
  flex-shrink: 0;
}

.dua-learning-list-learned-badge svg,
.hadith-learning-list-learned-badge svg {
  width: 14px;
  height: 14px;
}

/* =============================================================================
 * Responsive
 * ============================================================================= */

@media (max-width: 768px) {
  .dua-learning-words,
  .hadith-learning-words {
    font-size: 1.8rem;
    line-height: 2.2;
  }

  .dua-learning-words-container,
  .hadith-learning-words-container {
    padding: 1.5rem;
  }

  .dua-learning-occasion,
  .hadith-learning-occasion {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .dua-learning-tracker-card,
  .hadith-learning-tracker-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .dua-learning-tracker-main,
  .hadith-learning-tracker-main {
    gap: 1rem;
  }

  .dua-learning-circular-progress,
  .hadith-learning-circular-progress {
    width: 76px;
    height: 76px;
  }

  .dua-learning-reps-count,
  .hadith-learning-reps-count {
    font-size: 1.1rem;
  }

  .dua-learning-rep-btn,
  .hadith-learning-rep-btn {
    padding: 0.55rem 0;
    font-size: 0.9rem;
  }

  .dua-learning-complete-banner,
  .hadith-learning-complete-banner {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .dua-learning-words,
  .hadith-learning-words {
    font-size: 1.5rem;
    line-height: 2;
  }

  .dua-learning-words-container,
  .hadith-learning-words-container {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .dua-learning-list-item,
  .hadith-learning-list-item {
    padding: 1rem 1.25rem;
  }

  .dua-learning-nav-btn,
  .hadith-learning-nav-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }

  .dua-learning-translation,
  .hadith-learning-translation {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .dua-learning-learned-btn,
  .hadith-learning-learned-btn {
    font-size: 0.82rem;
    padding: 0.5rem 0.8rem;
  }
}

@media (max-width: 360px) {
  .dua-learning-words,
  .hadith-learning-words {
    font-size: 1.3rem;
    line-height: 1.9;
  }
}
