body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #f5f5f5;
}

/* Header */
header {
  background-color: #006d5b;
  color: white;
  padding: 15px 0;
}

header .container {
  width: 90%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo {
  display: flex;
  align-items: center;
}

header .logo img {
  height: 50px;
  margin-right: 10px;
}

header nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

header nav ul li {
  margin-left: 20px;
}

header nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

header nav ul li a:hover {
  text-decoration: underline;
}

header nav {
  display: flex;
  align-items: center;
  gap: 10px; /* space between lang buttons and hamburger */
}

.lang-switcher {
  margin-left: 20px;
  display: flex;
  gap: 5px;
}

.lang-switcher button {
  background: white;
  color: #006d5b;
  border: none;
  padding: 6px 10px;
  margin-left: 5px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.lang-switcher button:hover {
  background: #004d40;
  color: white;
}

.hero {
  position: relative;
  overflow: hidden;
  height: 500px; /* increased from 400px */
  width: 100vw;  /* ensures full viewport width */
  margin: 0;
}

.hero .slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero .slides img {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;                /* fill hero completely */
  object-position: center;          /* keep subject centered */
  transition: left 0.8s ease-in-out;
  z-index: 0;
}

.hero .slides img.active {
  left: 0;
  z-index: 1;
}

.hero .slides img.prev {
  left: -100%;
  z-index: 0;
}

.hero .hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
  z-index: 2;
}

.hero .hero-text h2 {
  font-size: 2.5rem;
}

.hero .hero-text p {
  font-size: 1.2rem;
}

/* Footer Custom Background */
footer {
  background: #004d40; /* Deep green for strong contrast */
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  width: 100%;
  position: relative;
  z-index: 10; /* ensures it stays above background animations */
}

/* General Page Layout */
.content {
  width: 90%;
  margin: 40px auto;
}

/* Section Titles */
.content h2, .content h3 {
  color: #006d5b;
}

/* About Page */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.team-grid .member {
  flex: 1 1 200px;
  text-align: center;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.team-grid img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 10px;
}

/* Projects Page */
.project-list .project {
  background: #fff;
  padding: 15px;
  margin-bottom: 20px;
  border-left: 5px solid #006d5b;
  border-radius: 6px;
}

/* Contact Page */
.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-form input, .contact-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.contact-form button {
  background-color: #006d5b;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: #004d40;
}

/* Responsive Design */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
  }
  header nav ul {
    flex-direction: column;
    align-items: center;
  }
  .team-grid {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  header nav {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* === STATS SECTION === */
.stats-section {
  text-align: center;
  background: #f5f5f5;
  padding: 60px 0;
  overflow: hidden;
}

.stats-section h2 {
  color: #006d5b;
  margin-bottom: 30px;
  font-size: 2rem;
}

.stats-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.stats-track {
  display: flex;
  gap: 20px;
  animation: scrollCards 40s linear infinite;
  width: max-content;
}

/* === RTL (Arabic) FIX for seamless loop === */
html[dir="rtl"] .stats-track {
  flex-direction: row-reverse;
  animation: scrollCardsRTL 40s linear infinite;
}

@keyframes scrollCardsRTL {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

.stat-card {
  flex: 0 0 300px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  padding: 15px;
}

.stat-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.stat-card h3 {
  color: #006d5b;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.stat-card p {
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.stat-card button {
  background-color: #006d5b;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.stat-card button:hover {
  background-color: #004d40;
}

/* === Infinite Scrolling Animation === */
@keyframes scrollCards {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Make sure duplicate cards are appended for seamless looping */
.stats-track::after {
  content: "";
  display: block;
}

/* === Perfectly Aligned 3 Top Stat Cards === */
.top-stats-cards {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2%;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 40px auto;
  padding: 0 5%;
  flex-wrap: nowrap; /* keep all 3 in one row */
  box-sizing: border-box;
}

.top-stat-card {
  flex: 1 1 0;
  background: #ffffffcc;
  border: 2px solid #008f7a;
  border-radius: 15px;
  text-align: center;
  padding: 25px 10px;
  box-shadow: 0 4px 10px rgba(0, 109, 91, 0.2);
  transition: all 0.3s ease;
  min-width: 0; /* fixes flex overflow issues */
}

.top-stat-card:hover {
  background: #e6f9e6;
  transform: translateY(-5px);
}

.top-stat-card h3 {
  color: #004d40;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.top-stat-card p {
  color: #008f7a;
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

/* === Responsive Tweaks === */
@media (max-width: 900px) {
  .top-stats-cards {
    flex-wrap: wrap;
    gap: 15px;
  }
  .top-stat-card {
    flex: 1 1 calc(50% - 15px);
  }
}

@media (max-width: 600px) {
  .top-stat-card {
    flex: 1 1 100%;
  }
}

/* Hamburger Menu */
.hamburger-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 10px; /* gap from language buttons */
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 2px;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 25px;
  right: 0;
  background: #006d5b;
  min-width: 150px;
  border-radius: 6px;
  overflow: hidden;
  z-index: 1000;
}

.menu-dropdown li {
  list-style: none;
}

.menu-dropdown li a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}

.menu-dropdown li a:hover {
  background: #004d40;
}

/* Show dropdown when active */
.hamburger-wrapper.active .menu-dropdown {
  display: block;
}

/* === GALLERY SECTION === */
.gallery-section {
  padding: 60px 5%;
  text-align: center;
  background: #f0fdf4; /* soft green background */
}

.gallery-section h2 {
  color: #006d5b;
  font-size: 2rem;
  margin-bottom: 30px;
}

/* Grid Layout: 5 columns */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columns */
  gap: 15px;
}

.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.gallery-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Responsive: stack on smaller screens */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 per row on medium screens */
  }
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 per row on smaller screens */
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on mobile */
  }
  .gallery-grid img {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr; /* 1 per row on very small screens */
  }
  .gallery-grid img {
    height: 120px;
  }
}

