/* مساحة إعلانية احترافية - Master Splinter */

/* تأكد من أن المحتوى الرئيسي يبدأ بعد المساحة الإعلانية */
main {
  position: relative;
  z-index: 1;
}

.promo-banner {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #82cfe2 0%, #4aa0ba 100%);
  overflow: hidden;
  z-index: 100; /* أقل من الهيدر */
  margin-top: 0;
  padding-top: 110px; /* مسافة أكبر بين الهيدر والمساحة الإعلانية */
  animation: slideDown 0.8s ease-out;
  box-sizing: border-box;
  clear: both; /* تأكد من عدم التداخل مع عناصر عائمة */
  display: block !important; /* تأكد من الظهور دائماً */
  visibility: visible !important;
  opacity: 1 !important;
  transition: all 0.3s ease-in-out;
}

/* إخفاء كامل للمساحة الإعلانية */
.promo-banner.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* تأثير الانزلاق عند الظهور */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* تأكد من أن الهيدر لا يغطي المساحة الإعلانية */
.site-header {
  z-index: 10000; /* أعلى من المساحة الإعلانية */
}

/* الحاوي الرئيسي */
.promo-banner__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: center;
  min-height: 140px;
}

/* القسم الرئيسي */
.promo-banner__main {
  display: flex;
  align-items: center;
  gap: 25px;
  color: white;
}

/* ترتيب العناصر في النسخة العربية - العداد على اليمين */
html[dir="rtl"] .promo-banner__main {
  flex-direction: row !important;
  justify-content: space-between !important;
}

html[dir="rtl"] .promo-banner__timer-section {
  order: -1 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[dir="rtl"] .promo-banner__content {
  order: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex: 1 !important;
  text-align: center !important;
}

/* ترتيب العناصر في النسخة الإنجليزية - العداد على الشمال */
html[dir="ltr"] .promo-banner__main {
  flex-direction: row !important;
  justify-content: space-between !important;
}

html[dir="ltr"] .promo-banner__timer-section {
  order: -1 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[dir="ltr"] .promo-banner__content {
  order: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex: 1 !important;
  text-align: center !important;
}

/* قسم العداد التنازلي */
.promo-banner__timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 160px;
  flex-shrink: 0;
}

.promo-banner__shop {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #82cfe2 0%, #4aa0ba 100%);
  color: #0f2942;
  border: none;
  border-radius: 25px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promo-banner__shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #7bc2d3 0%, #3f97b1 100%);
}

.promo-banner__shop i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.promo-banner__shop:hover i {
  transform: translateX(3px);
}

/* تأكيد إضافي للترتيب */
html[dir="rtl"] .promo-banner__timer-section {
  align-self: flex-start !important;
}

html[dir="ltr"] .promo-banner__timer-section {
  align-self: flex-start !important;
}

.promo-banner__flash-text {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* العداد التنازلي */
.promo-banner__timer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Poppins', sans-serif;
}

.timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: #4aa0ba;
  border-radius: 8px;
  padding: 5px 8px;
  min-width: 30px;
}

.timer-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.timer-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.timer-separator {
  font-size: 18px;
  font-weight: 700;
  color: white;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* محتوى العرض */
.promo-banner__content {
  flex: 1;
}

.promo-banner__title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  transition: opacity 0.3s ease;
}

.promo-banner__subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 15px 0;
  line-height: 1.4;
  transition: opacity 0.3s ease;
}

.promo-banner__features {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.promo-feature {
  font-size: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

/* زر الحث على العمل */
.promo-banner__cta {
  background: white;
  color: #4aa0ba;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.promo-banner__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #f8f9fa;
}

.promo-banner__cta i {
  transition: transform 0.3s ease;
}

.promo-banner__cta:hover i {
  transform: translateX(3px);
}

/* العروض الثانوية */
.promo-banner__secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.promo-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-3px);
}

.promo-card__icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4aa0ba;
  font-size: 18px;
}

.promo-card__content h3 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.promo-card__content p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.3;
}

