/* === GOALS === */
.goal-card {
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--color-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.goal-card:hover {
  border-color: rgba(167, 139, 250, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

.goal-card.completed {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.05);
}

.goal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.goal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
}

.goal-category {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.goal-progress-wrap {
  margin-bottom: var(--space-3);
}

.goal-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-deadline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.priority-high {
  background: var(--color-accent-red);
}

.priority-medium {
  background: var(--color-accent-amber);
}

.priority-low {
  background: var(--color-accent-green);
}

/* =============================================
   LAMIM — SUNNAH MU'AKKADAH MODERNIZATION
   ============================================= */

/* Small Heading for Sunnah Mu'akkadah & Night Prayers */
[data-theme] div#section-nafl .nafl-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 18px;
  padding: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none;
}

[data-theme] div#section-nafl .nafl-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.4), rgba(168, 85, 247, 0.05));
  border-radius: 1px;
}

[data-theme] div#section-nafl .nafl-section-title-text {
  font-family: var(--font-display, 'Fraunces', Georgia, serif) !important;
  font-size: 14px;
  font-weight: 800;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #c084fc, #a855f7, #818cf8) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  padding: 0;
  white-space: nowrap;
}

[data-theme="light"] div#section-nafl .nafl-section-title::after {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.03));
}

[data-theme="light"] div#section-nafl .nafl-section-title-text {
  background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Stack Sunnah & Night Cards vertically exactly like Salah section */
div#nafl-sunnah-grid.nafl-grid,
div#nafl-night-grid.nafl-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

div#nafl-sunnah-grid .salah-prayer-card,
div#nafl-night-grid .salah-prayer-card {
  margin: 0;
  width: 100%;
  max-width: none;
}

/* Ensure 2-column grid for Prayed / Missed buttons */
div#nafl-sunnah-grid .salah-options-grid,
div#nafl-night-grid .salah-options-grid {
  display: grid;
  gap: 12px;
}

/* ==========================================================================
   SPIRITUAL JOURNEY MODAL (PREMIUM & UNIQUE DESIGN)
   ========================================================================== */

/* Overlay */
#nafl-history-modal.modal-overlay {
  background: rgba(2, 4, 8, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

/* Modal Container */
#nafl-history-modal .history-modal-content-container {
  background: linear-gradient(165deg, #091a18 0%, #030a09 100%);
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 40px rgba(20, 184, 166, 0.15);
  border-radius: 32px;
  padding: 28px;
  width: 92%;
  max-width: 440px;
  color: #fff;
  margin: auto;
  transition: all 0.3s ease;
}

/* Header */
#nafl-history-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0;
  border: none;
}

#nafl-history-modal .modal-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif) !important;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(135deg, #5eead4, #14b8a6, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.02em;
}

#nafl-history-modal .modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  padding: 0;
}

#nafl-history-modal .modal-close:hover {
  background: rgba(20, 184, 166, 0.2);
  color: #fff;
  border-color: rgba(20, 184, 166, 0.4);
  transform: scale(1.08);
}

/* Premium Summary Cards */
#nafl-history-modal .history-premium-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

#nafl-history-modal .h-summary-card {
  --dc: #14b8a6;
  position: relative;
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.1) 0%, rgba(20, 184, 166, 0.03) 100%);
  border: 1px solid color-mix(in srgb, var(--dc) 28%, rgba(255, 255, 255, 0.08));
  border-radius: 22px;
  padding: 16px 10px;
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  transition: all 0.25s ease;
}
#nafl-history-modal .h-summary-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--dc);
  opacity: 0.9;
}

#nafl-history-modal .h-summary-card:nth-child(1) { --dc: #14b8a6; }
#nafl-history-modal .h-summary-card:nth-child(2) { --dc: #2dd4bf; }
#nafl-history-modal .h-summary-card:nth-child(3) { --dc: #34d399; }

#nafl-history-modal .h-sum-val {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

#nafl-history-modal .h-sum-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* History List Header */
#nafl-history-modal .history-list-header {
  font-size: 12px;
  font-weight: 800;
  color: #2dd4bf;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#nafl-history-modal .history-list-header::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #14b8a6;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.8);
}

