/* General Styles */
html {
  scroll-behavior: smooth;
}
body {
    padding-top: 80px; /* يجب أن يكون هذا مساويًا لارتفاع الهيدر */

    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: #0a192f;
    color: #ffffff;
    


}
.main-content {
    padding-top: 90px; /* يجب أن يكون أكبر من أو مساوي لارتفاع الهيدر */
  }
  
/*---------------------------------------------------------------------*/
/* Header Section */
header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    background: #0a192f;
    backdrop-filter: blur(10px); /* تأثير الضبابية */
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
  }
  /* عند التمرير، تصبح الخلفية أوضح وأكثر صلابة */
header.scrolled {
    background: rgba(10, 25, 47, 0.95); /* تقريبًا لون ثابت مع شفافية خفيفة */
    backdrop-filter: blur(10px); /* تقليل الضبابية */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
  /* ضبط الحاوية الرئيسية */
  .header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* توزيع العناصر بين اليسار واليمين */
    padding: 8px 20px;
  }
  
  /* الشعار على اليسار */
  .logo-container {
    flex: 0 0 auto; /* عدم تمدد الشعار */
  }
  
  .logo-container img {
    width: 230px; /* ضبط حجم اللوجو */
    height: auto;
  }
  
  /* القائمة في المنتصف */
  .nav {
    flex: 1; /* تمدد القائمة لملء المساحة المتاحة */
    text-align: center; /* توسيط العناصر داخل القائمة */
    
  }
  
  .nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; /* توسيط العناصر أفقياً */
    gap: 20px;
  }
  
  .nav a {
    text-decoration: none;
    font-size: 16px;

    font-weight: 500;
    color: white;
    transition: color 0.3s ease;
    

  }
  
  .nav a:hover {
      color: rgba(141, 141, 141, 0.95); /* تغيير اللون عند التمرير */
  }
  
  /* زر تحميل السيرة الذاتية على اليمين */
  .header-actions {
    flex: 0 0 auto; /* عدم تمدد الزر */
  }
  
  .download-cv {
    background: rgb(255, 255, 255);
    color: #0a192f;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease;
  }
  
  .download-cv:hover {
    background: #1e3a8a;
    color: rgb(255, 255, 255);
  }
  
/* الخلفية الضبابية */
/* الخلفية الضبابية عند فتح القائمة */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 29;
  }
  
  /* عند فتح القائمة تظهر الطبقة الضبابية */
  .overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* القائمة الجانبية */
  .sidebar {
    position: fixed;
    top: 0;
    right: -270px; /* تبدأ مخفية خارج الشاشة */
    width: 270px;
    height: 100%;
    background: rgba(10, 25, 47, 0.95);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 30;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    backdrop-filter: blur(8px);
  }
  
  /* عند فتح القائمة */
  .sidebar.open {
    right: 0;
  }
  
  /* تنسيق الهيدر */
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    font-weight: bold;
  }
  
  /* زر الإغلاق */
  .close-sidebar {
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: color 0.3s;
  }
  
  .close-sidebar:hover {
    color: #ff4d4d;
  }
  
  /* الروابط */
  .sidebar a {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.3s ease;
  }
  
  .sidebar a:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  
  
/* زر القائمة الجانبية */
.menu-toggle {
    display: none; /* إخفاء القائمة الرئيسية */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    background-color: transparent; /* بدون خلفية افتراضيًا */
    border: none;
    transition: background-color 0.3s ease;
  }
  
  /* عند التحويم، تظهر خلفية خفيفة */
  .menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  /* الخطوط الثلاثة */
  .menu-toggle div {
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: background-color 0.3s ease;
  }
  
  /* عند التحويم، تغيير لون الخطوط قليلاً */
  .menu-toggle:hover div {
    background-color: #f1f1f1;
  }
  
  
  /* استجابة للشاشات الصغيرة */
  @media (max-width: 820px) {
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
    }

    .header-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end; /* محاذاة الزرين لليمين */
        gap: 10px; /* مسافة بين الزرين */
    }

    .download-cv {
        font-size: 0.8rem;
        padding: 8px 12px;
        border-radius: 4px;
        white-space: nowrap;
        text-align: right; /* تأكد أن النص بمحاذاة اليمين */
    }

    .menu-toggle {
        
        display: flex;
    }
   
    .nav {
        display: none; /* إخفاء القائمة الرئيسية */
    }

    /* تصغير اللوجو */
    .logo-container img {
      width: 175px;
    }

  }

  