/* شارات العروض */
.promo-card__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: bounce 2s infinite;
}

.promo-card__badge--hot {
  background: #ff6b35;
}

.promo-card__badge--premium {
  background: #ffd700;
  color: #333;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

/* تم إزالة زر الإغلاق */

/* التأثيرات البصرية */
.promo-banner__effects {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.promo-effect {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.promo-effect--1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.promo-effect--2 {
  width: 60px;
  height: 60px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.promo-effect--3 {
  width: 40px;
  height: 40px;
  top: 30%;
  right: 30%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(120deg); }
  66% { transform: translateY(5px) rotate(240deg); }
}

/* الوضع المظلم */
[data-theme="dark"] .promo-banner {
  background: linear-gradient(135deg, #1a2332 0%, #0a0e13 100%);
}

[data-theme="dark"] .promo-banner__flash,
[data-theme="dark"] .promo-card {
  background: rgba(130, 207, 226, 0.15);
  border-color: rgba(130, 207, 226, 0.3);
}

[data-theme="dark"] .promo-banner__cta {
  background: #82cfe2;
  color: #0a0e13;
}

[data-theme="dark"] .promo-banner__cta:hover {
  background: #4aa0ba;
  color: white;
}

[data-theme="dark"] .timer-unit {
  background: rgba(130, 207, 226, 0.9);
  color: #0a0e13;
}

[data-theme="dark"] .promo-card__icon {
  background: rgba(130, 207, 226, 0.9);
  color: #0a0e13;
}

/* التصميم المتجاوب */
@media (max-width: 1024px) {
  .promo-banner {
    padding-top: 100px; /* مسافة مناسبة للتابلت */
  }
  
  .promo-banner__container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }
  
  .promo-banner__secondary {
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
  }
  
  .promo-card {
    min-width: 200px;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .promo-banner {
    padding-top: 95px; /* مسافة مناسبة للموبايل */
  }
  
  .promo-banner__container {
    padding: 12px;
    min-height: auto;
  }
  
  .promo-banner__main {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .promo-banner__flash {
    flex-direction: row;
    gap: 15px;
    padding: 10px 15px;
    min-width: auto;
  }
  
  .promo-banner__title {
    font-size: 22px;
  }
  
  .promo-banner__subtitle {
    font-size: 14px;
  }
  
  .promo-banner__features {
    justify-content: center;
    gap: 8px;
  }
  
  .promo-feature {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  .promo-banner__cta {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .promo-banner__secondary {
    flex-direction: column;
    gap: 8px;
  }
  
  .promo-card {
    padding: 12px;
    min-width: auto;
  }
  
  .promo-card__content h3 {
    font-size: 13px;
  }
  
  .promo-card__content p {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .promo-banner {
    padding-top: 90px; /* مسافة للشاشات الصغيرة جداً */
  }
  
  .promo-banner__container {
    padding: 10px;
  }
  
  .promo-banner__title {
    font-size: 18px;
  }
  
  .promo-banner__flash {
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }
  
  .timer-unit {
    padding: 3px 6px;
    min-width: 25px;
  }
  
  .timer-value {
    font-size: 14px;
  }
  
  .timer-label {
    font-size: 9px;
  }
  
  .promo-banner__features {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  
  .promo-card {
    padding: 10px;
  }
  
  .promo-card__icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* تأثير الإخفاء */
.promo-banner.hiding {
  animation: slideUp 0.5s ease-in forwards;
}

@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* إخفاء المساحة الإعلانية - فقط عند الإغلاق اليدوي */
.promo-banner.hidden {
  display: none;
}

/* إعادة إظهار المساحة الإعلانية - قوة أعلى */
.promo-banner:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* تأثيرات إضافية للعناصر التفاعلية */
.promo-banner__flash:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.promo-banner__timer:hover .timer-unit {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* تحسين الخطوط للغة العربية */
[lang="ar"] .promo-banner__title,
[lang="ar"] .promo-banner__subtitle,
[lang="ar"] .promo-feature,
[lang="ar"] .promo-card__content h3,
[lang="ar"] .promo-card__content p {
  font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* تحسين الاتجاه للغة العربية */
[dir="rtl"] .promo-banner__main {
  flex-direction: row-reverse;
}

[dir="rtl"] .promo-banner__cta i {
  transform: scaleX(-1);
}

[dir="rtl"] .promo-banner__cta:hover i {
  transform: scaleX(-1) translateX(3px);
}

[dir="rtl"] .promo-card:hover {
  transform: translateX(3px);
}


/* تأثيرات الأداء */
.promo-banner * {
  will-change: transform;
}

.promo-banner__container {
  contain: layout style paint;
}

/* تأثيرات إضافية للتفاعل */
.promo-banner__flash:hover .promo-banner__flash-text {
  animation: flashGlow 1s ease-in-out;
}

@keyframes flashGlow {
  0%, 100% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
  50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.3); }
}

/* تأثير التدرج المتحرك للخلفية */
.promo-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* تأثير النبض للشارات */
.promo-card__badge {
  animation: badgePulse 2s infinite, bounce 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  50% { 
    box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
  }
}

.promo-card__badge--hot {
  animation: badgePulseHot 2s infinite, bounce 2s infinite;
}

@keyframes badgePulseHot {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
  }
  50% { 
    box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
  }
}

.promo-card__badge--premium {
  animation: badgePulsePremium 2s infinite, bounce 2s infinite;
}

@keyframes badgePulsePremium {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
  }
  50% { 
    box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
  }
}

/* تأثير الجسيمات المتحركة */
.promo-banner__effects::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.2), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkle 20s linear infinite;
  pointer-events: none;
}

@keyframes sparkle {
  0% { transform: translateX(0); }
  100% { transform: translateX(200px); }
}

/* تأثير التمويج عند التمرير */
.promo-banner:hover::before {
  animation: shimmer 1s ease-in-out;
}

/* تحسين الأداء للأجهزة المحمولة */
@media (max-width: 768px) {
  .promo-banner::before,
  .promo-banner__effects::after {
    display: none; /* إزالة التأثيرات الثقيلة على الموبايل */
  }
  
  .promo-card__badge {
    animation: bounce 2s infinite; /* تأثير أبسط */
  }
  
  .promo-card__badge--hot,
  .promo-card__badge--premium {
    animation: bounce 2s infinite;
  }
}

/* تأثير الضغط للأزرار */
.promo-banner__cta:active {
  transform: translateY(-1px) scale(0.98);
}

.promo-card:active {
  transform: scale(0.98);
}


/* تأثير التركيز للوصولية */
.promo-banner__cta:focus,
.promo-card:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* تحسين الخطوط للقراءة */
.promo-banner__title,
.promo-banner__subtitle {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* تأثير الظهور المتدرج للعناصر */
.promo-banner__main {
  animation: slideInLeft 0.8s ease-out 0.2s both;
}

.promo-banner__secondary {
  animation: slideInRight 0.8s ease-out 0.4s both;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* CSS قوي لضمان ترتيب العداد - أولوية عالية جداً */
body[dir="rtl"] .promo-banner__main,
html[dir="rtl"] body .promo-banner__main {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

body[dir="rtl"] .promo-banner__timer-section,
html[dir="rtl"] body .promo-banner__timer-section {
  order: -10 !important;
  margin-right: auto !important;
  margin-left: 0 !important;
}

body[dir="rtl"] .promo-banner__content,
html[dir="rtl"] body .promo-banner__content {
  order: 10 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  flex: 1 !important;
}

/* تأثير خاص للعداد التنازلي */
.timer-unit {
  animation: timerBounce 1s ease-in-out infinite alternate;
}

@keyframes timerBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* إيقاف التأثيرات عند تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .promo-banner,
  .promo-banner *,
  .promo-banner::before,
  .promo-banner__effects::after {
    animation: none !important;
    transition: none !important;
  }
}
