body{margin:0;font-family:sans-serif;background:#f3f4f6;color:#1f2937;transition: background-color 0.3s, color 0.3s;}
html.dark body{background:#0f172a;color:#e2e8f0;} 

header{display:flex;justify-content:space-between;align-items:center;padding:0.5rem 1rem;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.1);position:sticky;top:0;z-index:50;transition: background-color 0.3s;}
html.dark header{background:#1e293b;}
html.dark header{background:#1e293b;}
html.dark header{background:#1e293b;}
header h1{font-size:1.2rem;} /* عنوان أصغر */
.app-logo{width:36px;height:36px;object-fit:contain;vertical-align:middle;margin-left:0.4rem}
@media (max-width:480px){.app-logo{width:28px;height:28px}}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.25rem;
  gap: 0.25rem;
}

html.dark .tabs {
  background: #334155;
}

/* تحسين ألوان التبويبات في الوضع النهاري */
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

html.dark .tab-btn {
  color: #cbd5e1;
}

.tab-btn:hover {
  color: #374151;
  background: rgba(59, 130, 246, 0.1);
}

html.dark .tab-btn:hover {
  color: #f9fafb;
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

html.dark .tab-btn.active {
  background: #475569;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tab-btn i {
  font-size: 1rem;
}

#toggle-dark{padding:0.4rem;border-radius:9999px;background:#e5e7eb;cursor:pointer;transition:0.3s;font-size:1rem;}
html.dark #toggle-dark{background:#334155;}

/* أقسام المحتوى */
.content-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
  display: block;
}

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

main{padding:1rem;display:flex;flex-direction:column;gap:1.5rem;max-width:1200px;margin:0 auto;}
.card{background:#fff;border-radius:1rem;padding:1rem;box-shadow:0 4px 12px rgba(0,0,0,0.08);transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;border:1px solid rgba(0,0,0,0.05);}
.card:hover{box-shadow:0 8px 25px rgba(0,0,0,0.12);transform:translateY(-2px);}
html.dark .card{background:#1e293b;border-color:rgba(255,255,255,0.1);}
html.dark .card:hover{box-shadow:0 8px 25px rgba(0,0,0,0.3);}

/* تحسين ألوان البطاقات في الوضع النهاري */
.card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #1f2937;
  transition: 0.3s;
}

html.dark .card-header {
  color: #e2e8f0;
}

.card-header:hover {
  color: #3b82f6;
}

html.dark .card-header:hover {
  color: #facc15;
}

.card-header i {
  font-size: 1rem;
}

html.dark .card-header i {
  color: #facc15;
}

/* تحسين ألوان الأسهم */
#arrow-salah,
#arrow-quran,
#arrow-azkar,
#arrow-gratitude {
  color: #3b82f6;
  transition: 0.3s;
}

html.dark #arrow-salah,
html.dark #arrow-quran,
html.dark #arrow-azkar,
html.dark #arrow-gratitude {
  color: #FFFFFF;
}

.card-content{margin-top:1rem;display:flex;flex-direction:column;gap:0.75rem;}
.hidden{display:none;}
.rotate-180{transform:rotate(180deg);transition:0.3s;}

ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:0.5rem;}
select,textarea{width:100%;padding:0.6rem;border-radius:0.75rem;border:2px solid #e5e7eb;font-size:0.9rem;transition:0.3s;box-sizing:border-box;background:#fafafa;}
select:hover,textarea:hover{border-color:#d1d5db;background:#ffffff;}
select:focus,textarea:focus{outline:none;border-color:#3b82f6;background:#ffffff;box-shadow:0 0 0 3px rgba(59,130,246,0.1);}
textarea#gratitude-text{height:2.5rem;font-size:0.85rem;min-height:2.5rem;resize:vertical;}
html.dark select,html.dark textarea{background:#334155;border-color:#475569;color:#e2e8f0;}
html.dark select:hover,html.dark textarea:hover{border-color:#64748b;background:#3a4a5c;}
html.dark select:focus,html.dark textarea:focus{border-color:#60a5fa;background:#3a4a5c;box-shadow:0 0 0 3px rgba(96,165,250,0.2);}

.progress-bar-bg{width:100%;background:#e5e7eb;height:0.75rem;border-radius:9999px;overflow:hidden;box-shadow:inset 0 1px 3px rgba(0,0,0,0.1);}
html.dark .progress-bar-bg{background:#475569;}
.progress-bar-fill{height:100%;border-radius:9999px;transition:width 0.3s ease;}
.quran-fill{background:linear-gradient(90deg,#16a34a,#15803d);}
.dhikr-fill{background:linear-gradient(90deg,#2563eb,#1d4ed8);}
.mosque-fill{background:linear-gradient(90deg,#8b5cf6,#7c3aed);}
.combined-fill{background:linear-gradient(90deg,#3b82f6,#8b5cf6);}

.btn{padding:0.4rem 0.8rem;border-radius:0.5rem;color:#ffffff;border:none;font-size:0.9rem;cursor:pointer;transition:0.3s;min-height:2.5rem;box-shadow:0 2px 4px rgba(0, 0, 0, 0.795);}
.btn:hover{transform:translateY(-1px);box-shadow:0 4px 8px rgba(0,0,0,0.15);}
.btn-green{background:linear-gradient(135deg,#16a34a,#15803d);}
.btn-blue{background:linear-gradient(135deg,#2563eb,#1d4ed8);}
.btn-purple{background:linear-gradient(135deg,#7c3aed,#6d28d9);}
.btn:disabled{opacity:0.5;cursor:not-allowed;transform:none;box-shadow:none;}

/* تنسيقات خاصة لزر السابق في نافذة الأذكار */
#azkar-prev {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

#azkar-prev:hover {
  background: linear-gradient(135deg, #4b5563, #374151) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

html.dark #azkar-prev {
  background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
  color: #1f2937 !important;
}

html.dark #azkar-prev:hover {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

.text-sm{font-size:0.75rem;color:#6b7280;}
html.dark .text-sm{color:#cbd5e1;} 

#clock{text-align:center;font-size:1rem;margin-top:0.5rem;color:#1f2937;}
html.dark #clock{color:#e2e8f0;} 

/* تصميم زر الصلاة */
.prayer-btn{
  width:2.5rem;height:2.5rem;border-radius:0.75rem;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.2rem;transition:0.3s;flex-shrink:0;box-shadow:0 2px 8px rgba(59,130,246,0.3);
}
.prayer-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.4);}
.prayer-btn:disabled{background:linear-gradient(135deg,#9ca3af,#6b7280);cursor:not-allowed;transform:none;box-shadow:none;}
.prayer-btn.done{background:linear-gradient(135deg,#16a34a,#15803d);box-shadow:0 2px 8px rgba(22,163,74,0.3);}

/* تصميم زر المسجد */
.mosque-btn{
  width:2.5rem;height:2.5rem;border-radius:0.75rem;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.2rem;transition:0.3s;flex-shrink:0;box-shadow:0 2px 8px rgba(59,130,246,0.3);margin-right:0.5rem;
}
.mosque-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(59,130,246,0.4);}
.mosque-btn:disabled{background:linear-gradient(135deg,#9ca3af,#6b7280);cursor:not-allowed;transform:none;box-shadow:none;}
.mosque-btn.done{background:linear-gradient(135deg,#16a34a,#15803d);box-shadow:0 2px 8px rgba(22,163,74,0.3);}

/* تصميم قسم المجتمع */
.community-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 0.75rem;
  transition: background-color 0.3s, color 0.3s, transform 0.3s ease, box-shadow 0.3s ease;
}

html.dark .stat-item {
  background: linear-gradient(135deg, #1e293b, #334155);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3b82f6;
  margin-bottom: 0.25rem;
}

html.dark .stat-number {
  color: #60a5fa;
}

.stat-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

html.dark .stat-label {
  color: #cbd5e1;
}

/* تصميم تبويب المجتمع */
.community-tab {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1f2937;
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.community-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%233b82f6" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%233b82f6" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%233b82f6" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%233b82f6" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%233b82f6" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

html.dark .community-tab {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.1);
}

.community-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.community-header h2 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #1f2937;
}

html.dark .community-header h2 {
  color: #ffffff;
}

.community-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0;
  font-weight: 400;
  color: #6b7280;
}

html.dark .community-subtitle {
  color: #cbd5e1;
}

.community-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

/* زيادة المسافة بين بطاقات التحديات اليومية والأسبوعية */
.community-content .card + .card {
  margin-top: 1.75rem; /* كانت ضيقة، زدناها */
}

/* زيادة البادينق داخل بطاقات تبويب التحديات */
.community-content .card {
  padding: 1.5rem; /* بدلاً من 1rem الافتراضية */
}

@media (max-width: 480px) {
  .community-content .card { padding: 1.25rem; }
}

/* تعديل ألوان الإحصائيات للتبويب */
.community-tab .stat-item {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

html.dark .community-tab .stat-item {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.community-tab .stat-number {
  color: #3b82f6;
}

html.dark .community-tab .stat-number {
  color: #60a5fa;
}

.community-tab .stat-label {
  color: #6b7280;
}

html.dark .community-tab .stat-label {
  color: rgba(255, 255, 255, 0.8);
}



/* تصميم قسم المسابقة */
/* عنوان "قريباً" بتصميم جميل */
.soon {
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  letter-spacing: 1px;
  filter: drop-shadow(0 6px 18px rgba(59, 130, 246, 0.25));
  backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
  animation: float 0.3s linear infinite alternate;
}


.soon::after {
  content: '';
  display: block;
  height: 6px;
  width: clamp(90px, 30%, 240px);
  margin: 10px auto 0;
  background: linear-gradient(90deg, rgba(59,130,246,0.8), rgba(167,139,250,0.8));
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(59,130,246,0.25);
  animation: shine 2.5s ease-in-out infinite;
}

html.dark .soon::after {
  background: linear-gradient(90deg, rgba(96,165,250,0.9), rgba(250,204,21,0.9));
  box-shadow: 0 6px 24px rgba(250,204,21,0.25);
}

@keyframes float {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -6px, 0); }
}

@keyframes shine {
  0%, 100% { opacity: 0.6; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.15); }
}

/* تصميم قسم المسابقة */
.competition-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

html.dark .competition-section {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.competition-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.competition-header h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0 0 0.5rem 0;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

html.dark .competition-header h3 {
  color: #ffffff;
}

.competition-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

html.dark .competition-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

/* تصميم جدول الترتيب */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

html.dark .leaderboard-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.leaderboard-item.top-1 {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border-color: #fbbf24;
}

.leaderboard-item.top-2 {
  background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
  border-color: #9ca3af;
}

.leaderboard-item.top-3 {
  background: linear-gradient(135deg, #cd7f32, #d97706);
  border-color: #b45309;
}

.rank {
  font-size: 1.2rem;
  font-weight: bold;
  min-width: 2rem;
  text-align: center;
  color: #374151;
}

html.dark .rank {
  color: #f9fafb;
}

.top-1 .rank,
.top-2 .rank,
.top-3 .rank {
  color: #1f2937;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

html.dark .user-name {
  color: #f9fafb;
}

.top-1 .user-name,
.top-2 .user-name,
.top-3 .user-name {
  color: #1f2937;
}

.user-points {
  font-weight: bold;
  font-size: 0.9rem;
  color: #3b82f6;
  text-align: right;
}

html.dark .user-points {
  color: #60a5fa;
}

.top-1 .user-points,
.top-2 .user-points,
.top-3 .user-points {
  color: #1f2937;
}

/* تصميم ترتيب المستخدم الحالي */
.my-rank {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 2px solid rgba(59, 130, 246, 0.2);
  margin-bottom: 1.5rem; /* إضافة هامش سفلي */
}

html.dark .my-rank {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
}

.my-rank-header {
  font-weight: 600;
  font-size: 0.9rem;
  color: #3b82f6;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html.dark .my-rank-header {
  color: #60a5fa;
}

.my-rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.5rem;
}

html.dark .my-rank-item {
  background: rgba(255, 255, 255, 0.05);
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0;
  margin-right: 1rem;
}
.hamburger-btn span {
  display: block;
  height: 4px;
  width: 28px;
  background: #3b82f6;
  border-radius: 2px;
  transition: 0.3s;
}
html.dark .hamburger-btn span {
  background: #fff;
}

.side-menu {
  position: absolute;
  top: 3.5rem; /* أسفل الهيدر مباشرة */
  left: 1rem; /* أقصى اليسار */
  right: auto;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 0.25rem;
  z-index: 1000;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.2s, transform 0.2s;
  align-items: flex-start;
}
.side-menu.hidden {
  display: none;
}
html.dark .side-menu {
  background: #22223b;
  color: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 1.1rem;
  text-align: right;
  cursor: pointer;
  padding: 0.5rem 2rem; /* زيادة البادينق */
  border-radius: 0.5rem;
  transition: background 0.2s;
}
.side-menu-item .menu-logo{width:20px;height:20px;object-fit:contain;vertical-align:middle;margin-left:0.5rem}
.side-menu-item:hover {
  background: #f3f4f6;
}
html.dark .side-menu-item:hover {
  background: #2a2a40;
}

/* Responsive Design - Mobile First */

/* Small screens (phones) */
@media (max-width: 480px) {
  header {
    padding: 1rem 1.25rem;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  .header-controls {
    gap: 0.75rem;
  }
  
  .tabs {
    padding: 0.2rem;
    gap: 0.2rem;
  }
  
  .tab-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }
  
  .tab-btn i {
    font-size: 0.9rem;
  }
  
  #toggle-dark {
    padding: 0.6rem;
    font-size: 1.2rem;
  }
  
  main {
    padding: 1rem;
    gap: 1.25rem;
  }
  
  .card {
    padding: 1.25rem;
    border-radius: 1rem;
  }
  
  .card-header {
    font-size: 1.1rem;
    padding: 0.5rem 0;
  }
  
  .card-content {
    margin-top: 1.25rem;
    gap: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 3.5rem;
    border-radius: 0.75rem;
  }
  
  select, textarea {
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    min-height: 3rem;
  }
  
  textarea#gratitude-text {
    height: 4rem;
    font-size: 1rem;
    min-height: 4rem;
  }
  
  #clock {
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .prayer-btn {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
    border-radius: 0.75rem;
  }
  
  .progress-bar-bg {
    height: 1rem;
    border-radius: 0.75rem;
  }
  
  /* Prayer times list responsive */
  #prayer-times li {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0;
  }
  
  #prayer-times li span {
    font-size: 1rem;
    font-weight: 500;
  }
  
  .text-sm {
    font-size: 0.9rem;
  }
  
  /* تحسين المسافات بين العناصر */
  ul {
    gap: 0.75rem;
  }
  
  /* تحسين أحجام الأيقونات */
  .card-header i {
    font-size: 1.2rem;
  }
  
  /* تحسين قسم المجتمع للشاشات الصغيرة */
  .community-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .stat-item {
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.3rem;
  }
   
   /* تحسين تبويب المجتمع للشاشات الصغيرة */
  .community-tab {
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
  }
  
  .community-header h2 {
    font-size: 1.5rem;
  }
  
  .community-subtitle {
    font-size: 0.9rem;
  }
  
  /* تحسين قسم المسابقة للشاشات الصغيرة */
  .competition-section {
    padding: 1rem;
    margin: 1.5rem 0;
  }
  
  .competition-header h3 {
    font-size: 1.1rem;
  }
  
  .competition-subtitle {
    font-size: 0.85rem;
  }
  
  .leaderboard-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .user-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .user-name {
    font-size: 0.9rem;
  }
  
  .user-points {
    font-size: 0.85rem;
  }
  
  .rank {
    font-size: 1rem;
    min-width: 1.5rem;
  }
}

/* Medium screens (tablets) */
@media (min-width: 481px) and (max-width: 768px) {
  main {
    padding: 1.25rem;
    gap: 1.25rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .btn {
    min-height: 2.75rem;
  }
  
  textarea#gratitude-text {
    height: 2.75rem;
  }
}

/* Large screens (desktops) */
@media (min-width: 769px) {
  main {
    padding: 2rem;
    gap: 2rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    min-height: 3rem;
  }
  
  select, textarea {
    font-size: 1rem;
    padding: 0.5rem;
  }
  
  textarea#gratitude-text {
    height: 3rem;
    font-size: 0.9rem;
  }
  
  #clock {
    font-size: 1.2rem;
  }
  
  .prayer-btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.3rem;
  }
}

/* Extra large screens */
@media (min-width: 1200px) {
  main {
    padding: 2.5rem;
  }
  
  .card {
    padding: 2rem;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  header {
    padding: 0.5rem 1rem;
  }
  
  main {
    padding: 0.5rem 1rem;
    gap: 0.75rem;
  }
  
  .card {
    padding: 0.75rem;
  }
  
  .card-content {
    margin-top: 0.5rem;
    gap: 0.5rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .btn {
    border-radius: 0.6rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 3rem;
    padding: 0.75rem 1rem;
  }
  
  .prayer-btn {
    width: 3rem;
    height: 3rem;
  }
  
  .card-header {
    padding: 0.5rem 0;
  }
}

/* ===== تحدياتي: قوائم وأزرار ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.muted {
  color: #6b7280;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
html.dark .muted { color: #cbd5e1; }

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.challenge-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(211, 211, 211, 0.808);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 0.5rem;
  transition: background-color 0.3s;
}
html.dark .challenge-item {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

.challenge-delete {
  background-color: #ef4444; /* red-500 */
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.challenge-delete:hover {
  background-color: #dc2626; /* red-600 */
}

.btn-reset {
  background-color: #e5e7eb; /* gray-200 */
  color: #4b5563; /* gray-600 */
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem; /* Add some space above */
}

.btn-reset:hover {
  background-color: #d1d5db; /* gray-300 */
  border-color: #9ca3af; /* gray-400 */
}

html.dark .btn-reset {
  background-color: #4b5563; /* gray-600 */
  color: #e5e7eb; /* gray-200 */
  border-color: #6b7280; /* gray-500 */
}

html.dark .btn-reset:hover {
  background-color: #6b7280; /* gray-500 */
  border-color: #9ca3af; /* gray-400 */
}

.user-added-challenges {
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
  padding-top: 1rem;
}

html.dark .user-added-challenges {
  border-top-color: #475569;
}

.challenge-check {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 2px solid #9ca3af; /* رمادي محايد */
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}
.challenge-check:hover { transform: translateY(-1px); }
html.dark .challenge-check { background: #1e293b; border-color: #94a3b8; }
.challenge-check::after {
  /* علامة الصح تُرسم عند الحالة المكتملة فقط */
  content: '';
  position: absolute;
  width: 8px;
  height: 14px;
  border-right: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.challenge-check.done {
  background: #16a34a; /* أخضر */
  border-color: #16a34a;
}
.challenge-check.done::after {
  border-color: #fff; /* لون الصح */
  opacity: 1;
}

.challenge-title { flex: 1; font-weight: 400; }

/* ===== نافذة الإضافة (Modal) ===== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content {
  position: relative;
  width: min(400px, 90%); /* Smaller width for instructions modal */
  margin: 3vh auto; /* Adjust margin for better vertical positioning */
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
}
html.dark .modal-content {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.1);
}
.modal-header { display:flex; align-items:center; justify-content:space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #e5e7eb; }
html.dark .modal-header { border-color: rgba(255,255,255,0.12); }
.modal-close { 
  background: none; 
  border: none; 
  font-size: 1.1rem; 
  cursor: pointer; 
  color: #6b7280; 
  transition: color 0.3s ease;
}
.modal-close:hover { 
  color: #374151; 
}
html.dark .modal-close { 
  color: #cbd5e1; 
}
html.dark .modal-close:hover { 
  color: #f9fafb; 
}
.modal-body { display:flex; flex-direction:column; gap:1rem; padding: 1.5rem 1.75rem; max-height: 70vh; overflow-y: auto; font-size: 1.05rem; line-height: 1.7; }
.modal-body::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.modal-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}
html.dark .modal-body::-webkit-scrollbar-track {
  background: #1e293b;
}
html.dark .modal-body::-webkit-scrollbar-thumb {
  background: #475569;
}
html.dark .modal-body::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.modal-body label { font-size: 0.9rem; color:#374151; }
html.dark .modal-body label { color:#e2e8f0; }
.modal-body input[type="text"], .modal-body select {
  width: 100%;
  padding: 0.6rem;
  border-radius: 0.6rem;
  border: 2px solid #e5e7eb;
  background: #fafafa;
  display: block; 
  box-sizing: border-box;
}
/* اجعل حقل اسم التحدي أطول وأكثر وضوحاً */
#challenge-title {
  min-height: 3rem;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
}
html.dark .modal-body input[type="text"], html.dark .modal-body select { background:#334155; border-color:#475569; color:#e2e8f0; }
.modal-footer { padding: 0.75rem 1.25rem 1.25rem; display:flex; justify-content:flex-end; }

@media (max-width: 480px) {
  .challenge-item { padding: 0.6rem 0.75rem; }
  .challenge-check { width: 2.25rem; height: 2.25rem; }
}

/* ===== تنسيقات قائمة الامتنانات ===== */
#gratitude-list-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

#gratitude-list-container::-webkit-scrollbar {
  width: 6px;
}

#gratitude-list-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

html.dark #gratitude-list-container::-webkit-scrollbar-track {
  background: #374151;
}

#gratitude-list-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

html.dark #gratitude-list-container::-webkit-scrollbar-thumb {
  background: #6b7280;
}

#gratitude-list-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

html.dark #gratitude-list-container::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.gratitude-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f9f9f9;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

html.dark .gratitude-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.gratitude-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

html.dark .gratitude-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.gratitude-date {
  color: #666;
  font-size: 0.85rem;
}

html.dark .gratitude-date {
  color: #9ca3af;
}

.gratitude-delete-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.gratitude-delete-btn:hover {
  background: #a80000;
}

/* تنسيقات خاصة لزر الإغلاق في نافذة قائمة الامتنانات */
#gratitude-list-close {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

#gratitude-list-close:hover {
  background: linear-gradient(135deg, #4b5563, #374151) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

html.dark #gratitude-list-close {
  background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
  color: #1f2937 !important;
}

html.dark #gratitude-list-close:hover {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

/* تنسيقات خاصة لزر الإغلاق في نافذة التحديات */
#modal-close {
  background: none !important;
  border: none !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  color: #6b7280 !important;
  transition: color 0.3s ease !important;
}

#modal-close:hover {
  color: #374151 !important;
}

html.dark #modal-close {
  color: #cbd5e1 !important;
}

html.dark #modal-close:hover {
  color: #f9fafb !important;
}

/* تنسيقات خاصة لزر الإغلاق في نافذة الأذكار */
#azkar-modal-close {
  background: none !important;
  border: none !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  color: #6b7280 !important;
  transition: color 0.3s ease !important;
}

#azkar-modal-close:hover {
  color: #374151 !important;
}

html.dark #azkar-modal-close {
  color: #cbd5e1 !important;
}

html.dark #azkar-modal-close:hover {
  color: #f9fafb !important;
}

/* تنسيقات قسم لا تسكت */
#azkar .card-content > div:last-child {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #2566e7;

}

html.dark #azkar .card-content > div:last-child {
  border-top-color: #3b82f6;
}

#azkar .card-content > div:last-child > p {
  text-align: center;
  font-weight: 700;
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

html.dark #azkar .card-content > div:last-child > p {
  color: #e2e8f0;
}

/* تنسيق التعليق التوضيحي لشريط التقدم المشترك */
#azkar .card-content small {
  color: #6b7280;
  font-size: 0.8rem;
  text-align: center;
  display: block;
  margin-top: 0.25rem;
}

html.dark #azkar .card-content small {
  color: #9ca3af;
}

#azkar .card-content > div:last-child > div {
  display: flex;
  gap: 0.75rem;
}

#azkar .card-content > div:last-child .btn {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  min-height: 2.75rem;
  transition: all 0.3s ease;
}

#azkar .card-content > div:last-child .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

html.dark #azkar .card-content > div:last-child .btn:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* تنسيقات responsive لقسم لا تسكت */
@media (max-width: 768px) {
  #azkar .card-content > div:last-child > div {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  #azkar .card-content > div:last-child .btn {
    flex: none;
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    min-height: 2.5rem;
  }
  
  #azkar .card-content > div:last-child > p {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  #azkar .card-content > div:last-child .btn {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
    min-height: 2.25rem;
  }
  
  #azkar .card-content > div:last-child > p {
    font-size: 1rem;
  }
}

/* تنسيقات خاصة لزر الإغلاق في نافذة الأذكار الجديدة */
#dhikr-new-modal-close {
  background: none !important;
  border: none !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  color: #6b7280 !important;
  transition: color 0.3s ease !important;
}

#dhikr-new-modal-close:hover {
  color: #374151 !important;
}

html.dark #dhikr-new-modal-close {
  color: #cbd5e1 !important;
}

html.dark #dhikr-new-modal-close:hover {
  color: #f9fafb !important;
}

/* تنسيقات خاصة لزر السابق في نافذة الأذكار الجديدة */
#dhikr-new-prev {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

#dhikr-new-prev:hover {
  background: linear-gradient(135deg, #4b5563, #374151) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

html.dark #dhikr-new-prev {
  background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
  color: #1f2937 !important;
}

html.dark #dhikr-new-prev:hover {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #ffffff !important;
}

.gratitude-text {
  margin: 0;
  line-height: 1.6;
  color: #333;
}

html.dark .gratitude-text {
  color: #e2e8f0;
}

/* تحسين مظهر الأزرار في بطاقة الامتنان */
/* لا تسكت Section */
.dhikr-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #2566e7;

}

