/* Global Rules */
:root {
  /* Default Dark Mode Colors */
  --main-bg-color: #1a202c;
  --card-bg-color: #2d3748;
  --text-color: #e2e8f0;
  --text-secondary: #a0aec0;
  --accent-color: #4fd1c5;
  --accent-color-hover: #38b2ac;
  --border-color: rgba(255, 255, 255, 0.05); /* لون حدود خفيف */
  --shadow-color-dark: rgba(0, 0, 0, 0.2);
  --shadow-color-accent: rgba(79, 209, 197, 0.3);
  --shadow-color-accent-hover: rgba(79, 209, 197, 0.4);

  --section-padding: 80px 0;
  --main-duration: 0.3s;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

/* Light Mode */
body.light-mode {
  --main-bg-color: #f7fafc; /* خلفية فاتحة جداً */
  --card-bg-color: #ffffff; /* خلفية الكروت بيضاء */
  --text-color: #2d3748; /* نص غامق */
  --text-secondary: #4a5568; /* نص ثانوي رمادي غامق */
  --accent-color: #3182ce; /* أزرق مميز */
  --accent-color-hover: #2b6cb0; /* أزرق أغمق عند الهوفر */
  --border-color: rgba(0, 0, 0, 0.1); /* حدود أغمق */
  --shadow-color-dark: rgba(0, 0, 0, 0.05); /* ظل أخف */
  --shadow-color-accent: rgba(49, 130, 206, 0.2);
  --shadow-color-accent-hover: rgba(49, 130, 206, 0.3);
}

/* لو حبيت تضيف مود ثالث مثلاً "Warm Mode" */
body.warm-mode {
  --main-bg-color: #faf3e0; /* خلفية بيج فاتح */
  --card-bg-color: #ffffff;
  --text-color: #5c4033; /* بني داكن */
  --text-secondary: #8b4513; /* بني فاتح */
  --accent-color: #ff7f50; /* برتقالي مرجاني */
  --accent-color-hover: #e9643d;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-color-dark: rgba(0, 0, 0, 0.05);
  --shadow-color-accent: rgba(255, 127, 80, 0.2);
  --shadow-color-accent-hover: rgba(255, 127, 80, 0.3);
}

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
body {
  font-family: "Cairo", sans-serif;
  direction: ltr;
  margin: 0;
  background-color: var(--main-bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color var(--main-duration), color var(--main-duration); /* انتقال سلس للألوان */
}
.container {
  padding-left: 15px;
  padding-right: 15px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
}
/* Media Queries for Container */
@media (min-width: 768px) {
  .container {
    width: 750px;
  }
}
@media (min-width: 992px) {
  .container {
    width: 970px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 40px;
  color: var(--text-color);
}
/* End Global Rules */

/* Start Header */
.header {
  padding: 20px 0;
  background-color: var(--main-bg-color);
  border-bottom: 1px solid var(--border-color); /* استخدام المتغير الجديد */
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color var(--main-duration),
    border-color var(--main-duration);
}
.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header .logo {
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
  white-space: nowrap;
}
.header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
}
.header nav ul li a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  transition: color var(--main-duration);
  white-space: nowrap;
}
.header nav ul li a:hover,
.header nav ul li a.active {
  color: var(--text-color);
}

/* أضفنا div.controls عشان نحط الأيقونات فيه */
.header .controls {
  display: flex;
  align-items: center;
  gap: 20px; /* مسافة بين أيقونة البحث وزر التبديل */
}
.header .search-icon i,
.header .theme-toggle i {
  /* طبق نفس التنسيقات على أيقونة التبديل */
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--main-duration);
}
.header .search-icon i:hover,
.header .theme-toggle i:hover {
  color: var(--text-color);
}

@media (max-width: 767px) {
  .header .container {
    flex-direction: column;
    gap: 15px;
  }
  .header nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  .header .controls {
    margin-top: 10px;
  } /* تعديل للهامش */
}
/* End Header */

/* Start Hero & About Section */
.hero-about-section {
  padding: var(--section-padding);
  display: flex;
  align-items: center;
  min-height: 60vh;
}
.hero-about-section .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  width: 100%;
}
.about-box {
  flex-basis: 100%;
  background-color: var(--card-bg-color);
  border-radius: 10px;
  padding: 30px;
  text-align: left;
  box-shadow: 0 10px 30px var(--shadow-color-dark); /* استخدام المتغير */
  transition: background-color var(--main-duration),
    box-shadow var(--main-duration);
}
.about-box h3 {
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text-color);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
  padding-bottom: 10px;
}
.about-box .intro-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 30px;
}
.about-box .about-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}
@media (min-width: 576px) {
  .about-box .about-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.about-box .skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}
