/* =============================================================================
   Salat Module (Pendant la Priere)
   Theme: Pastel Yellow / Amber
   Reuses: learning-shared.css, flashcardDashboard.css, dua.css patterns
   ============================================================================= */

:root {
  --salat-primary: #b8860b;
  --salat-primary-light: #d4a017;
  --salat-primary-dark: #8b6914;
  --salat-accent: #c49000;
  --salat-bg: #fdf6e3;
  --salat-card-bg: #ffffff;
}

/* =============================================================================
   Back Buttons — amber override (all salat sections)
   ============================================================================= */

#salat .back-btn-nav,
#salat-review .back-btn-nav,
#salat-learning .back-btn-nav {
  --back-btn-bg: var(--salat-primary);
  --back-btn-hover: var(--salat-primary-dark);
}

#salat .back-btn-nav:hover,
#salat-review .back-btn-nav:hover,
#salat-learning .back-btn-nav:hover {
  background: var(--back-btn-hover);
}

/* =============================================================================
   Landing Page — Header (same pattern as hadith)
   ============================================================================= */

#salat .tabs-nav.tome-header,
#salat-learning .tabs-nav.tome-header,
#salat-review .tabs-nav.tome-header {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(212, 160, 23, 0.1));
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 20px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}

#salat .arabic-learning-title,
#salat-learning .arabic-learning-title,
#salat-review .arabic-learning-title {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#salat .salat-landing-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

#salat .salat-landing-icon svg {
  width: 40px;
  height: 40px;
  color: var(--salat-primary);
}

/* Tabs — color overrides only (layout from dua-landing-tab-btn base) */
.salat-landing-tabs {
  border-bottom-color: rgba(184, 134, 11, 0.15);
}

.salat-landing-tab-btn {
  color: #a07d1c;
  border-color: rgba(184, 134, 11, 0.12);
  background: rgba(184, 134, 11, 0.08);
}

.salat-landing-tab-btn:hover {
  color: var(--salat-primary);
  background: rgba(184, 134, 11, 0.15);
  border-color: rgba(184, 134, 11, 0.2);
}

.salat-landing-tab-btn.active {
  color: var(--salat-primary);
  border-color: rgba(184, 134, 11, 0.15);
  border-bottom: 2px solid white;
}

/* Stats theme variables — pastel yellow/amber */
.salat-landing-stats {
  --stats-primary: #b8860b;
  --stats-secondary: #d4a017;
  --stats-text-muted: #a07d1c;
  --stats-text-dark: #8b6914;
  --stats-border-rgb: 184, 134, 11;
  --stats-bg-card: linear-gradient(145deg, #ffffff, #fdf8ef);
  --stats-gradient: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

/* Choice Grid (Revision + Learning cards) */
#salat-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0.5rem 0;
}

.salat-choice-card {
  background: linear-gradient(145deg, #ffffff 0%, #fdf8ef 100%);
  border: 2px solid rgba(184, 134, 11, 0.15);
  border-radius: 20px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.salat-choice-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(184, 134, 11, 0.18),
              0 4px 12px rgba(184, 134, 11, 0.08);
  border-color: var(--salat-primary);
}

.salat-choice-card .dua-choice-icon {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  margin-bottom: 0.75rem;
}

.salat-choice-card:hover .dua-choice-icon {
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.35);
}

.salat-choice-card .dua-choice-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.salat-choice-card .dua-choice-desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #666);
}

/* =============================================================================
   Statistics
   ============================================================================= */

.salat-stats-card {
  border-left: 3px solid var(--salat-primary);
}

.salat-stats-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #666);
}

.salat-stats-error {
  text-align: center;
  padding: 2rem;
  color: var(--error-color, #f44336);
}

/* =============================================================================
   Review Page — Amber Theme Override (pattern from hadith.css #hadith-nawawi)
   ============================================================================= */

/* Page Header */
.salat-page-header {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(212, 160, 23, 0.1));
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .dua-title {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tabs nav */
#salat-review .tabs-nav {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(212, 160, 23, 0.1));
  border: 1px solid rgba(184, 134, 11, 0.1);
}

/* Tab buttons — HTML uses dua-tab-btn class */
#salat-review .dua-tab-btn:hover {
  color: var(--salat-primary);
}

#salat-review .dua-tab-btn.active {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
}

#salat-review .dua-tab-btn.active::before {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

/* KPI Cards */
#salat-review .kpi-card {
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .kpi-card::before {
  background: radial-gradient(circle at 50% 50%, rgba(184, 134, 11, 0.15), rgba(212, 160, 23, 0.05));
}

#salat-review .kpi-card:hover {
  border-color: rgba(184, 134, 11, 0.2);
}

#salat-review .kpi-value {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#salat-review .kpi-icon {
  color: var(--salat-primary) !important;
}

/* Tooltips */
#salat-review .tooltip-trigger {
  background: var(--salat-primary);
}