/*---------------------------------------------------------------------*/
/* Container */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
}

/* Sections */
section {
    background: #112240;
    padding: 25px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-in-out;
}



.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: inherit;
    margin-bottom: 20px;
}

/* Services List */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Service Box Styles */
.service-box {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    display: flex; /* Add this */
    align-items: center; /* Add this */
    justify-content: center; /* Add this */
    flex-direction: column; /* Add this for vertical alignment */
}



.service-box:hover {
    transform: scale(1.05);
    background: #2563eb;
    
}

/* Show More Button Container */
.show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.skill-box {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}



.skill-box:hover {
    transform: scale(1.05);
    background: #2563eb;
}

.skill-box img {
    
    margin-bottom: 10px;
}
.icon {
    width: 200px;  /* عرض موحد */
    height: 100px; /* ارتفاع موحد */
    object-fit: contain; /* يحافظ على الأبعاد داخل المربع */
  }
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    background: #112240;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
}


.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    color: #ff9900;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #cc7a00;
}

/* Contact Section */
#contact {
    padding: 50px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode #contact {
    background: #112240;
    color: white;
}



#contact .contact-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#contact .contact-icons a {
    font-size: 2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

body.dark-mode #contact .contact-icons a {
    color: #ff9900;
}


#contact .contact-icons a:hover {
    transform: scale(1.2);
}

body.dark-mode #contact .contact-icons a:hover {
    color: #cc7a00;
}


/* Footer */
footer {
    text-align: center;
    padding: 25px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode footer {
    background: #1e3a8a;
    color: white;
}



/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    nav a {
        margin: 10px 0;
    }

    .container {
        padding: 20px;
    }
    .services-list,
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-box img {
        height: auto;
    }
}




.project-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
}

/* Contact Form */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form input,
form textarea,
form button {
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

form input:focus,
form textarea:focus {
    outline: 2px solid #ff9900;
}

form button {
    background: #ff9900;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

form button:hover {
    background: #cc7a00;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff9900;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    transition: background 0.3s ease;
}

.back-to-top:hover {
    background: #cc7a00;
}

/* Projects Grid */


.project-card {
    background: #1e293b;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    cursor: pointer;
    text-align: center;
}



.project-card:hover {
    transform: scale(1.05);
    background: #2563eb;
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.project-card img:hover {
    transform: scale(1.1);
}

.project-card p {
    margin: 10px 0;
    font-size: 1rem;
    font-weight: bold;
    color: inherit;
}

.hidden {
    display: none;
}



.show-more-btn:hover {
    background: #cc7a00;
}
/*----------------------------------------------*/
        /* Experience Section */
#experience {
    background: #112240;
    color: white;
    padding: 50px;
    margin: 40px 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-in-out;
}


/* Experience List */
.experience-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Experience Box */
.experience-box {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.experience-box:hover {
    transform: scale(1.05);
    background: #2563eb;
}

/* Experience Details */
.experience-box h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: inherit;
}
.company-name {
    font-size: 1rem;
    color: #ff9900;
    margin: 0 0 5px;
}
.duration {
    font-size: 0.9rem;
    color: #ccc;
    margin: 0 0 10px;
}
.description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ddd;
}
/*----------------------------------------------*/



/* ✅ تصميم شبكة عرض المشاريع */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* يجعل الحد الأقصى 3 أعمدة */
  gap: 20px;
  padding: 20px;
  justify-content: center; /* يجعل الشبكة في المنتصف عند وجود أقل من 3 كروت */
}

  
  /* ✅ تصميم كارت المشروع */
  .project-card {
    background-color: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    text-align: center;
  }
  
  .project-card:hover {
    transform: scale(1.05);
    background-color: #2563eb;
  }
  
  .project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }
  
  .project-card p {
    padding: 15px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
  }
  
  /* ✅ زر Show More */
  .show-more-container {
    text-align: center;
    margin-top: 20px;
  }
  
  .show-more-btn {
    background: rgb(255, 255, 255);
    color: #0a192f;
    border: none;
    font-weight: bold;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 5px;
    transition: background 0.3s ease;
}
  
  .show-more-btn:hover {
    background-color: #0a2853;
    color: #ffffff;
  }

  /*---------------------------------------------------------------------------*/
  
