/* Custom styles for Tameer Facilities Website */

/* إعدادات عامة */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  font-family: 'Tajawal', sans-serif;
  background: #f7f9fc;
  color: #002244;
  overflow-x: hidden;
  line-height: 1.6;
  max-width: 100vw;
}

/* تحسين الخطوط */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* تحسين الروابط */
a {
  color: #0d6efd;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0056b3;
  text-decoration: none;
}

/* تحسين التفاعل باللمس للأزرار والروابط المهمة فقط */
.btn, .navbar-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-logo-link {
  min-height: 44px;
  display: block;
  align-items: center;
  justify-content: center;
}

/* تحسين الهيدر */
header {
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 15px 0 0;
  position: sticky;
  top: 0;
  z-index: 999;
  transition: all 0.3s ease;
}

header.sticky {
  box-shadow: 0 6px 30px rgba(0,0,0,0.2);
  padding: 10px 0 0;
}

/* إصلاحات التخطيط العامة */
.logo-block {
  text-align: center;
}

.logo-block div {
  font-size: 14px;
  font-weight: bold;
  color: #002244;
  margin-top: 5px;
}

/* إصلاح تخطيط النصوص */
.carousel-caption h2,
.carousel-caption p {
  margin: 0;
  padding: 0;
}

/* إصلاح تخطيط الأقسام */
.section {
  clear: both;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* تحسين الشعارات */
.logo-block img {
  height: 60px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-block img:hover {
  transform: scale(1.05);
}

.logo-block div {
  font-size: 14px;
  font-weight: bold;
  color: #002244;
}

/* تحسين التنقل */
.nav-link {
  color: #002244;
  margin: 0 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  color: #0d6efd;
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #0d6efd;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

/* تحسين الكاروسيل */
#projectsCarousel {
  width: 100%;
  height: 90vh;
  overflow: hidden;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 90vh;
  object-fit: cover;
  filter: brightness(80%);
  transition: all 0.5s ease;
}

.carousel-item:hover img {
  filter: brightness(100%);
  transform: scale(1.02);
}

.carousel-caption {
  background: rgba(0,0,0,0.7);
  padding: 30px;
  border-radius: 15px;
  max-width: 70%;
  backdrop-filter: blur(10px);
}

.carousel-caption h2 {
  color: #fff;
  font-size: 38px;
  margin: 0;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* تحسين الأقسام */
.section {
  padding: 80px 0;
  position: relative;
}

.section-title {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 40px;
  color: #002244;
  position: relative;
  display: inline-block;
  text-align: center;
  width: 100%;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  right: 50%;
  transform: translateX(50%);
  width: 100px;
  height: 5px;
  background: linear-gradient(45deg, #0d6efd, #0056b3);
  border-radius: 5px;
}

/* تحسين الصور */
.board-img {
  width: 100%;
  max-width: 280px;
  height: 280px;
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.board-img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  border-color: #0d6efd;
}

/* تحسين النصوص */
.lead {
  font-size: 20px;
  color: #555;
  line-height: 1.9;
  margin-bottom: 30px;
  text-align: justify;
}

/* تحسين الأزرار */
.btn-primary {
  background: linear-gradient(45deg, #0d6efd, #0056b3);
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  transition: all 0.3s ease;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
}

/* تحسين شعارات الشركاء */
.partner-logo {
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  filter: grayscale(20%);
}

.partner-logo:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  filter: grayscale(0%);
}

.partner-logo-link {
  display: block;
  text-decoration: none;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  text-align: center;
}

/* تحسين الفوتر */
footer {
  background: linear-gradient(135deg, #002244, #003366);
  color: white;
  padding: 60px 0 30px;
  font-size: 14px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #0d6efd, #0056b3, #0d6efd);
}

footer iframe {
  width: 100%;
  height: 250px;
  border: none;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
  .carousel-caption h2 {
    font-size: 24px;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .board-img {
    max-width: 200px;
    height: 200px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  .lead {
    font-size: 16px;
  }
  
  .carousel-caption {
    padding: 20px;
    max-width: 90%;
  }
  
  /* تحسين التنقل على الهواتف */
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-link {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    display: block;
    width: 100%;
  }
  
  .dropdown-menu {
    text-align: center;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  }
  
  /* تحسين الشعارات */
  .logo-block {
    margin-bottom: 15px;
  }
  
  /* تحسين المسافات */
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 576px) {
  .carousel-caption h2 {
    font-size: 20px;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  .logo-block img {
    height: 50px;
  }
  
  .logo-block div {
    font-size: 12px;
  }
  
  .btn-primary {
    padding: 12px 30px;
    font-size: 16px;
  }
  
  /* تحسينات خاصة بالهواتف الصغيرة */
  body {
    font-size: 14px;
  }
  
  .section {
    padding: 30px 0;
  }
  
  .carousel-item img {
    height: 40vh !important;
  }
  
  .navbar-brand {
    font-size: 16px;
  }
  
  .dropdown-item {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  /* تحسين عرض الجدول/Grid */
  .row > div {
    margin-bottom: 20px;
  }
  
  /* تحسين الصور */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* تحسين النصوص */
  p {
    font-size: 14px;
    line-height: 1.6;
  }
  
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }
  h5 { font-size: 14px; }
}

/* تحسينات خاصة للهواتف فائقة الصغر */
@media (max-width: 480px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .carousel-caption {
    bottom: 5px;
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .carousel-caption h2 {
    font-size: 12px !important;
    margin-bottom: 2px;
  }
  
  .carousel-caption p {
    font-size: 10px !important;
  }
  
  .navbar-brand {
    font-size: 14px;
  }
  
  .section-title {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .logo-block img {
    height: 40px;
  }
  
  .logo-block div {
    font-size: 10px;
  }
}

/* انيميشن للتحميل */
.img-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* تحسين التخطيط العام */
.row {
  margin-left: 0;
  margin-right: 0;
}

.col, [class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
}

/* إصلاح مشاكل التخطيط */
.navbar-nav .nav-link {
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border-radius: 8px;
  max-height: 300px; /* تحديد أقصى ارتفاع للقائمة */
  overflow-y: auto; /* إضافة شريط التمرير العمودي */
  min-width: 280px; /* عرض أدنى للقائمة */
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  transition: background-color 0.3s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
}

/* تخصيص شريط التمرير للقوائم المنسدلة */
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

/* تأثير التمرير للقوائم المنسدلة - Hover Effect */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  display: block !important;
  pointer-events: none;
}

/* تم نقل جميع تنسيقات القوائم المنسدلة إلى النظام الموحد */
/* unified-dropdown.js يدير الآن جميع القوائم المنسدلة */

/* تحسين التفاعل مع القوائم المنسدلة */
.dropdown:hover .dropdown-toggle::after {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.dropdown.mobile-active .dropdown-toggle::after {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.dropdown-toggle::after {
  transition: transform 0.3s ease;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* تحسين الأداء */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* تحسين إمكانية الوصول */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Equipment Page Styles - صفحة المعدات */
.equipment-card {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,34,68,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 300px;
}

.equipment-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,34,68,0.2);
}

.equipment-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.equipment-card:hover img {
  transform: scale(1.05);
}

.equipment-content {
  padding: 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,34,68,0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.equipment-category {
  background: linear-gradient(135deg, #0d6efd, #6610f2);
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 15px;
}

.equipment-content h3 {
  color: #002244;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.equipment-list {
  list-style: none;
  padding: 0;
}

.equipment-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  position: relative;
  padding-right: 20px;
}

.equipment-list li::before {
  content: "✓";
  position: absolute;
  right: 0;
  color: #28a745;
  font-weight: bold;
  font-size: 1.1rem;
}

.equipment-list li strong {
  color: #0d6efd;
  font-weight: 600;
}

.features-section {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,34,68,0.1);
}

.feature-item {
  padding: 20px;
  border-radius: 15px;
  background: #f8f9fa;
  transition: transform 0.3s ease, background 0.3s ease;
  height: 100%;
}

.feature-item:hover {
  transform: translateY(-5px);
  background: white;
  box-shadow: 0 10px 25px rgba(0,34,68,0.1);
}

.feature-icon {
  font-size: 3rem;
  color: #0d6efd;
  margin-bottom: 15px;
}

.feature-item h5 {
  color: #002244;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature-item p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Equipment Gallery Styles */
.equipment-gallery {
  margin-top: 30px;
}

.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,34,68,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 200px;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,34,68,0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,34,68,0.9));
  color: white;
  padding: 20px 15px 15px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h6 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* Responsive Design for Equipment Page */
@media (max-width: 768px) {
  .equipment-content {
    margin-top: 20px;
    padding: 20px;
  }
  
  .equipment-card {
    height: 200px;
    margin-bottom: 20px;
  }
  
  .features-section {
    padding: 20px;
  }
  
  .feature-item {
    margin-bottom: 20px;
  }
  
  .feature-icon {
    font-size: 2.5rem;
  }
  
  .gallery-item {
    height: 150px;
    margin-bottom: 15px;
  }
  
  .gallery-overlay {
    padding: 15px 10px 10px;
  }
  
  .gallery-overlay h6 {
    font-size: 0.8rem;
  }
}

/* Home Page Specific Styles - أنماط خاصة بالصفحة الرئيسية */
.carousel-item img {
  width: 100%;
  height: 80vh;
  object-fit: cover;
}

.carousel-caption {
  background: rgba(0,0,0,0.7);
  padding: 20px;
  border-radius: 10px;
}

.board-img {
  width: 100%;
  max-width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.partner-logo {
  max-height: 100px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.partner-logo:hover {
  transform: scale(1.1);
}

/* Services Page Specific Styles - أنماط خاصة بصفحة الخدمات */
.service-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  margin-bottom: 30px;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.service-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.service-card-body {
  padding: 20px;
}

.service-title {
  background: #0d6efd;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 15px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

/* Projects Page Specific Styles - أنماط خاصة بصفحات المشروعات */
.project-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  margin-bottom: 30px;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.project-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.project-card-body {
  padding: 20px;
}

.project-category {
  background: #0d6efd;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 15px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

/* تحسين الطباعة */
@media print {
  .carousel, .navbar, footer iframe {
    display: none;
  }
  
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  
  .section {
    page-break-inside: avoid;
    padding: 20px 0;
  }
}

/* تحسين للهواتف المحمولة للصفحة الرئيسية */
@media (max-width: 768px) {
  .carousel-item img { 
    height: 50vh; 
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* أنماط خاصة بصفحة سابقة الأعمال */
.works-list {
  font-size: 17px;
  line-height: 2;
  margin-bottom: 30px;
  color: #555;
  text-align: right;
  direction: rtl;
}

.works-list ul {
  padding-right: 20px;
}

.works-list li {
  margin-bottom: 10px;
}

.works-img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
  margin-bottom: 18px;
  transition: all 0.3s ease;
  height: 420px;
  object-fit: cover;
  object-position: center;
}

.works-img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.13);
}

.lead {
  font-size: 17px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-bottom {
  background: rgba(0,0,0,0.2);
  color: #fff;
  padding: 10px 0 0;
  font-size: 13px;
  text-align: center;
}
