/* =====================================================
   1. إعدادات الموقع العامة + المتغيرات (Global Variables)
   هنا نضع الألوان وأرقام الهواتف لتتغير في الموقع بالكامل
===================================================== */
:root {
  /* --- 📞 بيانات الاتصال (غيرها هنا تتغير في كل الصفحات) --- */
  --phone-main: "(013) 346 2601";
  --fax-main:   "(013) 346 2601";
  --email-main: "info@arabmarina.com.sa";
  --web-main:   "www.arabmarina.com.sa";

  /* --- 🎨 الألوان والخطوط --- */
  --primary: #364166;        /* اللون الأزرق الداكن (لون الهوية الرسمي) */
  --primary-hover: #2a3352; /* لون أغمق قليلاً عند تمرير الماوس */
  --dark: #1a1a1a;           /* اللون الأسود للنصوص */
  --text: #666;              /* اللون الرمادي للنصوص الفرعية */
  --text-light: #ddd;        /* لون النصوص الفاتحة (في الفوتر) */
  --bg-light: #f5f7fb;       /* لون خلفية فاتح للأقسام */
  
  /* --- ⚙️ إعدادات الحركة والقياسات --- */
  --transition: 0.3s ease;
  --radius: 6px;
  --font-main: "Roboto", Arial, sans-serif;
  --topbar-height: 45px;
}

/* كلاسات برمجية لاستدعاء البيانات تلقائياً في HTML */
.insert-phone::after { content: var(--phone-main); }
.insert-fax::after   { content: var(--fax-main); }
.insert-email::after { content: var(--email-main); }
.insert-web::after   { content: var(--web-main); }

/* تصفير الهوامش لجميع العناصر */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-main);
  line-height: 1.6;
  background: #fff;
  color: var(--text);
  overflow-x: hidden; /* يمنع ظهور شريط تمرير سفلي مزعج */
}

/* =====================================================
   2. شاشة التحميل (LOADER)
   المربعات التي تظهر قبل فتح الموقع
===================================================== */
.loader-wrapper {
  background: #fff;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 999999; display: flex; align-items: center; justify-content: center;
}
.sk-cube-grid { width: 60px; height: 60px; }
.sk-cube-grid .sk-cube {
  width: 33%; height: 33%; background-color: var(--primary); float: left;
  animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
}
/* توقيتات حركة المربعات */
.sk-cube1 { animation-delay: 0.2s; } .sk-cube2 { animation-delay: 0.3s; }
.sk-cube3 { animation-delay: 0.4s; } .sk-cube4 { animation-delay: 0.1s; }
.sk-cube5 { animation-delay: 0.2s; } .sk-cube6 { animation-delay: 0.3s; }
.sk-cube7 { animation-delay: 0s; }   .sk-cube8 { animation-delay: 0.1s; }
.sk-cube9 { animation-delay: 0.2s; }

@keyframes sk-cubeGridScaleDelay {
  0%, 70%, 100% { transform: scale3D(1, 1, 1); } 
  35% { transform: scale3D(0, 0, 1); }
}

/* =====================================================
   3. هيكل الهيدر (HEADER ARCHITECTURE)
   يشمل الشريط العلوي والقائمة الرئيسية
===================================================== */
header {
  position: absolute; top: 0; left: 0; width: 100%; z-index: 1000; background: transparent;
}

