/* منع التمرير أثناء التحميل */
body.no-scroll {
  overflow: hidden;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  
  /* انتقالات سلسة متعددة */
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* حالة الاختفاء */
.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
  backdrop-filter: blur(0px);
}

/* Card مع تأثيرات سلسة */
.card {
  --bg-color: #070707;
  background-color: var(--bg-color);
  padding: 0.7rem 1.5rem;
  border-radius: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);

  /* تأثير نبضة محسن */
  animation: smoothPulse 3s ease-in-out infinite;

  /* انتقال سلس للكارد */
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(0) scale(1);
}

/* تأثير على الكارد عند الاختفاء */
.loading-overlay.fade-out .card {
  transform: translateY(-30px) scale(0.9);
  opacity: 0;
}

.loader {
  color: #DCDCDC;
  font-family: "Cairo", sans-serif;
  font-weight: 500;
  font-size: 25px;
  box-sizing: content-box;
  height: 40px;
  padding: 10px 5px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  gap: 5px;

  /* انتقال سلس للنص */
    transition: all 0.6s ease;
}

.words {
  overflow: hidden;
  position: relative;
  width: 100px;
  /* عرض أقل للنصوص */
  height: 40px;
}

.words::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--bg-color) 10%,
      transparent 30%,
      transparent 70%,
      var(--bg-color) 90%);
  z-index: 20;
}

.word {
  display: block;
  height: 100%;
  text-align: left;
  padding-left: 4px;
  color: #ffd01b;
  animation: spin_4991 4s infinite;
  line-height: 40px;
}

@keyframes spin_4991 {
  10% {
    transform: translateY(-102%);
  }

  25% {
    transform: translateY(-100%);
  }

  35% {
    transform: translateY(-202%);
  }

  50% {
    transform: translateY(-200%);
  }

  60% {
    transform: translateY(-302%);
  }

  75% {
    transform: translateY(-300%);
  }

  85% {
    transform: translateY(-402%);
  }

  100% {
    transform: translateY(-400%);
  }
}

/* تأثير نبضة للكارد */
.card {
  animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.02);
  }
}

.loader p {
  font-weight: 500;
  letter-spacing: 0.5px;
}




/* =========================== */
/* تحسينات خاصة للموبايل */
/* =========================== */

/* للشاشات الصغيرة - الموبايل */
@media screen and (max-width: 768px) {
  .card {
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    margin: 0 20px;
    /* حافة من الجانبين */
    max-width: 280px;
    /* حد أقصى للعرض */
  }

  .loader {
    font-size: 20px;
    height: 35px;
    padding: 8px 4px;
    gap: 4px;
  }

  .words {
    width: 85px;
    height: 35px;
  }

  .word {
    line-height: 35px;
    padding-left: 3px;
  }
}

/* للشاشات الصغيرة جداً - الموبايل الصغير */
@media screen and (max-width: 480px) {
  .card {
    padding: 0.4rem 0.8rem;
    border-radius: 1.2rem;
    margin: 0 15px;
    max-width: 250px;
  }

  .loader {
    font-size: 18px;
    height: 30px;
    padding: 6px 3px;
    gap: 3px;
  }

  .words {
    width: 75px;
    height: 30px;
  }

  .word {
    line-height: 30px;
    padding-left: 2px;
  }

  /* تقليل تأثير النبضة على الشاشات الصغيرة */
  @keyframes smoothPulse {

    0%,
    100% {
      transform: translateY(0) scale(1);
      box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    }

    50% {
      transform: translateY(-3px) scale(1.01);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    }
  }
}

/* للشاشات العمودية الطويلة */
@media screen and (max-height: 600px) {
  .card {
    padding: 0.5rem 1.2rem;
  }

  .loader {
    font-size: 22px;
    height: 38px;
  }

  .words {
    width: 90px;
    height: 38px;
  }

  .word {
    line-height: 38px;
  }
}

/* للشاشات العريضة الصغيرة - الموبايل الأفقي */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .card {
    padding: 0.4rem 1rem;
    border-radius: 1.3rem;
  }

  .loader {
    font-size: 19px;
    height: 32px;
    padding: 6px 4px;
  }

  .words {
    width: 80px;
    height: 32px;
  }

  .word {
    line-height: 32px;
  }
}

/* تحسينات للشاشات عالية الدقة */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
  .card {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  }

  .word {
    text-shadow: 0 1px 2px rgba(255, 208, 27, 0.3);
  }
}

/* تحسينات للشاشات اللمسية */
@media (hover: none) and (pointer: coarse) {
  .card {
    /* تقليل التأثيرات للأداء الأفضل */
    animation-duration: 4s;
  }

  .loading-overlay {
    backdrop-filter: blur(3px);
    /* تقليل الضبابية */
  }
}