/* ==================== المتغيرات ==================== */
:root {
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --primary-dark: #1042a3;
  --bg: #f0f3f8;
  --bg-card: #ffffff;
  --bg-header: linear-gradient(135deg, #1a56db 0%, #0f3a8a 100%);
  --text: #1a2438;
  --text-secondary: #5a6882;
  --text-on-primary: #ffffff;
  --border: #d8dfeb;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --font-body: 'Noto Kufi Arabic', sans-serif;
  --font-azkar: 'Amiri', serif;
  --font-size-base: 16px;
  --transition: 0.3s ease;
  --completed-bg: #e8f0fe;
  --completed-border: #3b82f6;
  --progress-bg: #e0e0e0;
  --progress-fill: linear-gradient(90deg, #1a56db, #3b82f6);
  --tab-bg: #e8edf5;
  --tab-active: #ffffff;
  --modal-overlay: rgba(0, 0, 0, 0.5);
  --toast-bg: #323232;
}

/* الوضع الليلي */
[data-theme="dark"] {
  --bg: #0f1420;
  --bg-card: #1a2236;
  --bg-header: linear-gradient(135deg, #0f3a8a 0%, #091d4a 100%);
  --text: #e0e8f5;
  --text-secondary: #8fa2bf;
  --border: #2a3654;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.3);
  --completed-bg: #1a2a4d;
  --completed-border: #2563eb;
  --progress-bg: #2a3654;
  --tab-bg: #1a2236;
  --tab-active: #2a3f6e;
  --modal-overlay: rgba(0, 0, 0, 0.7);
}

/* ==================== الأساسيات ==================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden {
  display: none !important;
}

/* ==================== الهيدر ==================== */
.header {
  background: var(--bg-header);
  color: var(--text-on-primary);
  padding: 28px 0 20px;
  position: sticky;
  top: 0;
  z-index: 150;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.header-row-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.header-actions-right,
.header-actions-left {
  display: flex;
  gap: 6px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
  border-radius: 8px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ==================== مودال تحميل التطبيق ==================== */
.app-modal {
  text-align: center;
  padding: 32px 24px 24px;
  max-width: 420px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-modal-logo-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-modal-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.app-modal-subtitle {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.app-modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.app-modal-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.app-modal-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text);
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.app-modal-feature i {
  color: var(--primary);
  font-size: 0.8rem;
}

.app-modal-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.app-store-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: #fff;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.app-store-btn.ios {
  background: #000;
}

.app-store-btn.android {
  background: #3ddc84;
  color: #1a1a1a;
}

.app-store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-store-btn i {
  font-size: 1.4rem;
}

.app-store-btn div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.app-store-small {
  font-size: 0.6rem;
  opacity: 0.8;
}

.app-store-name {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-modal-close {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.app-modal-close:hover {
  background: var(--bg);
}

.header-subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 12px;
}

.app-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.25);
  text-decoration: none;
  transition: all 0.3s ease;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}

.app-download-button:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.15) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.app-download-button:active {
  transform: translateY(1px);
}

.app-download-button i {
  font-size: 1rem;
}

/* ==================== النص التعريفي ==================== */
.intro-section {
  padding: 14px 0 6px;
  background: var(--bg);
  transition: background-color var(--transition);
}

.intro-text {
  font-family: var(--font-azkar);
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text-secondary);
  text-align: justify;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all var(--transition);
  max-height: 300px;
  overflow: hidden;
}

.intro-text.collapsed {
  max-height: 0;
  padding: 0 20px;
  border-color: transparent;
  margin: 0;
}

.intro-toggle {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  padding: 4px 12px;
  border-radius: 100px;
}

.intro-toggle:hover {
  color: var(--primary);
  background: rgba(26, 86, 219, 0.06);
}

.intro-toggle i {
  transition: transform 0.3s ease;
}

.intro-toggle.collapsed i {
  transform: rotate(180deg);
}

/* ==================== زر الإحصائيات المدمج ==================== */
.stats-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  padding: 10px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.stats-compact:hover {
  background: rgba(255, 255, 255, 0.2);
}

.stats-compact-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stats-compact-item i {
  font-size: 0.75rem;
  opacity: 0.8;
}

.stats-compact-sep {
  opacity: 0.3;
  font-weight: 300;
}

.stats-compact-more {
  font-size: 0.6rem;
  background: rgba(255,255,255,0.15);
  padding: 3px 8px;
  border-radius: 10px;
  margin-right: 4px;
  font-weight: 600;
  transition: all var(--transition);
}

.stats-compact-more i {
  font-size: 0.55rem;
  margin-left: 3px;
}

.stats-compact:hover .stats-compact-more {
  background: rgba(255,255,255,0.3);
}

/* ==================== popup الإحصائيات ==================== */
.stats-modal {
  padding: 28px 24px 20px;
  max-width: 400px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-modal-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.stats-modal-title i {
  color: var(--primary);
  margin-left: 6px;
}

.stats-modal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.stats-modal-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.stats-modal-icon {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

.stats-modal-icon.fire { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stats-modal-icon.check { background: linear-gradient(135deg, #3b82f6, #1a56db); }
.stats-modal-icon.date { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.stats-modal-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stats-modal-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.stats-modal-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.stats-modal-desc {
  grid-column: 2;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* الرسم البياني الأسبوعي */
.weekly-chart {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.weekly-chart-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.weekly-chart-title i {
  color: var(--primary);
  margin-left: 4px;
}

.weekly-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 80px;
}

.weekly-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 40px;
}

.weekly-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--border);
  min-height: 4px;
  transition: height 0.5s ease, background 0.3s ease;
}

.weekly-bar.active .weekly-bar-fill {
  background: var(--primary);
}

.weekly-bar.today .weekly-bar-fill {
  background: var(--primary-light);
  box-shadow: 0 0 8px rgba(26, 86, 219, 0.3);
}

.weekly-bar-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.weekly-bar.today .weekly-bar-label {
  color: var(--primary);
  font-weight: 700;
}

.stats-modal-note {
  font-size: 0.7rem;
  color: #854d0e;
  text-align: right;
  line-height: 1.7;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-sm);
}

.stats-modal-note i {
  margin-left: 4px;
  font-size: 0.65rem;
}

[data-theme="dark"] .stats-modal-note {
  background: #422006;
  color: #fbbf24;
  border-color: #854d0e;
}

.stats-modal-close {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.stats-modal-close:hover {
  background: var(--primary-dark);
}

/* ==================== التبويبات ==================== */
.tabs-nav {
  background: var(--bg);
  padding: 16px 0 0;
  transition: background-color var(--transition);
}

.tabs {
  display: flex;
  gap: 6px;
  background: var(--tab-bg);
  border-radius: var(--radius);
  padding: 5px;
  transition: background-color var(--transition);
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

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

.tab.active {
  background: var(--tab-active);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-bottom: 3px solid var(--primary-light);
}

[data-theme="dark"] .tab.active {
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.2);
  border-bottom-color: #3b82f6;
}

.tab-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.tab-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.5;
  filter: grayscale(1);
  transition: all var(--transition);
}

.tab.active .tab-img {
  opacity: 1;
  filter: none;
}

[data-theme="dark"] .tab-img {
  filter: grayscale(1) invert(1);
  opacity: 0.5;
}

[data-theme="dark"] .tab.active .tab-img {
  filter: invert(1);
  opacity: 1;
}

.tab-text {
  font-size: 0.75rem;
}

/* ==================== شريط التقدم - ثابت أسفل الشاشة ==================== */
.progress-float {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 10px 0;
  transition: all var(--transition);
}

[data-theme="dark"] .progress-float {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.progress-float-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-float-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: var(--progress-bg);
  border-radius: 100px;
  overflow: hidden;
  transition: background-color var(--transition);
}

.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: 100px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ==================== البحث ==================== */
.search-section {
  padding: 8px 0 4px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 95, 0.1);
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
}

/* ==================== قائمة الأذكار ==================== */
.main-content {
  padding: 12px 0 40px;
}

.azkar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* بطاقة الذكر */
.zikr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  overflow: hidden;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

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

.zikr-card.completed {
  background: var(--completed-bg);
  border-color: var(--completed-border);
  opacity: 0.7;
}

.zikr-card.completed .zikr-text {
  text-decoration: none;
  opacity: 0.6;
}

.zikr-card.completed .counter-btn {
  background: var(--completed-border);
  cursor: pointer;
  transform: scale(0.9);
}

.zikr-card.completed .counter-btn:hover {
  background: #e67e22;
  transform: scale(1);
}

.zikr-body {
  padding: 20px 22px 14px;
}

.zikr-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.zikr-text {
  font-family: var(--font-azkar);
  font-size: 1.35rem;
  line-height: 3em;
  color: var(--text);
  word-spacing: 2px;
  text-align: justify;
  transition: opacity var(--transition);
}

.zikr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.01);
}

[data-theme="dark"] .zikr-footer {
  background: rgba(255,255,255,0.02);
}

.zikr-source {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.zikr-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* زر العداد */
.counter-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 12px rgba(14, 124, 95, 0.3);
}

.counter-btn:hover {
  background: var(--primary-light);
  transform: scale(1.08);
}

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

.counter-btn.pulse {
  animation: pulse 0.3s ease;
}

/* زر المشاركة */
.share-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.share-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(14, 124, 95, 0.05);
}

/* ==================== رسالة الإتمام ==================== */
.completion-message {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.6s ease;
  position: relative;
  overflow: hidden;
}

.completion-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
  color: #10b981;
}

