/* --- المتغيرات الأساسية مع تقنيات التجاوب الفائق --- */
:root {
  --primary-green: #03a3ff;
  --accent-gold: #F4C542;
  --accent-red: #C8102E;
  --bg: #f7f9f7;
  --text: #0b0b0b;
  --muted: #555;
  --card-bg: #ffffff;
  --radius: 12px;
  
  /* هوامش مرنة تتغير بناءً على حجم الشاشة */
  --gap: clamp(0.5rem, 2vw, 1.5rem);
  --container-padding: clamp(1rem, 5vw, 3rem);
  
  /* أحجام نصوص ذكية */
  --base-font: clamp(0.95rem, 0.9rem + 0.2vw, 1.1rem);
  --h1-size: clamp(1.8rem, 5vw, 3rem);
  --h2-size: clamp(1.4rem, 4vw, 2.2rem);
}

/* --- القواعد العامة --- */
* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: var(--base-font);
  line-height: 1.6;
  overflow-x: hidden; /* منع التمرر الأفقي نهائياً */
  -webkit-font-smoothing: antialiased;
}

/* --- الصور والفيديوهات المتجاوبة --- */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:not(.welcome-logo):not(.logo) {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

img:hover:not(.welcome-logo) { 
  transform: scale(1.02); 
}

/* --- الهيدر (Site Header) --- */
.site-header {
  display: flex;
  flex-wrap: wrap; /* للسماح بنزول العناصر في الشاشات الصغيرة جداً */
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 1rem var(--container-padding);
  background: linear-gradient(90deg, var(--primary-green), #0286d4);
  color: #fff;
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
}

.logo {
  width: clamp(60px, 15vw, 110px); /* حجم اللوجو يتغير بتناسب مع الشاشة */
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: clamp(4px, 1vw, 8px);
  animation: pulse 3s infinite;
}

@keyframes pulse { 
  0%, 100% { transform: scale(1); } 
  50% { transform: scale(1.04); } 
}

/* --- أزرار التحكم واللغة --- */
.controls { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  flex-wrap: wrap;
}

.controls select, .btn { 
  padding: 0.6rem 1rem; 
  border-radius: 8px; 
  border: 0; 
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn { 
  background: var(--accent-gold); 
  transition: filter 0.2s;
}

.btn:active { transform: scale(0.95); }

/* --- منطقة الـ Hero --- */
.hero { 
  position: relative; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  text-align: center;
  padding: var(--container-padding);
  min-height: 60vh; /* تأخذ 60% من ارتفاع الشاشة */
  overflow: hidden; 
}

.hero-video-container { 
  position: absolute; 
  inset: 0; 
  z-index: 0; 
}

.hero-video { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  filter: brightness(0.7); /* تغميق الفيديو لتوضيح الخط */
}

.hero-text { 
  position: relative; 
  z-index: 2; 
  max-width: 800px; 
  color: #fff; 
}

.hero-text h2 { 
  font-size: var(--h1-size); 
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* --- الأقسام والشبكات (Grids) --- */
.section { 
  padding: var(--container-padding); 
}

/* شبكة مرنة للخدمات والصور */
.cards, .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

/* تعديل خاص للصور لتكون متناسقة */
.gallery-grid img {
  height: 250px;
  object-fit: cover;
  width: 100%;
}

.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- منطقة الميناء (Port) --- */
.port-area {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.port-photo, .port-map {
  flex: 1 1 350px; /* يتمدد ويتقلص، وينكسر لسطر جديد عند 350px */
  min-height: 300px;
}

.port-map iframe {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: none;
}

/* --- نموذج الاتصال (Contact Form) --- */
.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
}

.contact-form .row {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.2rem;
}

.contact-form input, .contact-form select, .contact-form textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem; /* يمنع الزوم التلقائي في آيفون */
}

/* --- التذييل (Footer) --- */
/* --- تنسيق الفوتر الاحترافي --- */
.site-footer {
  background-color: #f9f9f9; /* لون خلفية هادئ */
  border-top: 1px solid #e0e0e0;
  padding: 3rem 1rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.95rem;
  color: #555;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* مسافة بين الأقسام */
  max-width: 800px;
  margin: 0 auto;
}

/* تنسيق قسم الاتصال */
.contact-section-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* تنسيق الروابط (الهاتف والايميل) */
.highlight-link {
  color: #03a3ff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}
.highlight-link:hover {
  color: #0077b5;
  text-decoration: underline;
}

/* ضبط حجم الأيقونات الصغيرة (واتساب وايميل بجانب النص) */
.icon-wrapper img {
  width: 20px !important;
  height: 20px !important;
  vertical-align: middle;
  transform: translateY(2px); /* محاذاة دقيقة مع النص */
}

/* تنسيق أزرار السوشيال ميديا */
.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 0.5rem;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: #03a3ff;
}

.social-btn img {
  width: 20px !important; /* حجم ثابت للأيقونات */
  height: 20px !important;
  object-fit: contain;
}

/* تمييز زر الواتساب في السوشيال ميديا */
.social-btn.whatsapp {
  background-color: #f0fff4;
  border-color: #25D366;
}

/* --- شاشة الترحيب (Welcome Screen) --- */
#welcome {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0077be, #1e90ff);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.logo-square {
  width: clamp(150px, 40vw, 220px);
  height: clamp(150px, 40vw, 220px);
  background: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: greet 2.5s ease-in-out forwards;
}

/* --- شاشات الموبايل الصغيرة جداً --- */
@media (max-width: 480px) {
  .site-header {
    justify-content: center;
    text-align: center;
  }
  .brand { flex-direction: column; }
  .controls { justify-content: center; width: 100%; }
  .btn { width: 100%; } /* أزرار عريضة لسهولة اللمس */
  .hero { min-height: 50vh; }
}

/* --- خاصية الرفع (File Upload) --- */
.custom-file-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- تصحيح أحجام الأيقونات في الفوتر --- */

/* 1. تصغير أيقونة الواتساب بجانب رقم الهاتف */
.whatsapp-text-link img {
    width: 20px !important;
    height: 20px !important;
}

/* 2. تصغير أيقونة البريد الإلكتروني (في حال كانت صورة) */
.footer-email img, 
.footer-email .email-link img {
    width: 20px !important;
    height: 20px !important;
}

/* 3. ضبط حجم الأيقونات داخل دوائر التواصل الاجتماعي */
.social-links a img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain;
}

/* --- رابط دخول الموظفين --- */
.employee-login-link {
  align-self: center;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid #ddd;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  background: #fff;
  display: inline-block;
}

.employee-login-link:hover {
  border-color: var(--primary-green);
  color: var(--primary-green);
  box-shadow: 0 2px 8px rgba(3, 163, 255, 0.15);
}