/* --- التنسيقات الأصلية --- */
:root {
  --bg-color: #e5e7eb;
  --main-color-1: #1e3a8a;
  --main-color-2: #172554;
  --screen-bg: #000;
  --lcd-bg: #ccc;
  --whatsapp-color: #25D366;
  --facebook-color: #1877F2;
}

[data-theme="dark"] {
  --bg-color: #111827;
  --lcd-bg: #ccc;
}

#themeToggle {
  transition: all 0.3s ease;
  background-color: #111827;
  color: #fff;
}

[data-theme="dark"] #themeToggle {
  background-color: #ffffff !important;
  color: #000;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: var(--bg-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s ease;
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

button,
.color-dot {
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
  touch-action: manipulation;
}

.hasanat-badge {
  position: absolute;
  top: 10px;
  left: 20px;
  background: white;
  border: 2px solid var(--main-color-1);
  padding: 5px 10px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: border-color 0.3s ease;
}

.hasanat-title {
  font-size: 12px;
  color: #666;
  display: block;
}

.hasanat-count {
  font-size: 18px;
  font-weight: bold;
  color: var(--main-color-1);
  transition: color 0.3s ease;
}

.current-dhikr-card {
  width: 75%;
  max-width: 350px;
  background: white;
  border: 3px solid var(--main-color-1);
  border-radius: 20px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 5;
  transform: translateY(-85px);
  transition: border-color 0.3s ease;
}

.dhikr-text {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  line-height: 1.4;
}

.counter-body {
  width: 220px;
  height: 280px;
  background: linear-gradient(145deg, var(--main-color-1), var(--main-color-2));
  border-radius: 60px 60px 110px 110px;
  box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.6), inset 5px 5px 15px rgba(255, 255, 255, 0.2), 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  border: 1px solid var(--main-color-1);
  transition: all 0.4s ease;
  margin-top: -50px;
}

.counter-body::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 80px;
  height: 550px;
  background-color: #ccc;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50px;
}