.completion-message h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.completion-message p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.8;
}

.completion-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.btn-share-completion {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  max-width: 280px;
}

.btn-share-completion:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-share-completion i {
  margin-left: 6px;
}

.btn-reset {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 32px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(14, 124, 95, 0.25);
}

.btn-reset {
  width: 100%;
  max-width: 280px;
}

/* ==================== تأثير Confetti ==================== */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  animation: confettiFall linear forwards;
  opacity: 0;
}

.confetti-circle {
  border-radius: 50%;
}

.confetti-square {
  border-radius: 2px;
}

.confetti-star {
  width: 0 !important;
  height: 0 !important;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(400px) rotate(720deg) scale(0.3);
  }
}

.btn-reset:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ==================== المودال ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(0,0,0,0.05);
}

.modal-content h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.share-text {
  font-family: var(--font-azkar);
  font-size: 1.15rem;
  line-height: 2;
  color: var(--text);
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: #fff;
}

.share-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.share-btn.whatsapp {
  background: #25d366;
}

.share-btn.twitter {
  background: #1da1f2;
}

.share-btn.copy {
  background: #607d8b;
}

/* ==================== الفوتر ==================== */
.footer {
  text-align: center;
  padding: 30px 0 80px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.footer-note {
  margin-top: 6px;
  font-family: var(--font-azkar);
  font-size: 0.95rem;
  color: var(--primary);
}

/* ==================== الإشعار (Toast) ==================== */
.toast {
  position: fixed;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg);
  color: #fff;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== الحركات ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* تأخير ظهور البطاقات */
.zikr-card:nth-child(1) { animation-delay: 0.02s; }
.zikr-card:nth-child(2) { animation-delay: 0.06s; }
.zikr-card:nth-child(3) { animation-delay: 0.1s; }
.zikr-card:nth-child(4) { animation-delay: 0.14s; }
.zikr-card:nth-child(5) { animation-delay: 0.18s; }
.zikr-card:nth-child(6) { animation-delay: 0.22s; }
.zikr-card:nth-child(7) { animation-delay: 0.26s; }
.zikr-card:nth-child(8) { animation-delay: 0.3s; }
.zikr-card:nth-child(9) { animation-delay: 0.34s; }
.zikr-card:nth-child(10) { animation-delay: 0.38s; }
.zikr-card:nth-child(11) { animation-delay: 0.42s; }
.zikr-card:nth-child(12) { animation-delay: 0.46s; }
.zikr-card:nth-child(13) { animation-delay: 0.5s; }
.zikr-card:nth-child(14) { animation-delay: 0.54s; }
.zikr-card:nth-child(15) { animation-delay: 0.58s; }

/* ==================== التجاوب ==================== */
@media (max-width: 480px) {
  .logo {
    font-size: 1.3rem;
  }

  .streak-bar {
    gap: 8px;
  }

  .streak-item {
    padding: 8px 12px;
  }

  .streak-number {
    font-size: 1.2rem;
  }

  .tab {
    padding: 10px 6px;
  }

  .tab-text {
    font-size: 0.68rem;
  }

  .zikr-text {
    font-size: 1.15rem;
    line-height: 3em;
  }

  .zikr-body {
    padding: 16px 16px 10px;
  }

  .zikr-footer {
    padding: 10px 16px;
  }

  .counter-btn {
    width: 46px;
    height: 46px;
    font-size: 1rem;
  }
}

/* تحسين مظهر شريط التمرير */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==================== الوصف/الفضل ==================== */
.zikr-description {
  color: #7d5f0d;
  background-color: #fcf1d3;
  padding: 8px 14px;
  margin: 8px 0 4px;
  border-radius: var(--radius-sm);
  border-bottom: 2px solid #efefef;
  font-family: var(--font-azkar);
  font-size: 0.95rem;
  line-height: 3em;
  text-align: justify;
}

[data-theme="dark"] .zikr-description {
  background-color: #3e2f00;
  color: #f1c40f;
  border-color: #555;
}

/* ==================== البسملة ==================== */
.basmala {
  color: inherit;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  font-size: 1.1em;
}

/* ==================== أرقام الآيات ==================== */
.ayah-number {
  color: var(--primary);
  font-weight: 400;
  font-size: 0.85em;
}

/* ==================== زر الصوت ==================== */
.play-audio-btn {
  font-family: var(--font-body);
  background-color: #377ad0;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.play-audio-btn:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.play-audio-btn:active {
  background-color: #004080;
}

.play-audio-btn.playing {
  background-color: #E53E3E;
}

.play-audio-btn.playing:hover {
  background-color: #C53030;
}

.play-audio-btn i {
  font-size: 0.85rem;
}

/* ==================== popup إتمام الذكر ==================== */
.popup {
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

.popup-done {
  background: var(--bg-card);
  padding: 36px 30px 28px;
  border: none;
  width: 85%;
  max-width: 320px;
  text-align: center;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}

.popup-done-icon {
  margin-bottom: 18px;
}

.popup-done-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1a56db);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: scaleCheck 0.5s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.popup-done-circle i {
  color: #fff;
  font-size: 2rem;
}

.popup-done-title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.popup-done-subtitle {
  font-family: var(--font-azkar);
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.popup-done-bar {
  height: 4px;
  background: var(--progress-bg);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.popup-done-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3b82f6, #1a56db);
  border-radius: 100px;
  animation: barShrink 2s linear forwards;
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes scaleCheck {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes barShrink {
  0% { width: 100%; }
  100% { width: 0%; }
}

/* ==================== مؤشر التحميل ==================== */
.loading-indicator {
  text-align: center;
  margin: 40px 0;
  color: var(--primary);
}

.loading-indicator i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.loading-indicator p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.loading-indicator.hidden {
  display: none;
}

/* ==================== بطاقة مخفية بعد الإتمام ==================== */
.zikr-card.fade-out {
  animation: fadeOutCard 0.5s ease forwards;
}

@keyframes fadeOutCard {
  0% { opacity: 1; max-height: 600px; margin-bottom: 14px; }
  50% { opacity: 0; }
  100% { opacity: 0; max-height: 0; margin-bottom: 0; padding: 0; overflow: hidden; }
}

/* ==================== تنسيقات الفوتر الجديدة ==================== */
.footer-note {
  font-size: 0.78rem;
  color: #16a34a;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.8;
}

.footer-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-dua {
  margin-top: 6px;
  font-family: var(--font-azkar);
  font-size: 0.95rem;
  color: var(--primary);
}

/* ==================== وضع التركيز ==================== */
body.focus-mode .header,
body.focus-mode .intro-section,
body.focus-mode .tabs-nav,
body.focus-mode .search-section,
body.focus-mode .footer,
body.focus-mode .progress-float {
  display: none !important;
}

body.focus-mode .main-content {
  padding: 0;
}

body.focus-mode .zikr-card:not(.focused) {
  display: none !important;
}

body.focus-mode .zikr-card.focused {
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: none;
  opacity: 1;
}

body.focus-mode .zikr-card.focused .zikr-body {
  padding: 32px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.focus-exit-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

body.focus-mode .focus-exit-btn {
  display: flex;
}

.focus-exit-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* ==================== زر التنبيهات نشط ==================== */
.icon-btn.notif-active {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
}

#notifToggle {
  animation: bellShake 3s ease-in-out infinite;
  position: relative;
}

#notifToggle::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: notifPulse 1.5s ease-in-out infinite;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  5% { transform: rotate(12deg); }
  10% { transform: rotate(-12deg); }
  15% { transform: rotate(8deg); }
  20% { transform: rotate(-8deg); }
  25% { transform: rotate(0); }
}

@keyframes notifPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ==================== تحسين التجاوب ==================== */
@media (max-width: 480px) {
  .header {
    padding: 16px 0 12px;
  }

  .header-row-1 {
    gap: 4px;
    margin-bottom: 8px;
  }

  .logo {
    font-size: 1.05rem;
    gap: 6px;
  }

  .logo-img {
    width: 26px;
    height: 26px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
    border-radius: 8px;
  }

  .icon-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
    border-radius: 6px;
  }

  .header-actions-right,
  .header-actions-left {
    gap: 4px;
  }

  .stats-compact {
    font-size: 0.72rem;
    padding: 8px 12px;
    gap: 7px;
  }

  .stats-compact-item i {
    font-size: 0.65rem;
  }

  .play-audio-btn {
    padding: 6px 12px;
    font-size: 0.72rem;
  }

  .zikr-description {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
}

/* ==================== مودال الترحيب ==================== */
.welcome-modal {
  text-align: center;
  padding: 36px 28px 28px;
  max-width: 420px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.welcome-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transition: filter var(--transition);
}

[data-theme="dark"] .welcome-modal .welcome-logo,
[data-theme="dark"] .modal-content .welcome-logo,
[data-theme="dark"] img.welcome-logo {
  filter: brightness(0) invert(1) !important;
}

.welcome-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-family: var(--font-azkar);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.welcome-steps {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.welcome-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.welcome-step-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.welcome-step-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
}

.welcome-step-text strong {
  color: var(--primary);
}

.welcome-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.welcome-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 86, 219, 0.3);
}

/* ==================== مودال التراجع ==================== */
.undo-modal {
  text-align: center;
  padding: 32px 28px 24px;
}

.undo-icon {
  margin-bottom: 14px;
}

.undo-icon i {
  font-size: 2.2rem;
  color: #e67e22;
}

.undo-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.undo-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 22px;
}

.undo-actions {
  display: flex;
  gap: 10px;
}

.undo-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.undo-btn:hover {
  transform: translateY(-1px);
}

.undo-btn.confirm {
  background: #e67e22;
  color: #fff;
}

.undo-btn.confirm:hover {
  background: #d35400;
}

.undo-btn.cancel {
  background: var(--tab-bg);
  color: var(--text-secondary);
}

.undo-btn.cancel:hover {
  background: var(--border);
  color: var(--text);
}

/* ==================== Control bottom في البطاقة ==================== */
.zikr-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.zikr-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zikr-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