/* --- الشريط العلوي (Topbar) --- */
.topbar {
  width: 100%; height: var(--topbar-height);
  background: rgba(0,0,0,0.2); /* خلفية سوداء شفافة */
  backdrop-filter: blur(4px);    /* تأثير ضبابي خفيف */
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; z-index: 1001; position: relative;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #eee; font-size: 13px; text-decoration: none; transition: var(--transition); margin: 0 5px; }
.topbar a:hover { color: var(--primary-hover); }

/* --- القائمة الرئيسية (Navbar) --- */
.navbar.main-nav {
  width: 100%; padding: 0; background: transparent; transition: all 0.4s ease;
}
.navbar .container {
  /* 🔥 هنا عكسنا الترتيب: الشعار يمين والقائمة يسار */
  flex-direction: row-reverse; 
}

/* 🔥 التعديل الهام لإصلاح خطأ جوجل (Aspect Ratio) 🔥 */
.navbar-brand img {
  width: 180px;            /* العرض كما هو محدد في HTML */
  height: auto !important; /* يجبر المتصفح على حساب الطول تلقائياً */
  object-fit: contain;     /* يمنع قص الصورة */
  transition: var(--transition);
}

.nav-link {
  font-size: 15px; font-weight: 600; padding: 25px 15px !important;
  color: #fff !important; text-transform: uppercase; transition: var(--transition);
}
/* ============================
   إصلاح ظهور القوائم في كل الصفحات
============================ */
.nav-link {
  color: #fff !important;   /* كل القوائم باللون الأبيض */
}

.nav-link.active {
  color: #fff !important;   /* القائمة النشطة أيضاً أبيض */
  opacity: 1 !important;
}

.nav-link:hover {
  color: var(--primary) !important; /* الأزرق الرسمي عند المرور */
}

/* --- القائمة المنسدلة (Dropdown - الزجاجية) --- */
.dropdown-menu {
  background: rgba(0, 0, 0, 0.6); /* خلفية سوداء شفافة */
  backdrop-filter: blur(10px);    /* تأثير زجاجي قوي */
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-top: 2px solid var(--primary); /* خط أزرق علوي جمالي */
  border-radius: 0 0 6px 6px;
  padding: 5px 0;
  margin-top: 0;
  min-width: 230px;
}

/* إظهار القائمة عند مرور الماوس (للشاشات الكبيرة فقط) */
@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-menu {
    display: block; animation: fadeIn 0.4s ease;
  }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-item {
  color: #fff;
  padding: 12px 20px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: var(--primary); /* يصبح الخلفية زرقاء عند التحديد */
  color: #fff;
  padding-left: 25px; /* حركة انزلاق للنص */
}

/* --- الهيدر الثابت عند التمرير (Sticky Header) --- */
.main-nav.sticky {
  position: fixed; top: 0; left: 0; width: 100%;
  background: rgba(255, 255, 255, 0.98) !important; /* يصبح أبيض */
  box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 0; z-index: 9999;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* تغيير ألوان النصوص في الوضع الثابت */
.main-nav.sticky .nav-link { color: #333 !important; }
.main-nav.sticky .nav-link:hover { color: var(--primary) !important; }
.main-nav.sticky .dropdown-menu { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-top-color: var(--primary); }
.main-nav.sticky .dropdown-item { color: #333; border-bottom: 1px solid #eee; }
.main-nav.sticky .dropdown-item:hover { background: var(--primary); color: #fff; }


/* =====================================================
   4. أقسام الصفحة وتخطيط المحتوى (SECTIONS)
===================================================== */

/* --- السلايدر الرئيسي (Home Slider) --- */
.home-slider { 
  position: relative; 
  width: 100%; 
  height: 85vh; /* ارتفاع السلايدر (أقل قليلاً من الشاشة الكاملة لرفع المحتوى) */
  min-height: 600px; 
  margin-top: 0 !important; 
  padding: 0; 
}
.mySwiper, .mySwiper img { width: 100%; height: 100%; object-fit: cover; }

/* تظليل خفيف فوق صور السلايدر لتحسين قراءة النص */
.swiper-slide::after {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.1)); z-index: 5; pointer-events: none;
}

.slide-caption {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: #fff; z-index: 10; width: 90%;
}
.slide-caption h2 { font-size: 48px; font-weight: 700; text-transform: uppercase; text-shadow: 0 4px 10px rgba(0,0,0,0.6); }

/* أزرار التنقل يمين ويسار */
.swiper-button-next, .swiper-button-prev { color: #fff !important; }

/* --- نقاط التنقل السفلية (Pagination Bullets) --- */
.swiper-pagination-bullet { 
    width: 16px !important;       /* حجم مناسب للمس */
    height: 16px !important;
    margin: 8px !important;       /* تباعد بين النقاط */
    background: rgba(255, 255, 255, 0.6) !important; /* لون النقاط غير النشطة (أبيض شفاف) */
    opacity: 1 !important;
}

.swiper-pagination-bullet-active { 
    /* 🔥 الخيار الحالي في ملفك (الأزرق) */
    background: var(--primary) !important; 
    transform: scale(1.2); /* تكبير بسيط للنقطة النشطة */
}

/* --- البانر الداخلي للصفحات الفرعية --- */
.inner-banner {
  width: 100%; height: 380px; background-size: cover; background-position: center; position: relative;
}
.inner-banner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
}

/* --- العناوين والأزرار --- */
.section-title { font-size: 28px; font-weight: 700; margin-bottom: 35px; text-transform: uppercase; color: var(--dark); text-align: center; }
.home-company { padding: 80px 0; background: #fff; }
.home-services { padding: 80px 0; background: #f8f9fa; }

.btn-primary { 
  background-color: var(--primary); 
  border-color: var(--primary); 
  padding: 10px 30px; 
}
.btn-primary:hover { 
  background-color: var(--primary-hover); 
  border-color: var(--primary-hover); 
}

/* --- تنسيقات إضافية (Sidebar, Cards, Tables) --- */
.sidebar-links { background: #fff; border-radius: 8px; border: 1px solid #eee; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.sidebar-links a { display: block; padding: 15px 20px; color: var(--text); text-decoration: none; border-bottom: 1px solid #eee; transition: 0.3s; }
.sidebar-links a:hover, .sidebar-links li.active a { background: var(--primary); color: #fff; padding-left: 25px; }

.project-card, .policy-card, .management-card { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-bottom: 30px; border-bottom: 3px solid var(--primary); }

.table-custom thead th { background-color: var(--primary); color: #fff; padding: 15px; }
.table-custom tbody tr:nth-of-type(odd) { background-color: #f8f9fa; }

/* =====================================================
   5. الفوتر (FOOTER)
   القسم السفلي للموقع
===================================================== */
.footer { 
  background: var(--primary); /* اللون الأزرق الداكن */
  padding: 70px 0 40px; 
  color: #eee; 
}
.footer .widget-title { 
  font-size: 18px; font-weight: 700; margin-bottom: 25px; color: #fff; 
  border-bottom: 2px solid rgba(255,255,255,0.3); display: inline-block; padding-bottom: 5px; 
}
.footer ul { list-style: none; padding: 0; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: #ccc; text-decoration: none; transition: var(--transition); }
.footer ul li a:hover { color: #fff; padding-left: 5px; }
.footer .contact-info { margin-bottom: 15px; display: flex; align-items: start; }
.footer .contact-info i { color: #fff; margin-right: 10px; margin-top: 5px; opacity: 0.7; }

/* شريط الحقوق */
.copyright { background: #2a3352; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.copyright p { color: #ccc; font-size: 14px; margin: 0; text-align: center; }

/* زر الصعود للأعلى (Back to Top) */
.cd-top {
  position: fixed; bottom: 30px; right: 30px; height: 45px; width: 45px; line-height: 45px; text-align: center;
  color: #fff; background: var(--primary); border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  opacity: 0; visibility: hidden; transition: 0.3s; z-index: 999; text-decoration: none; font-size: 20px;
  border: 2px solid #fff; 
}
.cd-top.cd-is-visible { opacity: 1; visibility: visible; }
.cd-top:hover { background: #fff; color: var(--primary); transform: translateY(-5px); }


/* =====================================================
   6. تحسينات الجوال (MOBILE RESPONSIVE FIXES)
   إصلاح المشاكل على الشاشات الصغيرة
===================================================== */
@media (max-width: 992px) {
  /* إعادة ترتيب الهيدر في الجوال ليكون طبيعياً (زر يمين وشعار يسار) */
  .navbar .container { flex-direction: row; } 
  
  /* تنسيق القائمة المنسدلة في الجوال */
  .navbar-collapse { background: #fff; padding: 20px; border-radius: 8px; margin-top: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
  .nav-link { color: #333 !important; padding: 10px 15px !important; border-bottom: 1px solid #eee; }
  .dropdown-menu { display: none; background: #f8f9fa; box-shadow: none; padding-left: 15px; border: none; }
  .nav-item.dropdown.show .dropdown-menu { display: block; }
  .dropdown-item { color: #333; }
  .dropdown-item:hover { background: transparent; color: var(--primary); padding-left: 20px; }
  
  /* تعديل ارتفاع السلايدر والبانر */
  .home-slider { height: 550px; }
  .inner-banner { height: 250px !important; }
}

@media (max-width: 768px) {
  /* توسيط المحتوى في الجوال */
  .topbar .container { justify-content: center; flex-direction: column; gap: 5px; }
  .home-slider { height: 450px; }
  .slide-caption h2 { font-size: 24px; }
  .footer, .home-company, .home-services { text-align: center; }
  .footer .contact-info { justify-content: center; }
  
  /* ضمان عدم خروج الصور عن الشاشة */
  img { max-width: 100%; height: auto; }
  .navbar-brand img { height: 45px; width: auto; }
  
  /* إصلاح الجدول ليكون قابلاً للسحب */
  .table-responsive { display: block; width: 100%; overflow-x: auto; }
  .table-custom { min-width: 600px; }
}
/* =====================================================
   إضافة هامة جداً لضبط صور السلايدر الجديدة
===================================================== */
.swiper-slide img {
    width: 100%;
    height: 100%;       /* يملأ الارتفاع بالكامل */
    object-fit: cover;  /* يضمن تغطية كاملة بدون تمطيط */
    display: block;     /* يزيل أي فراغات سفلية */
}
.map-section {
    position: relative;
    z-index: 5;
    background: #fff;
    padding: 40px 0;
}

.map-section iframe {
    display: block;
    width: 100%;
}