.screen-frame {
  width: 170px;
  background-color: var(--screen-bg);
  border-radius: 12px;
  margin-top: 25px;
  padding: 8px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.lcd-display {
  background-color: var(--lcd-bg);
  height: 65px;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 45px;
  font-weight: bold;
  color: #2b3a30;
}

.reset-btn {
  width: 35px;
  height: 35px;
  background: radial-gradient(circle, #f8fafc 0%, #94a3b8 100%);
  border-radius: 50%;
  border: 2px solid #64748b;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 130px;
  box-shadow: 0 4px 0 #475569;
  transition: 0.05s all ease;
}

.count-btn {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, #ffffff 0%, #cbd5e1 100%);
  border-radius: 50%;
  border: 5px solid #94a3b8;
  cursor: pointer;
  box-shadow: 0 10px 0 #64748b, 0 10px 20px rgba(0, 0, 0, 0.4);
  margin-top: 50px;
  font-size: 24px;
  font-weight: bold;
  color: #334155;
  transition: 0.05s all ease;
}

.reset-btn.is-active {
  transform: translateY(4px) !important;
  box-shadow: none !important;
}

.count-btn.is-active {
  transform: translateY(10px) !important;
  box-shadow: none !important;
}

.contact-section-bottom {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

@media (max-width: 991px) {
  .contact-section-bottom {
    bottom: 80px;
    right: 15px;
  }
}

.contact-title {
  font-weight: bold;
  color: var(--main-color-1);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 8px;
  border-radius: 10px;
  transition: color 0.3s;
}

.social-row {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.social-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.whatsapp-bg {
  background-color: #25D366;
}

.facebook-bg {
  background-color: #1877F2;
}

.bottom-left-stack {
  position: absolute;
  bottom: 30px;
  left: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  z-index: 30;
}

@media (max-width: 991px) {
  .bottom-left-stack {
    bottom: 80px;
  }
}

.nav-btn {
  background-color: var(--main-color-1);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background-color 0.3s;
}

.bottom-right-tools {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  flex-direction: row-reverse;
  gap: 5px;
  z-index: 30;
}

.icon-btn {
  width: 50px;
  height: 50px;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fruit-drop {
  position: fixed;
  top: -50px;
  font-size: 30px;
  z-index: 1;
  animation: fruitFall var(--duration) linear forwards;
}

@keyframes fruitFall {
  to {
    transform: translateY(110vh);
  }
}

.color-menu {
  position: absolute;
  bottom: 120px;
  right: 12px;
  background: white;
  padding: 12px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow-y: auto;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: scale(0);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}

.color-menu.active {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

.color-dot {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  background-color: red;
}

.color-dot:hover {
  transform: scale(1.1);
}

.azkar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 10000 !important;
  display: none;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.overlay-header {
  background: var(--main-color-1);
  color: white;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  transition: background-color 0.3s;
}

.dhikr-item {
  background: white;
  border: 2px solid var(--main-color-1);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 15px;
  cursor: pointer;
  font-weight: bold;
  text-align: right;
  color: #333;
  transition: border-color 0.3s ease;
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 9999;
  top: -10px;
  border-radius: 50%;
  animation: fall 3s linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

.modal-add {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 20000 !important;
  text-align: center;
  width: 280px;
}

.modal-add h3 {
  margin-top: 0;
  color: #1e3a8a;
}

.modal-add button {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
}

/* --- تنسيقات التنبيهات الجديدة (Toasts & Info Bar) --- */
.info-bar-style {
  background: #fef3c7;
  color: #92400e;
  padding: 10px;
  border-radius: 8px;
  margin: 0 auto 10px;
  font-size: 1.3em;
  text-align: center;
  width: 90%;
  border: 1px solid #fde68a;
}

.toast-popup {
  position: fixed;
  top: 15%;
  /* تم رفعه قليلاً ليكون واضحاً فوق القائمة */
  left: 50%;
  transform: translate(-50%, 0);
  /* لضمان التوسيط الدقيق */
  background: rgba(0, 0, 0, 0.8);
  /* درجة شفافية مريحة للعين */
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  z-index: 10001;
  font-size: 15px;
  font-weight: 500;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  /* إضافة تأثير زجاجي بسيط خلف الرسالة */
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* إطار ناعم جداً */
  animation: fadeInOut 1.5s ease-in-out forwards;
  pointer-events: none;
  /* عشان ميمنعش الضغط على اللي تحته */
  white-space: nowrap;
  /* عشان النص م ينزلش سطر جديد */
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    top: 20%;
  }

  20% {
    opacity: 1;
    top: 20%;
  }

  80% {
    opacity: 1;
    top: 20%;
  }

  100% {
    opacity: 0;
    top: 25%;
  }
}

:root {
  --ramadan-gold: #ffd700;
  --ramadan-red: #b91c1c;
}

/* حاوية الزينة */
.ramadan-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 150px;
  pointer-events: none;
  /* لكي لا تعيق الضغط على الأزرار */
  z-index: 1000;
  overflow: hidden;
}

/* خيط الزينة العلوي */
.decoration-string {
  position: absolute;
  top: 0;
  width: 100%;
  height: 20px;
  background-image: radial-gradient(circle, var(--ramadan-gold) 2px, transparent 2px);
  background-size: 30px 30px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
}

/* الفانوس الآن هو صورة */
.hanging-lantern {
  position: absolute;
  left: 2.45%;
  /*نفسالموقعالذيحددته*/
  scale: .5;
  top: 42%;
  /*نفسالموقعالذيحددته*/
  width: 60px;
  /*حجممناسبللصورة،يمكنكتعديله*/
  height: auto;
  /*للحفاظعلىأبعادالصورةالأصلية*/
  z-index: 5;
  /*ليكونفوقباقيالعناصر*/
  transform-origin: top center;
  /*نقطةالارتكازلحركةالتأرجح*/
  /*دمجحركتين:;
  التأرجحوالنبضالضوئي*/
  animation: swing 3s ease-in-out infinite, lantern-glow 2s ease-in-out infinite;
  /*للحفاظعلىجودةالصورةعندتغييرالحجم*/
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-animation: swing 3s ease-in-out infinite, lantern-glow 2s ease-in-out infinite;

}

@media (max-width:767px) {
  .hanging-lantern {
    left: 5%;
    /* نفس الموقع للموبايل */
    /* تصغير حجم الفانوس للموبايل */
  }
}

/* حركة التأرجح */
@keyframes swing {

  0%,
  100% {
    transform: rotate(-8deg);
  }

  50% {
    transform: rotate(8deg);
  }
}

/* حركة الإضاءة (التوهج) */
@keyframes lantern-glow {

  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)) brightness(1);
    /* توهج خفيف وسطوع عادي */
  }

  50% {
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)) brightness(1.2);
    /* توهج أقوى وسطوع أعلى */
  }
}


/* الهلال */
.hanging-moon {
  position: absolute;
  left: 36%;
  top: 20px;
  font-size: 30px;
  filter: drop-shadow(0 0 10px var(--ramadan-gold));
  animation: float 4s ease-in-out infinite;
}

.hanging-moon::before {
  content: "🌙";
}

/* النجمة */
.hanging-star {
  position: absolute;
  left: 35%;
  top: 10px;
  font-size: 20px;
  color: var(--ramadan-gold);
  animation: blink 2s infinite;
}

.hanging-star::before {
  content: "⭐";
}

@media (max-width: 767px) {
  #overlayMainTitle {
    font-size: 17px !important;
  }
}

.gold {
  width: 40px;
}

/* الحركات (Animations) */
@keyframes swing {

  0%,
  100% {
    transform: rotate(-10deg);
  }

  50% {
    transform: rotate(10deg);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}