#salat-review .tooltip-trigger:hover {
  background: var(--salat-primary-light);
}

#salat-review .tooltip-content {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

#salat-review .tooltip-content::after {
  border-bottom-color: var(--salat-primary);
}

/* Heatmap & Grid Sections */
#salat-review .heatmap-section,
#salat-review .names-grid-section,
#salat-review .names-grid-fixed-section {
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .heatmap-section h3,
#salat-review .names-grid-section h3,
#salat-review .names-grid-fixed-section h3 {
  color: var(--salat-primary);
}

#salat-review .names-grid {
  background: rgba(184, 134, 11, 0.05);
}

#salat-review .names-grid-legend {
  background: rgba(184, 134, 11, 0.05);
}

/* Grid status cells — amber palette */
#salat-review .name-grid-cell.good {
  background-color: #d4a017;
}

#salat-review .name-grid-cell.strong {
  background-color: #b8860b;
  color: #fff;
}

#salat-review .color-dot.good {
  background-color: #d4a017;
}

#salat-review .color-dot.strong {
  background-color: #b8860b;
}

/* Buttons */
#salat-review .btn-primary,
#salat-review .btn-start-review {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%) !important;
  box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4) !important;
}

#salat-review .btn-primary:hover,
#salat-review .btn-start-review:hover {
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%) !important;
  box-shadow: 0 12px 40px rgba(184, 134, 11, 0.5) !important;
}

/* Settings Button — needs !important to override base gradient */
#salat-review .config-icon-toggle {
  background: rgba(184, 134, 11, 0.15) !important;
  border: 1px solid rgba(184, 134, 11, 0.3) !important;
  color: var(--salat-primary) !important;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.4) !important;
}

#salat-review .config-icon-toggle:hover {
  background: rgba(184, 134, 11, 0.25) !important;
  border-color: rgba(184, 134, 11, 0.4) !important;
  color: var(--salat-primary-dark) !important;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.5) !important;
}

#salat-review .config-icon-toggle svg {
  stroke: var(--salat-primary) !important;
}

/* Language selector */
#salat-review .flashcard-lang-btn.active {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.25), rgba(184, 134, 11, 0.25));
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.4);
}

#salat-review .flashcard-lang-selector {
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.15);
}

/* Direction selector */
#salat-review .direction-selector input[type="radio"]:hover {
  border-color: var(--salat-primary);
}

#salat-review .direction-selector input[type="radio"]:checked {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  border-color: var(--salat-primary);
  box-shadow: 0 8px 20px rgba(184, 134, 11, 0.4);
}

#salat-review .direction-selector input[type="radio"]:checked ~ span {
  color: var(--salat-primary);
}

#salat-review .direction-selector label:has(input[type="radio"]:checked) {
  background: rgba(184, 134, 11, 0.15);
  border-color: rgba(184, 134, 11, 0.3);
}

#salat-review .direction-selector label {
  background: rgba(184, 134, 11, 0.05);
}

#salat-review .direction-selector label:hover {
  background: rgba(184, 134, 11, 0.12);
}

/* Success Modal */
#salat-review .success-modal {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

#salat-review .success-modal-btn.primary {
  color: var(--salat-primary);
}

/* Rating buttons — amber palette */
#salat-review .rating-btn.strong {
  background: #8b6914;
}

#salat-review .rating-btn.good {
  background: #b8860b;
}

/* Accordion */
#salat-review .accordion-item {
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .accordion-header {
  background: rgba(184, 134, 11, 0.05);
}

#salat-review .accordion-header:hover {
  background: rgba(184, 134, 11, 0.1);
}

#salat-review .accordion-chevron {
  color: var(--salat-primary);
}

#salat-review .accordion-title {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

#salat-review .accordion-icon svg {
  stroke: var(--salat-primary) !important;
}

/* Section Titles — Gold Gradient */
#salat-review .kpi-cards-section h3,
#salat-review .objectives-section h3,
#salat-review .names-grid-fixed-section h3,
#salat-review .section-title,
#salat-review .dashboard-section-title {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Objectives section */
#salat-review .kpi-cards-section,
#salat-review .objectives-section {
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .objective-fill {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

#salat-review .progress-fill {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

/* Review Info Bar */
#salat-review .review-info-bar {
  background: rgba(184, 134, 11, 0.05);
  border: 1px solid rgba(184, 134, 11, 0.1);
}

#salat-review .last-review-label,
#salat-review .due-count-label {
  color: var(--salat-primary) !important;
}

#salat-review .last-review-value,
#salat-review .last-review-value strong,
#salat-review .review-info-bar strong,
#salat-last-review-time {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Study Time Widget */
#salat-review .study-time-accordion .accordion-title,
#salat-review [data-accordion="study-time"] .accordion-title {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#salat-review .study-time-stat-icon svg {
  stroke: var(--salat-primary);
}

