
/* Global styles */

/* Import Google Font Roboto for both headings and body text */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
:root {
  --primary-color: #008080;
  --secondary-color: #004d4d;
  --light-color: #f9f9f9;
  --dark-color: #333;
  --border-radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  /* Use Roboto as the primary typeface throughout the site. If it isn't available
     for any reason, fall back to a generic sans-serif stack. */
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
}

header {
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Ensure the header is on top of the collapsible mobile menu */
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
}
.logo img {
  height: 40px;
  width: 40px;
  margin-right: 0.5rem;
  /* Invert the logo colors so the teal logo appears white on the dark header background */
  filter: brightness(0) invert(1);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
}
nav ul li a:hover {
  color: #cce7e7;
}

/* Hero Section */
.hero {
  /* Use a background image with an overlay for the hero section */
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/hero_bg.png');
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: fadeInDown 1s ease forwards;
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease forwards;
}
.hero .btn {
  background: #fff;
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}
.hero .btn:hover {
  background: #e6f5f5;
  color: var(--secondary-color);
}

/* Sections */
section {
  padding: 3rem 2rem;
}
section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--secondary-color);
}

.about {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.feature-item {
  background: #fff;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  flex: 1 1 280px;
  max-width: 300px;
  transition: transform 0.3s;
}

.feature-item:hover {
  transform: translateY(-8px);
}

.feature-item h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Projects Section */
.projects {
  background: var(--light-color);
}
.projects .project-card {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  max-width: 400px;
}
.projects .project-card:hover {
  transform: translateY(-8px);
}
.projects img {
  width: 100%;
  display: block;
}
.projects .project-content {
  padding: 1rem;
}
.projects .project-content h3 {
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}
.projects .project-content p {
  font-size: 0.9rem;
  color: var(--dark-color);
}

/* Contact Section */
.contact {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  max-width: 600px;
  margin: 0 auto;
}
.contact p {
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background: var(--secondary-color);
  color: #fff;
  text-align: center;
  padding: 1rem 2rem;
}
footer a {
  color: #cce7e7;
  text-decoration: none;
  margin: 0 0.5rem;
}
footer a:hover {
  color: #fff;
}

/* Animations */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
  nav ul li {
    margin: 0.5rem 0;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .features {
    flex-direction: column;
    align-items: center;
  }
  .projects .project-card {
    max-width: 100%;
  }
}

/* Arabic Styling (RTL) */
[dir="rtl"] body {
  font-family: 'Tahoma', sans-serif;
  text-align: right;
}
[dir="rtl"] nav ul {
  flex-direction: row;
  justify-content: flex-end;
}
[dir="rtl"] nav ul li {
  margin: 0 1rem;
}
[dir="rtl"] .hero h1, [dir="rtl"] .hero p {
  text-align: center;
}

/* ----- Responsive navigation ----- */
/* Hamburger menu icon only appears on small screens */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}
.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animate the hamburger into an “X” when active */
.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  /* Show the hamburger button */
  .menu-toggle {
    display: flex;
  }
  /* Hide the nav list by default on mobile */
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  /* When nav is active (toggled), show the list */
  nav ul.active {
    display: flex;
  }
  nav ul li {
    margin: 0.75rem 1.5rem;
  }
  nav ul li a {
    font-size: 1.1rem;
  }
}
