/* Variables */
:root {
  --primary-color: #2b3d5b;
  --secondary-color: #3a5a7a;
  --accent-color: #4fc3f7;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --text-color: #495057;
}
/* nav bar*/
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  padding: 1rem 5%;
  background-color: rgba(0, 0, 0, 0.9);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.8rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
}

.logo span {
  color: #4e9af1;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #4e9af1;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: #4e9af1;
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: #4e9af1;
}

.nav-links a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  cursor: pointer;
  color: white;
  font-size: 1.8rem;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    transition: left 0.5s ease;
  }

  .nav-links.active {
    left: 0;
  }

  .navbar.scrolled {
    padding: 1rem 5%;
  }
}

/* Base */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header / Hero */
header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.architecture-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../img/R.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(43, 61, 91, 0.9) 0%,
    rgba(58, 90, 122, 0.7) 100%
  );
  z-index: 1;
}
.moving-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}
.tech-icon {
  position: absolute;
  opacity: 0.1;
  color: white;
  font-size: 1.5rem;
  animation: float 15s infinite linear;
}
@keyframes float {
  0% {
    transform: translateY(0) rotate(0);
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
  }
}
.header-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}
header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 600;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
header p {
  font-size: 1.3rem;
  opacity: 0.9;
  margin: 1.5rem auto 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: 700px;
}
.typing-cursor {
  display: inline-block;
  margin-left: 4px;
  animation: blink 1s step-start infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Scroll down indicator */
.scroll-down {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: white;
  font-size: 1.5rem;
  animation: bounce 2s infinite;
  cursor: pointer;
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

/* Sections */
section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: auto;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
section.visible {
  opacity: 1;
  transform: translateY(0);
}
h2 {
  color: var(--primary-color);
  font-size: 2.2rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.8rem;
}
h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 70px;
  height: 4px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

/* Projects */
.project {
  background-color: white;
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 5px solid var(--accent-color);
  overflow: hidden;
  position: relative;
}
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(79, 195, 247, 0.05) 0%,
    rgba(79, 195, 247, 0) 100%
  );
  z-index: 0;
}
.project:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}
.project h3 {
  color: var(--secondary-color);
  margin-top: 0;
  font-size: 1.5rem;
  position: relative;
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}
.project-links {
  display: flex;
  gap: 1rem;
  position: relative;
}
.demo-link,
.code-link {
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.demo-link {
  background-color: var(--accent-color);
  color: white;
}
.demo-link:hover {
  background-color: #3aa8d8;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(79, 195, 247, 0.5);
}
.code-link {
  background-color: white;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}
.code-link:hover {
  background-color: #f0f9ff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(79, 195, 247, 0.2);
}
.project-content {
  display: flex;
  gap: 2.5rem;
  margin-top: 1.5rem;
}
.project-image {
  flex: 1;
  min-width: 300px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  position: relative;
}
.project-image:hover {
  transform: scale(1.02);
}
.project-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}
.project-image:hover img {
  transform: scale(1.05);
}
.project-details {
  flex: 2;
  position: relative;
}
.features-list {
  padding-left: 1.5rem;
}
.features-list li {
  margin-bottom: 0.8rem;
  position: relative;
}
.features-list li::before {
  content: "▹";
  position: absolute;
  left: -1.2rem;
  color: var(--accent-color);
  font-size: 1.2rem;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  list-style: none;
  padding: 1rem 0 0 0;
  margin-top: 1.5rem;
  border-top: 1px dashed #e0e0e0;
}
.tech-tags li {
  background-color: #e3f2fd;
  color: var(--secondary-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}
.tech-tags li:hover {
  background-color: var(--accent-color);
  color: white;
}

/* About */
.about-content {
  display: flex;
  gap: 3rem;
  align-items: center;
}
.about-text {
  flex: 2;
}
.about-image {
  flex: 1;
  min-width: 250px;
  position: relative;
}
.about-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s ease;
}
.about-image:hover img {
  transform: scale(1.05) rotate(2deg);
}
.about-image::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid var(--accent-color);
  border-radius: 10px;
  top: 15px;
  left: 15px;
  z-index: -1;
  transition: all 0.3s ease;
}
.about-image:hover::before {
  top: 10px;
  left: 10px;
}

