/* ====== GLOBAL ====== */
html {
  scroll-behavior: smooth; /* هذا هو السطر المسؤول عن النعومة */
  scroll-padding-top: 80px; /* لترك مسافة للقائمة العلوية حتى لا تغطي العنوان */
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #0a0f1f;
  color: #ffffff;
  line-height: 1.7;
  transition: 0.3s ease;
}

body.light {
  background: #f2f6ff;
  color: #111;
}

img {
  max-width: 100%;
  border-radius: 10px;
}

/* ====== NAVIGATION ====== */
nav {
  width: 100%;
  padding: 18px 8%;
  background: rgba(15, 20, 40, 0.9);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  backdrop-filter: blur(7px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body.light nav {
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid #ccc;
}

nav .logo {
  font-size: 21px;
  font-weight: 700;
  color: #00aaff;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 25px;
}

.nav-links a {
  color: #bcd1ff;
  text-decoration: none;
  font-size: 15px;
  transition: 0.25s;
}

body.light .nav-links a {
  color: #333;
}

.nav-links a:hover {
  color: #00aaff;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.download {
  padding: 7px 14px;
  border: 1px solid #00aaff;
  color: #00aaff;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.25s;
}

body.light .download {
  color: #0077aa;
  border-color: #0077aa;
}

.download:hover {
  background: #00aaff;
  color: #000;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* ====== HERO ====== */
.hero {
  padding: 150px 8% 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
}

.hero-left {
  flex: 1;
}

.hero-left h1 {
  font-size: 40px;
  font-weight: 700;
}

.hero-left h1 span {
  color: #00aaff;
}

.role {
  font-size: 24px;
  margin: 10px 0;
  color: #00aaff;
  height: 28px;
}

.lead {
  margin-bottom: 20px;
  color: #c6d4ff;
}

body.light .lead {
  color: #333;
}

.btns {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid #00aaff;
  text-decoration: none;
  font-size: 15px;
  transition: 0.3s;
  background: #000;
  color: #00aaff;
}

.btn.primary {
  background: #00aaff;
  color: #000;
}

body.light .btn {
  background: #fff;
  border-color: #0077aa;
  color: #0077aa;
}

body.light .btn.primary {
  background: #0077aa;
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
}

/* HERO SOCIAL ICONS */
.hero-social {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.hero-social .social {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.15);
  transition: 0.3s ease;
}

.hero-social .social:hover {
  transform: translateY(-4px) scale(1.08);
  background: #00aaff;
  color: black;
}

/* Special colors for branding */
.social.linkedin:hover { background: #0077b5!important; color:white !important; }
.social.github:hover { background: #333!important; color:white!important; }
.social.facebook:hover { background: #1877f2!important; color:white!important; }
.social.whatsapp:hover { background: #25D366!important; color:white!important; }
/* ============================
   SOCIAL ICONS — LIGHT MODE
============================ */

body.light .hero-social .social {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

body.light .hero-social .social:hover {
  color: #fff !important;
}

/* LinkedIn */
body.light .social.linkedin:hover {
  background: #0077b5 !important;
}

/* GitHub */
body.light .social.github:hover {
  background: #333 !important;
}

/* Facebook */
body.light .social.facebook:hover {
  background: #1877f2 !important;
}

/* WhatsApp */
body.light .social.whatsapp:hover {
  background: #25D366 !important;
}


/* ====== HERO IMAGE ====== */
.hero-right img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  object-position: center top;
  
  clip-path: polygon(
    50% 0%,
    93% 25%,
    93% 75%,
    50% 100%,
    7% 75%,
    7% 25%
  );

  background: transparent;
  filter: drop-shadow(0 0 80px #00eaff);
}

.hero-right {
  position: relative;
}

.hero-right::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #00eaff;
  filter: blur(70px);
  opacity: 0.35;
  z-index: -1;
  border-radius: 50%;
}

/* ====== LIGHT MODE FIX FOR IMAGE SHADOW ====== */
body.light .hero-right::before {
  background: #0090cc;
  opacity: 0.2;
}

/* ====== PERSONAL BOX ====== */
.personal {
  margin-top: 15px;
  background: rgba(255,255,255,0.06);
  padding: 12px;
  border-radius: 10px;
}

body.light .personal {
  background: #ffffff;
  border: 1px solid #ddd;
  color: #333;
}

/* ====== SECTIONS ====== */
.section {
  padding: 80px 8%;
}

.section h3 {
  font-size: 27px;
  margin-bottom: 15px;
  color: #00aaff;
}

body.light .section h3 {
  color: #008ad1;
}

.section p {
  max-width: 800px;
  color: #c6d4ff;
}

body.light .section p {
  color: #333;
}

/* ABOUT */
.highlights {
  margin-top: 15px;
  list-style: inside;
  color: #c6d4ff;
}

body.light .highlights {
  color: #444;
}

/* SKILLS GRID */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.skill {
  background: rgba(255,255,255,0.05);
  padding: 15px;
  border-radius: 10px;
}

body.light .skill {
  background: white;
  border: 1px solid #ddd;
  color: #333;
}

.skill h4 {
  color: #00aaff;
}

body.light .skill h4 {
  color: #008ad1;
}

/* PROJECTS */
.project {
  background: rgba(255,255,255,0.05);
  padding: 18px;
  border-radius: 12px;
  margin-bottom: 18px;
}

body.light .project {
  background: #fff;
  border: 1px solid #ddd;
  color: #333;
}

/* EDUCATION */
.edu-list {
  list-style: none;
}
/* =========================================
   PROJECTS & EDUCATION LIST STYLING (FINAL)
   ========================================= */

/* 1. Projects Layout */
.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.project-link {
  color: #00aaff;
  font-size: 24px;
  transition: 0.3s;
  text-decoration: none;
}

.project-link:hover {
  color: #fff;
  transform: scale(1.1);
}

.project h4 {
  color: #00aaff;
  margin-bottom: 5px;
}

.project-list {
  list-style-type: disc;
  margin-left: 20px;
  margin-top: 10px;
  color: #c6d4ff;
}

.project-list li {
  margin-bottom: 8px;
}

.project-list li::marker {
  color: #00aaff;
}

/* 2. Education Layout (Fixed Alignment) */
.edu-list li {
  position: relative; /* المرجع الأساسي */
  margin-bottom: 25px;
}

.edu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  position: relative;
  padding-right: 50px; /* مساحة احتياطية */
}

.edu-date {
  color: #00aaff;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  margin-right: 45px; /* يترك مسافة ثابتة للأيقونة دائماً */
}

/* Icon Container/Link */
.cert-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  text-align: center;
  color: #c6d4ff;
  font-size: 18px;
  transition: 0.3s;
}

.cert-link:hover {
  color: #00aaff;
  transform: translateY(-50%) scale(1.1);
}

/* =========================================
   LIGHT MODE ADJUSTMENTS (FINAL FIXES)
   ========================================= */

/* Projects Text */
body.light .project h4 { color: #008ad1; }
body.light .project-list li { color: #333333; }
body.light .project p { color: #333333; }
body.light .project-list { color: #333333; }

/* Projects Box Shadow */
body.light .project {
  background: #ffffff;
  border: 1px solid #d1d9e6;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Icons in Light Mode */
body.light .project-link,
body.light .cert-link {
  color: #0077aa;
}

body.light .project-link:hover {
  color: #222222;
}

body.light .cert-link:hover {
  color: #222222;
  transform: translateY(-50%) scale(1.1);
}
/* ====== CONTACT FORM FIX (إصلاح النموذج) ====== */

form {
  max-width: 600px;
  display: grid; /* هذا هو السطر السحري الذي يرتب العناصر تحت بعضها */
  gap: 15px;     /* مسافة بين كل حقل وآخر */
  margin-top: 20px;
}

form label {
  font-weight: bold;
  display: block; /* يجعل الاسم يظهر فوق الخانة وليس بجانبها */
  margin-bottom: 5px;
}

/* تنسيق الحقول لتأخذ العرض الكامل */
input, textarea {
  width: 100%; /* يجعل الحقل يمتد لنهاية السطر */
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 15px;
  outline: none; /* إزالة الإطار الأزرق الافتراضي عند الكتابة */
}

/* تنسيق خاص للوضع المضيء (Light Mode) */
body.light input,
body.light textarea {
  background: #ffffff;
  border: 1px solid #ccc;
  color: #111;
}

textarea {
  resize: vertical; /* يسمح بتكبير الخانة عمودياً فقط */
}

form button {
  margin-top: 10px;
  cursor: pointer;
}
/* =========================================
   إصلاح قسم التواصل والفوتر (النسخة النهائية)
   ========================================= */

/* 1. تنسيق النموذج (ليكون عمودياً ومرتباً) */
form {
  max-width: 600px;
  display: grid; /* يرتب العناصر تحت بعضها */
  gap: 15px;
  margin-top: 20px;
}

form label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

input, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 15px;
  outline: none;
}

/* تنسيق الحقول في الوضع المضيء */
body.light input,
body.light textarea {
  background: #ffffff;
  border: 1px solid #ccc;
  color: #111;
}

textarea {
  resize: vertical;
}

/* 2. تنسيق رسالة النجاح (مخفية افتراضياً) */
.success-message {
  width: 100%;
  max-width: 600px;
  margin: 20px 0; /* مسافة من الأعلى والأسفل */
  padding: 15px;
  background: #00cc44; /* لون أخضر */
  color: white;
  font-weight: bold;
  border-radius: 8px;
  text-align: center;
  
  /* أهم جزء: الإخفاء الافتراضي */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* هذا الكلاس يضاف عبر الجافاسكريبت لإظهار الرسالة */
.success-message.show {
  opacity: 1;
  visibility: visible;
}

/* 3. تنسيق الفوتر (حقوق النشر) */
footer {
  text-align: center; /* توسيط النص */
  padding: 30px 20px;
  background: rgba(255,255,255,0.03); /* خلفية شفافة جداً */
  margin-top: 50px; /* إبعاد الفوتر عن المحتوى */
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
  color: #8892b0;
}

body.light footer {
  background: #f8f9fa;
  border-top: 1px solid #e1e4e8;
  color: #555;
}
/* ====== إصلاح ألوان نصوص التعليم ====== */

/* 1. جعل النص الوصفي (الديبلوم، النقطة) باللون الأزرق الفاتح مثل باقي الموقع */
.edu-list li {
  color: #c6d4ff;
}

/* 2. الحفاظ على اسم المدرسة (العنوان) باللون الأبيض ليكون بارزاً */
.edu-head strong {
  color: #ffffff;
  font-size: 1.1em; /* تكبير بسيط للعنوان ليكون أوضح */
}

/* ====== إصلاح الألوان في الوضع المضيء (Light Mode) ====== */
body.light .edu-list li {
  color: #444444; /* لون رمادي للنصوص */
}

body.light .edu-head strong {
  color: #000000; /* لون أسود لاسم المدرسة */
}


/* ====== RESPONSIVE DESIGN (FIXES FOR MOBILE) ====== */
@media (max-width: 900px) {
  
  nav {
    padding: 15px 5%;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* إخفاء القائمة العلوية في الموبايل لترتيب الشكل */
  .nav-links {
    display: none;
  }

  /* تنسيق الهيرو (الواجهة الرئيسية) */
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 100px; /* مسافة من الأعلى */
    gap: 30px;
  }

  .hero-right {
    order: -1; /* رفع الصورة فوق النص */
    margin-bottom: 20px;
  }

  /* --- إصلاح مشكلة الصورة --- */
  .hero-right img {
    width: 250px;  /* تصغير العرض للموبايل */
    height: 250px; /* تصغير الطول للموبايل */
    
    /* ضمان ظهور الوجه بالكامل */
    object-fit: cover;
    object-position: center top; 
  }

  /* تصغير وتوسط دائرة التوهج خلف الصورة */
  .hero-right::before {
    width: 200px;
    height: 200px;
    top: 25px; /* ضبط التمركز */
  }

  /* --- إصلاح مشكلة تداخل النص (Typing Text) --- */
  .role {
    height: auto;        /* السماح للصندوق بالتمدد حسب الحاجة */
    min-height: 50px;    /* حجز مساحة كافية لمنع القفز */
    margin-bottom: 25px; /* دفع النص الأسفل للابتعاد عنه */
    font-size: 18px;     /* تصغير الخط قليلاً ليناسب الشاشة */
    line-height: 1.4;    /* تحسين المسافة بين الأسطر */
    white-space: normal; /* السماح للنص بالنزول لسطر ثاني إذا كان طويلاً */
  }

  .hero-left h1 {
    font-size: 32px; /* تصغير العنوان الرئيسي قليلاً */
  }

  .btns {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* جعل المشاريع والمهارات عموداً واحداً */
  .skill-grid, form {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: 60px 5%;
  }
}
/* ====== تأثيرات التحويم (Hover Effects) للوضع الليلي ====== */

/* 1. تأثير عند مرور الماوس على "المشاريع" و "المهارات" */
.skill:hover, 
.project:hover {
  background: rgba(255, 255, 255, 0.1); /* يجعل الخلفية أفتح قليلاً */
  border: 1px solid #00aaff;             /* يضيف إطاراً أزرق متوهجاً */
  transform: translateY(-5px);           /* يرفع البطاقة قليلاً للأعلى */
  transition: all 0.3s ease;             /* يجعل الحركة ناعمة */
}

/* 2. تأثير عند مرور الماوس على خانات "اتصل بي" (Form Inputs) */
input:hover, textarea:hover,
input:focus, textarea:focus {
  border-color: #00aaff;          /* يتغير لون الإطار للأزرق */
  background: rgba(255, 255, 255, 0.1); /* تصبح الخلفية أفتح */
  outline: none;
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.2); /* ظل أزرق خفيف */
  transition: 0.3s;
}
/* ====== إصلاح هوفر القائمة العلوية في الوضع المضيء ====== */
body.light .nav-links a:hover {
  color: #0077aa !important; /* لون أزرق داكن وواضح */
  transform: scale(1.05);    /* تكبير بسيط للنص */
}