/* السلايدر الأساسي */
.sref-slider {
  width: 100%;
  height: 500px !important ;
  position: relative;
  overflow: hidden;
  visibility: hidden; /* مخفي عند التحميل */
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.sref-slider.ready {
  visibility: visible;
  opacity: 1;
}

.sref-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 500px !important ;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.sref-slide.active {
  opacity: 1;
  z-index: 1;
}

.sref-slide-img {
  width: 100%;
  height: 500px !important ;
  object-fit: cover;
  display: block;
}

/* تأثيرات النص */
@keyframes textGlow {
  0%   { color: #fff; text-shadow: 0 0 4px rgba(255,255,255,0.7); }
  50%  { color: #ffeb3b; text-shadow: 0 0 12px rgba(255,255,0,0.9); }
  100% { color: #fff; text-shadow: 1px 1px 4px rgba(0,0,0,0.7); }
}

/* العنوان الأساسي */
.sref-title {
  position: absolute;
  bottom: 2px !important;              /* أسفل الصورة */
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 22px;           /* الافتراضي للشاشات الكبيرة */
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
  opacity: 0;
  min-width: 70%;            /* عرض أكبر لتفادي انكسار النص */
  max-width: 90%;
  background: linear-gradient(45deg, #ff0000, #000); /* خلفية ثابتة أحمر + أزرق */
}

/* للشاشات أصغر من 1024px */
@media (max-width: 1024px) {
  .sref-slider,
  .sref-slide,
  .sref-slide-img {
    height: 290px;           /* ارتفاع أصغر للشاشات الصغيرة */
  }

  .sref-title {
    font-size: 16px;         /* أصغر للشاشات الصغيرة */
    padding: 10px 14px;
    min-width: 95%;          /* زيادة العرض للشاشات الصغيرة */
  }
}

/* الحركات */
@keyframes fadeUp   { from { opacity:0; transform:translate(-50%,-40%);} to { opacity:1; transform:translate(-50%,-50%);} }
@keyframes fadeLeft { from { opacity:0; transform:translate(-60%,-50%);} to { opacity:1; transform:translate(-50%,-50%);} }
@keyframes fadeRight{ from { opacity:0; transform:translate(-40%,-50%);} to { opacity:1; transform:translate(-50%,-50%);} }
@keyframes fadeZoom { from { opacity:0; transform:translate(-50%,-50%) scale(0.8);} to { opacity:1; transform:translate(-50%,-50%) scale(1);} }
@keyframes fadeRotate{ from { opacity:0; transform:translate(-50%,-50%) rotate(-10deg);} to { opacity:1; transform:translate(-50%,-50%) rotate(0deg);} }
@keyframes fadeDown { from { opacity:0; transform:translate(-50%,-60%);} to { opacity:1; transform:translate(-50%,-50%);} }
@keyframes fadeSkew { from { opacity:0; transform:translate(-50%,-50%) skewX(10deg);} to { opacity:1; transform:translate(-50%,-50%) skewX(0deg);} }

/* تطبيق الحركات */
.sref-slide.active:nth-child(1) .sref-title { animation:fadeUp 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(2) .sref-title { animation:fadeLeft 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(3) .sref-title { animation:fadeRight 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(4) .sref-title { animation:fadeZoom 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(5) .sref-title { animation:fadeRotate 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(6) .sref-title { animation:fadeDown 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }
.sref-slide.active:nth-child(7) .sref-title { animation:fadeSkew 1s ease forwards,textGlow 1.5s ease; animation-delay:0.5s; }

/* أزرار التنقل */
.sref-prev, .sref-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  padding: 12px;
  margin-top: -22px;
  color: #fff;
  font-weight: bold;
  font-size: 22px;
  transition: 0.3s;
  user-select: none;
  background: rgba(0,0,0,0.4);
  border: none;
  outline: none;
}

.sref-next { right: 0; }
.sref-prev { left: 0; }

.sref-prev:hover, .sref-next:hover {
  background-color: rgba(0,0,0,0.7);
}