html.dark .dhikr-section {
  border-top-color: #3b82f6;
}

.dhikr-title {
  text-align: center;
  font-weight: 800; /* Increased from 700 to 800 for bolder text */
  color: #131313;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-family: inherit; /* Ensures the bold weight is applied correctly */
}

html.dark .dhikr-title {
  color: #e2e8f0;
}

.dhikr-buttons {
  display: flex;
  gap: 0.75rem;
}

.dhikr-buttons .btn {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem;
  min-height: auto;
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
  .dhikr-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .dhikr-buttons .btn {
    width: 100%;
  }
}

#gratitude .card-content > div {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

#gratitude .card-content > div .btn {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#gratitude .card-content > div .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#gratitude .card-content > div .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

html.dark #gratitude .card-content > div .btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark #gratitude .card-content > div .btn:active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* تأثير النجاح للحفظ */
#gratitude .btn-purple.success {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: white !important;
  animation: successPulse 0.6s ease;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.challenge-selector-container {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.challenge-selector-container label {
  font-size: 0.9rem;
  color: #374151;
}

html.dark .challenge-selector-container label {
  color: #e2e8f0;
}

.challenge-selector-container select {
  flex: 1;
  max-width: 200px; /* Adjust as needed */
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.gratitude-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f0f4f8;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

html.dark .gratitude-item {
  background: #2d3748;
}

.gratitude-item p {
  margin: 0;
  flex-grow: 1;
  color: #1f2937;
}

html.dark .gratitude-item p {
  color: #e2e8f0;
}

.gratitude-date {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 1rem;
  white-space: nowrap;
}

html.dark .gratitude-date {
  color: #cbd5e1;
}

.gratitude-delete-btn {
  background: none;
  border: none;
  color: #ef4444; /* red-500 */
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: color 0.2s;
}

.gratitude-delete-btn:hover {
  color: #ffffff; /* red-600 */
}

@media (max-width: 320px) {
  .modal-content {
    width: 95%;
    margin: 2vh auto;
  }
  .modal-header {
    padding: 0.75rem 1rem;
  }
  .modal-body {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
}
#instructions-close{
  background-color: #475569;
}