/* Education (consolidated & enhanced) */
.education-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  background-color: white;
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid var(--accent-color);
}
.education-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.education-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(79, 195, 247, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 5px;
}
.education-details {
  flex: 1;
}
.education-details h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--secondary-color);
  font-size: 1.4rem;
}
.education-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 1rem;
  align-items: center;
}
.education-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-color);
}
.education-meta i {
  color: var(--accent-color);
  width: 16px;
  text-align: center;
}
.education-description p {
  margin: 0.8rem 0;
  line-height: 1.7;
}
.education-specializations {
  padding-left: 0;
  list-style: none;
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}
.education-specializations li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  background-color: rgba(79, 195, 247, 0.08);
  border-radius: 6px;
}
.education-specializations i {
  color: var(--accent-color);
  font-size: 0.9rem;
}
.education-date {
  color: var(--accent-color);
  font-weight: 500;
}

/* Skills */
.skills ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.skills ul li {
  background-color: white;
  color: var(--secondary-color);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  font-size: 1rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.skills ul li::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(79, 195, 247, 0.2),
    transparent
  );
  transition: 0.5s;
}
.skills ul li:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(79, 195, 247, 0.4);
}
.skills ul li:hover::before {
  left: 100%;
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}
a:hover {
  color: #8be2ff;
  text-decoration: underline;
}

/* Contact */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.contact-info p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.1rem;
}
.contact-info i {
  width: 30px;
  height: 30px;
  background-color: rgba(79, 195, 247, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  background-color: var(--primary-color);
  color: white;
  margin-top: 3rem;
  position: relative;
}
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-color), #8be2ff);
}
footer .social-links a {
  color: white;
  margin: 0 10px;
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 4rem 1.5rem;
    min-height: 300px;
  }
  header h1 {
    font-size: 2.2rem;
  }
  header p {
    font-size: 1.1rem;
  }
  section {
    padding: 2.5rem 1.5rem;
  }
  .skills ul {
    gap: 0.8rem;
  }
  .skills ul li {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
  }
  .project-content {
    flex-direction: column;
  }
  .project-image {
    min-width: 100%;
  }
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .project-links {
    width: 100%;
    justify-content: flex-start;
  }
  .about-content {
    flex-direction: column;
  }
  .about-image {
    order: -1;
    margin-bottom: 2rem;
  }
  .education-item {
    flex-direction: column;
    gap: 1.2rem;
  }
  .education-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .education-specializations {
    grid-template-columns: 1fr;
  }
}
section {
  margin-bottom: 40px;
}
.certifications {
  margin-top: 30px;
}
.certification-item {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}
.header-content h1 {
  font-size: 2.5rem;
}

/* Certifications Section Styling */
.certifications {
  padding: 40px 0;
  position: relative;
}

.certifications-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding: 20px 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.certifications-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.certification-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.certification-card:hover {
  transform: translateY(-5px);
}

.certification-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: white;
  font-size: 24px;
}

.certification-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: #333;
}

.certification-meta {
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.provider {
  font-weight: 500;
}

.view-cert {
  margin-top: auto;
  color: #6e8efb;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s ease;
}

.view-cert:hover {
  color: #a777e3;
}

.certifications-scroll-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.scroll-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.scroll-btn:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .certification-card {
    flex: 0 0 85%;
  }

  .certifications-container {
    padding: 20px 10px;
  }
}
/* Honours and Awards Section */
.honours-awards {
  background: #f9f9f9;
  padding: 4rem 2rem;
}

.honours-awards h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: #2c3e50;
  font-size: 2.2rem;
}

.awards-container {
  max-width: 800px;
  margin: 0 auto;
}

.award-card {
  background: white;
  border-left: 4px solid #3498db;
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  position: relative;
  transition: transform 0.3s ease;
}

.award-card:hover {
  transform: translateY(-5px);
}

.award-card.highlight {
  border-left-color: #3498db;
  background: linear-gradient(to right, #fff9f9, white);
}

.award-year {
  font-weight: bold;
  color: #3498db;
  margin-right: 1.5rem;
  font-size: 1.1rem;
  min-width: 60px;
}

.award-content h3 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 1.1rem;
}

