* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
}

body {
  background-color: #f8f9fa;
  color: #212529;
  line-height: 1.6;
  direction: rtl;
}

/* ✅ Header */
header {
  background-color: #343a40;
  color: white;
  padding: 1rem 2rem;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

header nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

header nav a:hover {
  text-decoration: underline;
}

/* ✅ Hero */
#home {
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(to right, #6c63ff, #4e54c8);
  color: white;
}

#home h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

#home p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: white;
  color: #4e54c8;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s;
}

.btn:hover {
  background-color: #ddd;
}

/* ✅ الأقسام العامة */
section {
  padding: 3rem 2rem;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #4e54c8;
}

/* ✅ About */
#about p {
  max-width: 600px;
  margin: auto;
  font-size: 1.1rem;
}

/* ✅ Skills */
#skills ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  list-style: none;
  padding: 0;
}

#skills li {
  background-color: #e9ecef;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-weight: bold;
}

/* ✅ Projects */
.project {
  background-color: #ffffff;
  padding: 1.5rem;
  margin: 1rem 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.project h3 {
  color: #343a40;
}

.project a {
  display: inline-block;
  margin-top: 0.5rem;
  color: #4e54c8;
  text-decoration: none;
}

.project a:hover {
  text-decoration: underline;
}

/* ✅ Contact */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: auto;
}

input, textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

button {
  padding: 0.8rem;
  background-color: #4e54c8;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #3b3f99;
}

/* ✅ Footer */
footer {
  background-color: #343a40;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

/* ✅ Responsive */
@media (max-width: 768px) {
  header nav ul {
    flex-direction: column;
    align-items: flex-start;
  }

  #skills ul {
    flex-direction: column;
    align-items: center;
  }

  .project {
    text-align: center;
  }
}
.dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  margin-right: 1rem;
}

.dark-mode-toggle:hover {
  opacity: 0.8;
}
body.dark {
  background-color: #121212;
  color: #f1f1f1;
}

body.dark header,
body.dark footer {
  background-color: #1e1e1e;
}

body.dark a {
  color: #87cefa;
}

body.dark input,
body.dark textarea {
  background-color: #222;
  color: white;
  border-color: #444;
}

body.dark .btn,
body.dark button {
  background-color: #444;
  color: white;
}

body.dark .project {
  background-color: #1a1a1a;
  border-color: #333;
}
.btn-download {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0077ff;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.3s ease;
  margin-top: 20px;
}

.btn-download:hover {
  background-color: #005bcc;
}
.icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  filter: invert(0);
  transition: filter 0.3s ease;
}

a:hover .icon {
  filter: invert(0.5) sepia(1) saturate(5) hue-rotate(200deg);
}
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .project-card {
    width: 90%;
    margin: 20px auto;
    flex-direction: column;
    text-align: center;
  }

  .skills .bar {
    width: 90%;
  }

  h1, h2, h3 {
    font-size: 1.5rem;
  }

  body {
    padding: 10px;
  }
}
.project-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.project-card {
  width: 300px;
  max-width: 90%;
}
/* الزر مخفي في الشاشات الكبيرة */
.menu-toggle {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* يظهر فقط على الموبايل */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 10px;
    background-color: #222;
    padding: 10px;
  }

  .nav-links.show {
    display: flex;
  }
}
