body {
  background: #bc3b36; /* الخلفية الموحدة للصفحة */
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  text-align: center;
  padding: 20px 16px;
  box-sizing: border-box;
}

.loading-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 320px;
  width: 90%;
}

/*#loading {*/
/*  position: fixed;*/
/*  top: 50%;*/
/*  left: 50%;*/
/*  transform: translate(-50%, -50%);*/
/*  background: white;*/
/*  display: flex;*/
/*  flex-direction: column;*/
/*  align-items: center;*/
/*  justify-content: center;*/
/*  z-index: 10000;*/
/*  text-align: center;*/
/*  padding: 20px 16px; !* تقليل التباعد قليلاً *!*/
/*  border-radius: 12px;*/
/*  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);*/
/*  width: 90%;*/
/*  max-width: 320px; !* الحد الأقصى للعرض *!*/
/*  box-sizing: border-box;*/
/*}*/
#loading.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}


.logo {
  width: 100px; /* تصغير الشعار قليلاً */
  height: 100px;
  border-radius: 50%;
  margin-bottom: 15px; /* تقليل الهامش السفلي */
}

#loading p {
  font-weight: bold;
  color: #333; /* لون نص أغمق */
  margin: 8px 0; /* تقليل الهوامش */
  font-size: 1em;
}

/* حاوية الشريط */
#loading-container {
  width: 90%;
  max-width: 300px;
  margin-top: 5px; /* تقليل الهامش العلوي */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0px;
}

/* شريط التقدم */
#progress-bar-container {
  width: 100%;
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background-color: #007bff; /* لون أزرق لشريط التقدم */
  transition: width 0.3s ease;
  border-radius: 6px;
}

#loading-text {
  margin-top: 8px;
  color: #555;
  font-size: 0.85em;
}

#progress-percent {
  margin-top: 3px;
  font-size: 0.75em;
  color: #777;
}

/* زر إعادة المحاولة */
#retryButton {
  display: none;
  padding: 8px 16px;
  font-size: 0.9em;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}
#retryButton:hover {
  background-color: #d32f2f;
}

#retryErrorMessage {
  color: red;
  font-size: 0.75em;
  text-align: center;
  margin-top: 3px;
}

/* لافتة التثبيت المحسنة *//* لافتة التثبيت المحسنة للجوال *//* لافتة التثبيت المحسنة للجوال (المحاولة الثانية) */
#installBanner {
  position: fixed;
  bottom: 0; /* تثبيتها في الأسفل */
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  background: rgba(255, 255, 255, 0.9); /* خلفية شبه شفافة */
  padding: 10px 15px; /* هامش داخلي */
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  z-index: 9999;
  display: none;
  align-items: center;
  font-size: 0.9em;
  color: #333;
}

#installBanner span {
  flex-grow: 1; /* السماح للنص بالتوسع */
  margin-right: 10px; /* هامش بين النص والزر */
  overflow: hidden; /* منع النص من تجاوز الحدود */
  text-overflow: ellipsis; /* إضافة ... للنص الطويل */
  white-space: nowrap; /* منع التفاف النص */
}

#installBanner button {
  background-color: #4caf50; /* لون أخضر للتثبيت */
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  flex-shrink: 0; /* منع الزر من التقلص */
  margin-left: 10px; /* إضافة هامش على يسار الزر */
}

/* تعديل للشاشات الأكبر */
@media (min-width: 600px) {
  #installBanner {
    display: none;
    top: 16px; /* العودة إلى الأعلى */
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* السماح بعرض أصغر */
    border-radius: 8px;
    padding: 12px 15px; /* إعادة الهوامش الأصلية */
  }

  #installBanner span {
    margin-right: 12px; /* إعادة الهامش الأصلي */
  }

  #installBanner button {
    margin-left: 12px; /* إعادة الهامش الأصلي */
  }
}
@media (max-width: 360px) {
  #loading {
    padding: 16px 12px;
    border-radius: 8px;
  }

  #loading p,
  #loading-text,
  #progress-percent {
    font-size: 0.85em;
  }

  .logo {
    max-width: 60px;
    max-height: 60px;
  }
}