/* === MODAL STYLES (Updated) === */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow: auto; /* allow scrolling if modal is taller than viewport */
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 600px; /* fixed width as per your suggestion */
  max-width: 95%; /* still responsive on small screens */
  max-height: 90vh;
  padding: 25px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto; /* vertical scroll inside if needed */
  overflow-x: hidden; /* no horizontal scroll unless really needed */
  word-wrap: break-word; /* ensure text wraps inside */
  animation: fadeIn 0.3s ease;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
  color: #006d5b;
  margin-bottom: 15px;
  font-size: 1.5rem;
  text-align: center;
  width: 100%;
}

.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 15px 0;
}

.modal-info {
  background: #e6f9e6;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  width: 100%;
}

.modal-info p {
  margin: 6px 0;
  color: #004d40;
}

.modal-content p {
  line-height: 1.6;
  color: #333;
  width: 100%;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #006d5b;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #004d40;
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

html {
  scroll-behavior: smooth;
}

/* Gallery Modal Styles */
.gallery-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9); /* Dark overlay */
}

.gallery-modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
  animation: zoom 0.3s ease;
}

.gallery-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.gallery-close:hover {
  color: #bbb;
}

@keyframes zoom {
  from {transform: scale(0.7);}
  to {transform: scale(1);}
}

.about-right {
  text-align: center; /* centers heading and image */
}

.about-right img {
  width: 150px;        /* fixed width */
  height: 150px;       /* fixed height */
  border-radius: 8%;   /* slightly rounded corners */
  object-fit: cover;   /* fills the 150x150 box without distortion */
  margin-bottom: 15px;
  display: inline-block; /* ensures proper alignment inside text-align:center */
}

.footer-container a {
  color: white;
  text-decoration: none;
}

.footer-container a:hover {
  text-decoration: underline; /* optional hover effect */
}
