/* إعدادات أساسية */
body {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  background-color: #000;
  color: white;
  scroll-behavior: smooth;
  overflow-x: hidden; /* منع scroll الأفقي - مهم للجوال */
}

/* الهيدر */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: black;
  padding: 10px 30px;
  position: relative;
}

.logo {
  height: 90px;
  margin-right: 10px;
}

/* زر الهامبرقر للجوال */
.hamburger {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
  margin-left: 15px;
}

.nav-links {
  display: flex;
  gap: 25px;
}

.nav-links a {
  text-decoration: none;
  color: white;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #e60000;
}

/* قسم البطل - مُحدث للجوال */
.hero {
  background-image: url('cars-background.jpeg');
  background-size: cover;
  background-position: center center; /* للديسكتوب */
  background-repeat: no-repeat;
  height: 100vh;
  min-height: 500px; /* ارتفاع أدنى */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  width: 100%;
}

.overlay {
  background-color: rgba(0, 0, 0, 0.6); /* شفافية أكبر للوضوح */
  padding: 40px;
  border-radius: 10px;
  backdrop-filter: blur(2px); /* تأثير blur خفيف */
  max-width: 90%;
  z-index: 2;
}

.overlay h1 {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 20px;
}

.overlay p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0;
}

.hero-button {
  margin-top: 20px;
  background-color: #e60000;
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: background 0.3s ease;
}

.hero-button:hover {
  background-color: #c40000;
}

/* قسم الاشتراك */
.subscribe {
  background-color: #111;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.subscribe input[type="email"] {
  padding: 10px;
  width: 250px;
  border: none;
  border-radius: 5px;
  margin-left: 10px;
}

.subscribe button {
  padding: 10px 20px;
  background-color: #e60000;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
}

/* الفوتر */
footer {
  background-color: #000;
  color: #aaa;
  padding: 25px 20px;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid #333;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.footer-icons i {
  font-size: 24px;
  color: white;
  transition: transform 0.3s ease, color 0.3s ease;
}

.footer-icons i:hover {
  color: #e60000;
  transform: scale(1.2);
}

/* من نحن */
.about-title {
  text-align: center;
  font-size: 38px;
  margin-top: 50px;
}

.about-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px auto;
}

.about-tab {
  padding: 10px 20px;
  background-color: transparent;
  color: white;
  font-weight: bold;
  border: 1px solid #e60000;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.about-tab:hover,
.about-tab.active {
  background-color: #e60000;
  color: white;
}

.about-content {
  max-width: 750px;
  margin: 30px auto;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 15px;
  font-size: 17px;
  line-height: 1.9;
  color: #eee;
  text-align: right;
}

.about-box {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.about-box.active {
  display: block;
}

/* الرسالة */
#successMsg {
  margin-top: 20px;
  color: white;
  font-weight: bold;
  display: none;
}

/* ميديا: التابلت */
@media (max-width: 1024px) {
  .hero {
    background-position: center center;
    height: 80vh;
  }
  
  .overlay {
    padding: 35px 25px;
  }
}

/* ميديا: الجوال الكبير */
@media (max-width: 768px) {
  /* إصلاح المشكلة الأساسية للجوال */
  .hero {
    background-position: center bottom; /* نركز على الجزء السفلي للسيارات */
    background-size: cover;
    height: 100vh;
    background-attachment: scroll; /* مهم للجوال */
  }

  .nav-links {
    flex-direction: column;
    position: absolute;
    top: 80px;
    right: 0;
    background-color: #000;
    width: 100%;
    display: none;
    text-align: center;
    padding: 20px 0;
    z-index: 99;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .logo {
    height: 70px;
  }

  .overlay {
    padding: 30px 15px;
    max-width: 95%;
    background-color: rgba(0, 0, 0, 0.7);
  }

  .overlay h1 {
    font-size: 26px;
  }

  .overlay p {
    font-size: 16px;
  }

  .hero-button {
    font-size: 14px;
    padding: 10px 20px;
  }

  .about-title {
    font-size: 28px;
  }

  .about-content {
    padding: 20px;
    font-size: 15px;
    margin: 20px 15px;
  }

  .subscribe input[type="email"] {
    width: 200px;
    margin: 0 0 10px 0;
  }
}

/* ميديا: الجوال الصغير */
@media (max-width: 480px) {
  .hero {
    /* للجوالات الصغيرة - نأكد أن الصورة تظهر بشكل صحيح */
    background-position: center center;
    background-size: cover;
    height: 100vh;
    min-height: 600px;
  }

  .overlay {
    padding: 25px 10px;
    margin: 0 10px;
  }

  .overlay h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  .overlay p {
    font-size: 14px;
    line-height: 1.5;
  }

  .hero-button {
    font-size: 13px;
    padding: 8px 16px;
  }

  .logo {
    height: 60px;
  }

  header {
    padding: 10px 15px;
  }

  .subscribe input[type="email"] {
    width: 100%;
    max-width: 250px;
    margin-bottom: 15px;
  }

  .subscribe button {
    width: 100%;
    max-width: 200px;
  }
}

/* إصلاح مشاكل إضافية للـ iOS Safari */
@media (max-width: 768px) {
  .hero {
    /* لحل مشكلة الارتفاع في iOS Safari */
    height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* تحسين للشاشات عالية الدقة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero {
    /* يمكن إضافة صورة بدقة أعلى هنا */
    background-image: url('cars-background.jpeg'); /* أو صورة HD */
  }
}

/* تحريك */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}