/* Variables */
:root {
  --primary-color: #3a5dae;
  --light-bg: #f8f9fa;
  --text-color: #333;
  --header-color: #3a5dae;
  --footer-color: #13264D;
}

/* Global Styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #fff;
  color: var(--text-color);
  line-height: 1.6;
}

/* Language button specific styling */
.lang-btn {
  color: #fff !important;
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background-color: #fff;
  color: var(--primary-color) !important;
}

/* Language-specific content visibility */
html[lang="en"] .content-ar {
  display: none;
}

html[lang="ar"] .content-en {
  display: none;
}

/* Explicitly make visible content for the selected language */
html[lang="en"] .content-en {
  display: block;
}

html[lang="ar"] .content-ar {
  display: block;
}

/* Language-specific header layout */
html[lang="en"] .navbar-brand-right,
html[lang="en"] #lang-toggle-left,
html[dir="ltr"] .lang-toggle-left {
  display: none !important;
}

html[lang="ar"] .navbar-brand-left,
html[lang="ar"] #lang-toggle-right,
html[dir="rtl"] .lang-toggle-right {
  display: none !important;
}

html[lang="ar"] .navbar-brand-right,
html[lang="ar"] #lang-toggle-left,
html[dir="rtl"] .navbar-brand-right,
html[dir="rtl"] .lang-toggle-left {
  display: block !important;
}

/* RTL Navbar brand positioning */
html[dir="rtl"] .navbar-brand-right {
  margin-right: 0;
  margin-left: auto;
}

/* Header layout styles */
.navbar-nav {
  display: flex;
  align-items: center;
}

.lang-toggle-right {
  margin-left: auto;
}

.lang-toggle-left {
  margin-right: auto;
}

/* RTL support */
[dir="rtl"] body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

/* Navbar overrides */
.navbar {
  background-color: var(--header-color) !important;
}
.navbar-light .navbar-nav .nav-link,
.navbar-light .navbar-brand {
  color: #fff;
}
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-brand:hover {
  color: rgba(255,255,255,0.85);
}
.navbar-light .navbar-toggler {
  border-color: rgba(255,255,255,0.5);
}
.navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.btn-outline-primary {
  color: #fff;
  border-color: #fff;
}
.btn-outline-primary:hover {
  background-color: #fff;
  color: var(--primary-color);
  border-color: #fff;
}

/* Main content spacing */
main {
  padding-top: 56px; /* reduce to navbar exact height */
}

/* Section headings */
h2, h1 {
  color: var(--primary-color);
  font-weight: 600;
}

/* List group styling */
.list-group-item {
  border: none;
  padding: 0.75rem 1rem;
}

/* Footer or contact map */
.ratio {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

/* Responsive image gallery */
#media img {
  object-fit: cover;
  height: 150px;
}

/* Button styling */
.btn-primary,
.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Read More Button Styling */
.btn-primary.read-more-btn {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.btn-primary.read-more-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  opacity: 0.9;
}

/* Utility adjustments */
.text-center {
  text-align: center;
}

/* Carousel images uniform height */
#carouselHome .carousel-item img {
  height: 500px;
  object-fit: cover;
}

/* Services cards */
.service-card {
  background-color: #fff;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.service-card:hover {
  background-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.service-card .card-title,
.service-card .card-text {
  color: var(--text-color);
  transition: color 0.3s;
}
.service-card:hover .card-title,
.service-card:hover .card-text {
  color: #fff;
}

/* Vision & Mission styling */
#vision-mission .row h3 {
  font-weight: 600;
  color: var(--primary-color);
}
#vision-mission p {
  margin-top: 0.5rem;
  color: var(--text-color);
}

/* Clients carousel image styling */
#carouselClients .carousel-item img {
  width: 120px;
  height: 120px;
  object-fit: cover;
}
/* Center carousel controls */
#carouselClients .carousel-control-prev,
#carouselClients .carousel-control-next {
  width: 5%;
}

/* Swap text and image columns in RTL mode */
[dir="rtl"] .vision-row .col-md-6:nth-child(1) { order: 2; }
[dir="rtl"] .vision-row .col-md-6:nth-child(2) { order: 1; }
[dir="rtl"] .mission-row .col-md-6:nth-child(1) { order: 2; }
[dir="rtl"] .mission-row .col-md-6:nth-child(2) { order: 1; }
/* Client carousel medium circular images */
.client-img-medium {
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin: 0 auto;
  display: block;
}

/* Modern news card styling */
.modern-news-card {
  border: none;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}
.modern-news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.modern-news-card .card-img-top {
  height: 200px;
  object-fit: cover;
}
.modern-news-card .card-body {
  padding: 1rem;
}

/* Enhanced Tabs Styling */
.nav-tabs {
  border-bottom: 2px solid #dee2e6;
}
.nav-tabs .nav-item {
  margin-bottom: -2px;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 600;
  color: #495057;
  padding: 1rem 1.5rem;
  transition: color 0.3s, border-color 0.3s;
}
.nav-tabs .nav-link:hover {
  color: var(--primary-color);
  border-bottom-color: rgba(58, 93, 174, 0.5);
}
.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: transparent;
}

/* Tab content styling */
.tab-pane {
  padding: 2rem 0;
}
.tab-pane h4 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}
.tab-pane img {
  transition: transform 0.3s;
}
.tab-pane img:hover {
  transform: scale(1.02);
}

/* Gallery styling */
.gallery-container {
  margin-bottom: 2rem;
}
.gallery-item {
  position: relative;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.gallery-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(58, 93, 174, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-img {
  transform: scale(1.05);
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.gallery-overlay i {
  font-size: 2rem;
}

/* RTL gallery support */
[dir="rtl"] .gallery-overlay {
  right: 0;
  left: auto;
}

/* Lightbox customization */
.lb-data .lb-caption {
  font-size: 16px;
  font-weight: 600;
}
.lb-data .lb-number {
  font-size: 14px;
}

/* GLightbox customization */
.glightbox-clean .gslide-description {
  background: rgba(0, 0, 0, 0.7);
}

.glightbox-container .gslide-media {
  box-shadow: none;
}

/* Custom styling for thumbnails */
.glightbox-with-thumbs .gslide-thumbnail {
  background-color: #000;
  padding: 5px 0;
}

.glightbox-with-thumbs .gslide-thumb-item {
  width: 100px;
  height: 70px;
  margin: 0 5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  border: 2px solid transparent;
}

.glightbox-with-thumbs .gslide-thumb-item.active {
  opacity: 1;
  border-color: var(--primary-color);
}

.glightbox-with-thumbs .gslide-thumb-item:hover {
  opacity: 1;
}

/* Navigation arrows styling */
.glightbox-clean .gnext, 
.glightbox-clean .gprev {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.glightbox-clean .gnext:hover, 
.glightbox-clean .gprev:hover {
  opacity: 1;
}

/* Custom controls position for better visibility */
.glightbox-clean .gclose {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  top: 15px;
  right: 15px;
}

/* Ensure images fit nicely */
.gslide img {
  object-fit: contain;
}

/* Footer styling */
.footer {
  background-color: var(--footer-color) !important;
  color: #fff;
}

.footer h5 {
  color: #fff;
  font-weight: 600;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
}

.footer a:hover {
  color: #fff;
}