.institution {
  color: #7f8c8d;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.award-description {
  color: #34495e;
  font-size: 0.95rem;
}

.award-icon {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  color: rgba(52, 152, 219, 0.2);
  font-size: 1.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .award-card {
    flex-direction: column;
  }

  .award-year {
    margin-bottom: 0.5rem;
  }
}
.awards-container .award-card .award-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* احذف السطرين الجايين إذا بدك بدون خلفية */
  background: transparent;
  border-radius: 8px;
}

.award-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
/* === Compact spacing overrides (put at end of style.css) === */
section {
  padding: 2rem 1.25rem; /* كان 4rem 2rem */
  margin-bottom: 16px; /* كان 40px */
}

h2 {
  margin-bottom: 1rem; /* كان 2rem */
  padding-bottom: 0.5rem; /* كان 0.8rem */
}

/* Cards & blocks */
.project {
  padding: 1.25rem; /* كان 2rem */
  margin-bottom: 1rem; /* كان 2rem */
}
.project-content {
  gap: 1.5rem; /* كان 2.5rem */
  margin-top: 1rem; /* كان 1.5rem */
}
.education-item {
  padding: 1.2rem; /* كان 1.8rem */
  margin-bottom: 1.2rem; /* كان 2.5rem */
}
.skills ul {
  gap: 0.6rem;
} /* كان 1rem */
.skills ul li {
  padding: 0.5rem 1rem;
} /* كان 0.6rem 1.4rem */

/* Honors/Awards section */
.honours-awards {
  padding: 2.5rem 1.5rem;
} /* كان 4rem 2rem */
.award-card {
  padding: 1rem; /* كان 1.5rem */
  margin-bottom: 0.9rem; /* كان 1.5rem */
}

/* Certifications */
.certifications {
  padding: 24px 0;
} /* كان 40px 0 */
.certifications-container {
  gap: 12px;
  padding: 12px 0;
}
.certification-card {
  padding: 18px;
}

/* Footer */
footer {
  padding: 2rem 1.5rem; /* كان 3rem 2rem */
  margin-top: 1.8rem; /* كان 3rem */
}

/* Optional: لو بدك أكثر إحكام بالموبايل */
@media (max-width: 768px) {
  section {
    padding: 1.5rem 1rem;
    margin-bottom: 12px;
  }
  h2 {
    margin-bottom: 0.8rem;
  }
}
/* Fix project image white space */
.project-content {
  align-items: flex-start; /* ما تمدّد كل العناصر */
}

.project-image {
  align-self: flex-start; /* تأكيد عدم التمدّد للصورة */
}

.project-image img {
  display: block;
  width: 100%;
  height: auto; /* object-fit بدون height ما له تأثير */
}
/* improvemets*/
/* اقتراح إضافات لملف CSS */

/* نظام ألوان متدرج حديث */
:root {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(to right, #43e97b 0%, #38f9d7 100%);
}

/* تأثيرات حركية أكثر تطوراً */
@keyframes float-up {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.section-animate {
  animation: float-up 0.8s ease-out forwards;
}

/* تحسينات للشريط المتحرك للشهادات */
.certifications-container {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* تأثيرات hover أكثر تفاعلية */
.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
@media (max-width: 576px) {
  /* تحسينات للهواتف الصغيرة */
  .header-content h1 {
    font-size: 1.8rem;
  }

  .project-links {
    flex-direction: column;
    width: 100%;
  }

  .demo-link,
  .code-link {
    width: 100%;
    text-align: center;
  }
}
/* تلوين الرابط الفعّال */
.nav-links a.active {
  font-weight: 600;
  text-decoration: underline;
}

/* لو الناف ثابتة أعلى الصفحة */
.navbar {
  position: sticky; /* أو position: fixed; top:0; لو حابّة */
  top: 0;
  z-index: 1000;
}

/* خلي الأقسام تاخد هامش سكرول مريح لو الناف ثابتة */
section {
  scroll-margin-top: 80px; /* عدّلي 80px حسب ارتفاع الناف عندك */
}