/* History List Scroll Area */
#nafl-history-modal .history-list-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

#nafl-history-modal .history-list-modern::-webkit-scrollbar {
  width: 5px;
}

#nafl-history-modal .history-list-modern::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

#nafl-history-modal .history-list-modern::-webkit-scrollbar-thumb {
  background: rgba(20, 184, 166, 0.35);
  border-radius: 3px;
}

#nafl-history-modal .history-list-modern::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 184, 166, 0.6);
}

/* History Items */
#nafl-history-modal .history-item-modern {
  --dc: #14b8a6;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3.5px solid var(--dc);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.25s ease;
}
#nafl-history-modal .history-item-modern:nth-child(3n+1) { --dc: #14b8a6; }
#nafl-history-modal .history-item-modern:nth-child(3n+2) { --dc: #2dd4bf; }
#nafl-history-modal .history-item-modern:nth-child(3n+3) { --dc: #34d399; }

#nafl-history-modal .history-item-modern:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(20, 184, 166, 0.35);
  transform: translateX(4px);
}

#nafl-history-modal .history-item-modern.all-missed {
  opacity: 0.7;
  background: rgba(248, 81, 73, 0.03);
  border-color: rgba(248, 81, 73, 0.15);
  border-left-color: #f85149;
}

#nafl-history-modal .h-item-date {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  min-width: 68px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  white-space: nowrap;
}

#nafl-history-modal .h-item-content {
  flex: 1;
}

#nafl-history-modal .h-item-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pills */
#nafl-history-modal .h-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.25);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #ccfbf1 !important;
}

#nafl-history-modal .h-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

#nafl-history-modal .h-pill.missed {
  background: rgba(248, 81, 73, 0.12);
  border-color: rgba(248, 81, 73, 0.25);
  color: #fca5a5 !important;
}

#nafl-history-modal .h-item-total {
  font-size: 20px;
  font-weight: 900;
  color: #5eead4;
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
}
#nafl-history-modal .h-item-total small {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

#nafl-history-modal .empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
}

/* Light mode — Crisp, Modern, High-Contrast Ultra-Clean Design */
[data-theme="light"] #nafl-history-modal .history-modal-content-container {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18), 0 4px 20px rgba(13, 148, 136, 0.08) !important;
  color: #0f172a !important;
}

[data-theme="light"] #nafl-history-modal .modal-title {
  background: linear-gradient(135deg, #0d9488, #10b981, #059669) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

[data-theme="light"] #nafl-history-modal .modal-close {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

[data-theme="light"] #nafl-history-modal .modal-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] #nafl-history-modal .h-summary-card {
  background: linear-gradient(180deg, #f0fdf4 0%, #e6fffa 100%) !important;
  border: 1px solid rgba(13, 148, 136, 0.18) !important;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.06) !important;
}

[data-theme="light"] #nafl-history-modal .h-sum-val {
  color: #0f766e !important;
}

[data-theme="light"] #nafl-history-modal .h-sum-label {
  color: #475569 !important;
}

[data-theme="light"] #nafl-history-modal .history-list-header {
  color: #0f766e !important;
}

[data-theme="light"] #nafl-history-modal .history-item-modern {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 3.5px solid var(--dc) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] #nafl-history-modal .history-item-modern:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] #nafl-history-modal .history-item-modern.all-missed {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  border-left-color: #ef4444 !important;
}

[data-theme="light"] #nafl-history-modal .h-item-date {
  color: #334155 !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
}

[data-theme="light"] #nafl-history-modal .h-pill {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: #047857 !important;
}

[data-theme="light"] #nafl-history-modal .h-pill.missed {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

[data-theme="light"] #nafl-history-modal .h-item-total {
  color: #047857 !important;
}

[data-theme="light"] #nafl-history-modal .h-item-total small {
  color: #64748b !important;
}

[data-theme="light"] #nafl-history-modal .empty-state {
  color: #64748b !important;
}