/* ✅ المودال */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);  /* ✅ يضمن التوسيط الكامل */
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
  }
  
  .modal-content {
    background-color: #112240;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    color: #fff;
    position: relative;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #ff9900;
    cursor: pointer;
  }
  
  /* ✅ العنوان */
  #modalTitle {
    margin-bottom: 15px;
  }
  
  /* ✅ الجاليري */
  .image-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .gallery-container {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
  }
  
  .gallery-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
  }
  
  .gallery-container img:hover {
    transform: scale(1.01);
  }
  
  /* ✅ أزرار التحكم */
  .gallery-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
  }
  
  .gallery-controls button,
  .prev-btn,
  .next-btn {
    background-color: #ff9900;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
  }
  
  .gallery-controls button:hover,
  .prev-btn:hover,
  .next-btn:hover {
    background-color: #cc7a00;
  }
  
  /* ✅ وصف المشروع */
  .modal-description {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.7;
    color: #ccc;
    text-align: left;
    word-break: break-word;
  }
  .modal::-webkit-scrollbar {
    width: 6px; /* ✅ عرض صغير جدًا للسكروول */
  }
  
  .modal::-webkit-scrollbar-track {
    background: transparent; /* ✅ خلفية شفافة */
  }
  
  .modal::-webkit-scrollbar-thumb {
    background-color: rgba(255, 153, 0, 0.6); /* ✅ لون thumb بلون الموقع وشفاف */
    border-radius: 10px;
  }
  
  .modal::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 153, 0, 0.9); /* ✅ عند الوقوف عليه يظهر أوضح */
  }
  
  /* دعم Firefox */
  .modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 153, 0, 0.6) transparent;
  }
  
  /* ✅ موبايل و تابلت */
  @media (max-width: 600px) {
    .modal-content {
      width: 85%;
      max-height: 90vh;         /* ✅ أقصى ارتفاع */
      margin: 20px auto;
      padding: 10px;
      background-color: #0b1c3a;
      border-radius: 10px;
      overflow-y: auto;         /* ✅ يعمل Scroll داخلي */
    }
  
    #modalTitle {
      font-size: 18px;
      text-align: center;
      color: white;
      max-width: 80%;  /* تحديد عرض أقصى للعنوان */
      word-wrap: break-word;  /* السماح بانتقال الكلمات إلى سطر جديد */
      overflow-wrap: break-word; /* التأكد من عدم تجاوز النص للحدود */
      white-space: normal; /* السماح للنص بالنزول للسطر التالي */
      text-align: center;  /* توسيط النص أفقيًا */
      margin: 0 auto; /* ضمان التوسيط داخل الحاوية */
      display: block; /* التأكد من أن العنصر يتصرف كمربع */
    }
  
    .gallery-container {
      height: 220px;            /* ✅ حجم الصورة مناسب */
      position: relative;
      border-radius: 8px;
      overflow: hidden;
    }
  
    .gallery-container img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  
    /* ✅ أزرار التنقل فوق الصورة */
    .gallery-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background-color: rgba(0, 0, 0, 0.4);
      color: #fff;
      border: none;
      padding: 10px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 18px;
      transition: background 0.3s;
    }
  
    .gallery-btn:hover {
      background-color: rgba(0, 0, 0, 0.7);
    }
  
    .prev-btn {
      left: 10px;
    }
  
    .next-btn {
      right: 10px;
    }
  
    .modal-description {
      font-size: 14px;
      line-height: 1.6;
      color: #ccc;
      text-align: left;
      margin-top: 15px;
    }
  }
  
  
  