.about-box .skills-list li {
  margin-bottom: 12px;
  font-size: 17px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
.about-box .skills-list li i {
  color: var(--accent-color);
  margin-right: 12px;
  font-size: 10px;
}
.about-box .profile-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 20px var(--shadow-color-accent); /* استخدام المتغير */
  flex-shrink: 0;
}
.hero-text-area {
  flex-basis: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.hero-text-area h1 {
  font-size: 48px;
  font-weight: 900;
  margin: 0 0 40px;
  color: var(--text-color);
  line-height: 1.1;
  letter-spacing: -1px;
}
.explore-btn {
  display: inline-block;
  padding: 18px 40px;
  background-color: var(--accent-color);
  color: var(--main-bg-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px var(--shadow-color-accent);
}
.explore-btn:hover {
  background-color: var(--accent-color-hover);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px var(--shadow-color-accent-hover);
}
@media (min-width: 992px) {
  .about-box {
    flex-basis: 40%;
  }
  .hero-text-area {
    flex-basis: 55%;
  }
  .hero-text-area h1 {
    font-size: 72px;
  }
}
/* End Hero & About Section */

/* Start Featured Projects Section */
.featured-projects {
  padding: var(--section-padding);
  background-color: var(--main-bg-color);
  transition: background-color var(--main-duration);
}
.featured-projects .section-title {
  text-align: center;
  margin-bottom: 50px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  justify-items: center;
  align-items: stretch;
}
@media (min-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.project-item {
  background-color: var(--card-bg-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow-color-dark); /* استخدام المتغير */
  transition: transform var(--main-duration), box-shadow var(--main-duration),
    background-color var(--main-duration);
  width: 100%;
  display: flex;
  flex-direction: column;
}
.project-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); /* هذا الظل ممكن نخليه ثابت أو نعدله بمتغير */
}
.project-item img {
  max-width: 100%;
  display: block;
  height: 220px;
  object-fit: cover;
}
.project-info {
  padding: 25px;
  color: var(--text-color);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.project-info h3 {
  margin: 0 0 15px;
  font-size: 24px;
  font-weight: 700;
  flex-grow: 1;
}
.view-project-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  text-decoration: none;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  transition: background-color var(--main-duration), color var(--main-duration),
    transform var(--main-duration), border-color var(--main-duration);
}
.view-project-btn:hover {
  background-color: var(--accent-color);
  color: var(--main-bg-color);
  transform: translateY(-2px);
}
/* End Featured Projects Section */

/* Start Contact Section */
.contact-section {
  padding: var(--section-padding);
  background-color: var(--card-bg-color);
  text-align: center;
  border-top: 1px solid var(--border-color); /* استخدام المتغير */
  transition: background-color var(--main-duration),
    border-color var(--main-duration);
}
.contact-section .section-title {
  text-align: center;
  margin-bottom: 20px;
}
.contact-section .contact-lead-text {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 50px auto;
  line-height: 1.7;
}
.contact-section .contact-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-bottom: 60px;
}
.contact-section .contact-method-item {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 600;
  transition: color var(--main-duration);
}
.contact-section .contact-method-item:hover {
  color: var(--accent-color);
}
.contact-section .contact-method-item i {
  font-size: 24px;
  color: var(--accent-color);
}
.contact-section .send-message-btn {
  margin-top: 20px;
}
/* End Contact Section */

/* Start Footer */
.footer {
  padding: 25px 0;
  background-color: var(--main-bg-color);
  color: var(--text-secondary);
  text-align: center;
  border-top: 1px solid var(--border-color); /* استخدام المتغير */
  transition: background-color var(--main-duration),
    border-color var(--main-duration);
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
@media (max-width: 767px) {
  .footer .container {
    flex-direction: column;
    justify-content: center;
  }
}
.footer p {
  margin: 0;
  font-size: 15px;
}
.footer .social-icons {
  display: flex;
  gap: 20px;
}
.footer .social-icons a {
  color: var(--text-secondary);
  font-size: 18px;
  transition: color var(--main-duration);
}
.footer .social-icons a:hover {
  color: var(--accent-color);
}
/* End Footer */

/* Start LightBox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}
.lightbox-modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}
.lightbox-img {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  animation: zoomIn 0.3s ease-out;
}
@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.close-btn {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}
.close-btn:hover,
.close-btn:focus {
  color: #bbb;
}
/* End LightBox Modal */