#salat-review .study-time-stat-value {
  color: var(--salat-primary);
}

#salat-review .study-time-chart-bar {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
}

#salat-review .study-time-bar-fill,
#salat-review .study-time-bar.is-today .study-time-bar-fill {
  background: linear-gradient(180deg, #b8860b 0%, #d4a017 100%);
}

#salat-review .study-time-toggle-btn.active {
  background: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  color: white;
}

#salat-review .study-time-toggle-btn:not(.active) {
  color: var(--salat-primary);
}

#salat-review .study-time-toggle-btn:not(.active):hover {
  background: rgba(184, 134, 11, 0.1);
}

/* Session Limit Config */
#salat-review .session-limit-radio-option:hover {
  border-color: var(--salat-primary-light);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
}

#salat-review .session-limit-radio-option.active {
  border-color: var(--salat-primary);
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(212, 160, 23, 0.05));
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

#salat-review .radio-label {
  color: var(--salat-primary);
}

#salat-review .custom-input-wrapper input[type="number"]:focus,
#salat-review .custom-session-input:focus {
  border-color: var(--salat-primary);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

#salat-review .custom-input-wrapper button,
#salat-review .save-custom-btn {
  background: linear-gradient(135deg, #b8860b, #d4a017);
}

#salat-review .custom-input-wrapper button:hover,
#salat-review .save-custom-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b6914, #b8860b);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

/* Flashcard */
#salat-review .flashcard-text {
  box-shadow: 0 12px 40px rgba(184, 134, 11, 0.5),
              0 0 60px rgba(184, 134, 11, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#salat-review .flashcard-text::before {
  background: radial-gradient(circle, rgba(184, 134, 11, 0.08) 0%, transparent 70%);
}

/* =============================================================================
   Learning Page
   ============================================================================= */

.salat-learning-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;

  --lm-primary: #b8860b;
  --lm-secondary: #d4a017;
  --lm-gradient: linear-gradient(135deg, #b8860b 0%, #d4a017 100%);
  --lm-text-dark: #6b5200;
  --lm-text-muted: #9a7d2e;
  --lm-bg-tint: #fdf8ef;
  --lm-bg-card: linear-gradient(135deg, rgba(184, 134, 11, 0.04) 0%, rgba(212, 160, 23, 0.06) 100%);
  --lm-a06: rgba(184, 134, 11, 0.06);
  --lm-a08: rgba(184, 134, 11, 0.08);
  --lm-a10: rgba(184, 134, 11, 0.1);
  --lm-b12: rgba(184, 134, 11, 0.12);
  --lm-b15: rgba(184, 134, 11, 0.15);
  --lm-b18: rgba(184, 134, 11, 0.18);
  --lm-s25: rgba(184, 134, 11, 0.25);
  --lm-s30: rgba(184, 134, 11, 0.3);
  --lm-s35: rgba(184, 134, 11, 0.35);
  --lm-audio-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
  --lm-audio-shadow-lg: 0 6px 20px rgba(184, 134, 11, 0.35);
  --lm-ring-low: #f5d76e;
  --lm-ring-mid: #d4a017;
  --lm-ring-high: #b8860b;
  --lm-ring-complete: #8b6914;
}

.salat-word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 1.6rem;
  line-height: 2.2;
  display: inline-block;
  position: relative;
}

.salat-word::before {
  content: '';
  position: absolute;
  top: 0.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b8860b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'/%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 1;
}

.salat-word:hover {
  background: rgba(184, 134, 11, 0.1);
}

.salat-word.salat-word-active {
  background: var(--lm-gradient);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.salat-word.salat-word-playing {
  background: rgba(184, 134, 11, 0.15);
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.25);
}

/* Audio - Salat-specific animation */
.salat-learning-audio-btn.playing {
  animation: salat-audio-pulse 1s ease-in-out infinite;
}

@keyframes salat-audio-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25); }
  50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(184, 134, 11, 0.35); }
}

/* =============================================================================
   Learned Button & Badge — amber override (base uses hardcoded green)
   ============================================================================= */

.salat-learning-learned-btn {
  color: var(--salat-primary);
}

.salat-learning-learned-btn svg {
  border-color: var(--salat-primary);
}

.salat-learning-learned-btn:hover svg {
  background: rgba(184, 134, 11, 0.1);
}

.salat-learning-learned-btn.is-learned svg {
  background: var(--salat-primary);
  border-color: var(--salat-primary);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.salat-learning-learned-btn.is-learned {
  color: var(--salat-primary);
}

.salat-learning-list-learned-badge {
  background: var(--salat-primary);
  box-shadow: 0 1px 3px rgba(184, 134, 11, 0.3);
}

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

@media (max-width: 480px) {
  #salat-choice-grid {
    grid-template-columns: 1fr;
  }

  .salat-word {
    font-size: 1.4rem;
    line-height: 2;
  }
}
