/* ------------------------------
    Global Variables
------------------------------ */
:root {
    --Mainbackground: #0D0D0D;
    --Secondarybackground: #1A1A1A;
    --Maintext: #ffffff;
    --Secondarytext: #bfbfbf7c;
    --Accentcolor: #7bf3f3;
    --Warningcolor: #f25e8c;
    --padding: 8%;
}

/* ------------------------------
    Reset Styles
------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

html {
    font-family: "Josefin Sans", sans-serif;
    font-size: 16px;
    color: var(--Maintext);
    scroll-behavior: smooth;
}

/* ------------------------------
    Home Section
------------------------------ */
.home {
    width: 100%;
    height: 100vh;
    background-color: var(--Mainbackground);
    display: flex;
    flex-direction: column;
}

span {
    color: var(--Accentcolor);
}

h2 {
    font-size: 2.2rem;
    letter-spacing: 0.12rem;
    cursor: pointer;
}

nav {
    padding: 2.8rem var(--padding) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul li {
    list-style-type: none;
    display: inline-block;
    margin: 0.8rem 1.5rem;
}

nav ul li a {
    color: var(--Maintext);
    text-decoration: none;
    text-transform: capitalize;
    transition: 0.4s;
}

nav ul li a:hover {
    color: var(--Secondarybackground);
    padding: 5px 15px;
    border-radius: 15px;
    background-color: var(--Accentcolor);
}

.content {
    flex-grow: 1;
    padding: 0 var(--padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.container-texts {
    width: 50%;
}

h1 {
    font-size: 4.45rem;
    margin: 1.7rem 0;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    color: var(--Warningcolor);
    font-size: 1.25rem;
    letter-spacing: 0.12rem;
}

.social {
    margin-top: 3.5rem;
}

.social img {
    margin-right: 2rem;
    width: 2.5rem;
}

.social img:hover {
    transform: scale(1.2);
    transition: .4s;
}

.home .container-images {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.4s;
    overflow: visible;
}

.home .container-images .shape {
    position: absolute;
    width: 150%;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: 0.4s;
    border-radius: 68% 32% 49% 51% / 53% 37% 63% 47% ;
}

.home .container-images .mypic {
    position: absolute;
    width: 90%;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: 0.4s;
}

.home .container-images:hover .shape {
    transform: translate(-50%, -49%);
}

.home .container-images:hover .mypic {
    transform: translate(-49%, -50%);
}

/* .................................................... 
................................................about section 
.................................................... */

.about {
    background-color: var(--Secondarybackground);
    padding: 2rem var(--padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.about .container-images {
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about .container-images img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.about .about-text {
    width: 55%;
    color: var(--Mainbackground);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.about .about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about .about-text p {
    font-size: 2rem;
    line-height: 1.8;
}

p {
    margin-top: 20px;
    color: var(--Warningcolor);
    letter-spacing: 1px;
    line-height: 1.7rem;
    font-size: 1.1rem;
}

h5 {
    font-size: 1.37rem;
    letter-spacing: 2px;
}

/* .................................................... 
................................................my Certifications section 
.................................................... */

.certifications {
    padding: 50px 20px;
    background: var(--Mainbackground);
  }
  .certifications-header h2 {
    text-align: center;
    font-size: 2.5rem;
  }
  .certifications-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
  }
  .certificate {
    background: var(--Secondarybackground);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .certificate img {
    width: 500px;
    height: auto;
    margin: 0 0 0 10px;
    border-radius: 20px;
  }
  .cert-info h4 {
    margin: 10px 0 5px;
    color: var(--Maintext);
  }
  .cert-info p {
    font-size: 0.9rem;
    color: var(--Warningcolor);
  }

  .certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .certificate:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: 0.4s ease;
}

.certificate a {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: var(--Accentcolor);
    color: var(--Mainbackground);
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.certificate a:hover {
    background-color: var(--Warningcolor);
}

/* Projects Section */
.projects {
    padding: 3rem var(--padding);
    background-color: var(--Secondarybackground);
}

.projects-header {
    text-align: center;
    margin-bottom: 2rem;
}

.projects-header h2 {
    font-size: 2.5rem;
    color: var(--Maintext);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Project Card */
.project-card {
    background-color: var(--Mainbackground);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}


.fair{
    text-align: center; /* توسيط النص */
}

.project-card h5 {
    font-size: 1.5rem;
    color: var(--Maintext);
    margin-bottom: 1rem;
}

.project-card p {
    font-size: 1rem;
    color: var(--Secondarytext);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-card a {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: var(--Accentcolor);
    color: var (--Mainbackground);
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.project-card a:hover {
    background-color: var(--Warningcolor);
}

/* تحسين تصميم Certifications و Projects على الموبايل والتابلت */
@media screen and (max-width: 1024px) {
    /* Certifications Section */
    .certifications-content {
        grid-template-columns: 1fr; /* عرض الكروت في عمود واحد */
        gap: 1.5rem; /* مسافة بين الكروت */
    }

    .certificate {
        padding: 1.5rem; /* مسافة داخلية للكارت */
        border-radius: 10px; /* حواف دائرية */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* ظل خفيف */
        text-align: center; /* توسيط النص */
        transition: transform 0.3s ease, box-shadow 0.3s ease; /* تأثير سلس */
    }

    .certificate img {
        width: 100%; /* عرض الصورة بالكامل */
        height: auto; /* الحفاظ على نسبة العرض إلى الارتفاع */
        margin-bottom: 1rem; /* مسافة أسفل الصورة */
        border-radius: 8px; /* حواف دائرية للصورة */
    }

    .certificate h4 {
        font-size: 1.5rem; /* حجم النص */
        margin-bottom: 0.5rem; /* مسافة أسفل العنوان */
    }

    .certificate p {
        font-size: 1rem; /* حجم النص */
        line-height: 1.6; /* تحسين المسافة بين الأسطر */
    }

    /* Projects Section */
    .projects-grid {
        grid-template-columns: 1fr; /* عرض الكروت في عمود واحد */
        gap: 1.5rem; /* مسافة بين الكروت */
    }

    .project-card {
        padding: 1.5rem; /* مسافة داخلية للكارت */
        border-radius: 10px; /* حواف دائرية */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* ظل خفيف */
        text-align: center; /* توسيط النص */
        transition: transform 0.3s ease, box-shadow 0.3s ease; /* تأثير سلس */
    }

    .project-card img {
        width: 100%; /* عرض الصورة بالكامل */
        height: auto; /* الحفاظ على نسبة العرض إلى الارتفاع */
        margin-bottom: 1rem; /* مسافة أسفل الصورة */
        border-radius: 8px; /* حواف دائرية للصورة */
    }

    .project-card h5 {
        font-size: 1.5rem; /* حجم النص */
        margin-bottom: 0.5rem; /* مسافة أسفل العنوان */
    }

    .project-card p {
        font-size: 1rem; /* حجم النص */
        line-height: 1.6; /* تحسين المسافة بين الأسطر */
    }
}

/* .................................................... 
................................................my servies section 
.................................................... */

.services {
    background-color: var(--Mainbackground);
    padding: 2rem var(--padding);
}

.text_center {
    text-align: center;
}

.box {
    display: flex;
    justify-content: space-between; /* مسافة بين الكروت */
    gap: 20px; /* مسافة بين الكروت */
    padding: 20px;
}

.card {
    width: 30%; /* عرض الكارت */
    padding: 25px;
    border-radius: 10px;
    background-color: var(--Secondarybackground); /* خلفية فاتحة داخل الكارت */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* الظل حول الكارت */
    text-align: center;
    transition: all 0.3s ease; /* تأثير حركة عند التفاعل مع الكارت */
    height: 350px; /* زيادة طول الكارت */
}

.card:hover {
    background-color: rgb(51, 96, 120); /* تغيير اللون عند المرور بالفأرة */
    transform: translateY(-5px); /* رفع الكارت قليلاً عند المرور بالفأرة */
}

.card img {
    width: 50px; /* تصغير حجم الصورة */
    height: 50px;
    margin-bottom: 30px; /* زيادة المسافة بين الصورة والنص */
}

.card h5 {
    font-size: 1.5rem; /* تقليص حجم العنوان */
    margin-bottom: 40px; /* زيادة المسافة بين العنوان والنص */
    letter-spacing: 2px;
}

.card p {
    font-size: 1rem;
    color: var(--Warningcolor);
    line-height: 1.6;
    font-size: 1rem;
    letter-spacing: 2px;
}

/* ------------------------------
    Skills Section
------------------------------ */
.skills {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: var(--Secondarybackground);
}

.skills-header h2 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 2rem;
    text-align: left;
    color: var(--Maintext);
}

.skills-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 skills per row */
    gap: 1.5rem;
    width: 65%;
}

.skill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #703333;
    padding: 1rem;
    border-radius: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    height: 150px; /* Adjust the height of each skill box */
}

.skill:hover {
    transform: scale(1.05);
}

.skill img {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

.skill h4 {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: var(--Maintext);
}

.cv-image {
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 75%;
}

.cv-image img {
    width: 200%;
    max-width: 450px; /* Adjust the max width of the CV image */
    height: auto;
    object-fit: contain;
}

/* .................................................... 
............................................... Explanations section 
.................................................... */

.explanations {
    background-color: var(--Mainbackground);
    padding: 3rem var(--padding);
}

.explanations-header h2 {
    font-size: 2.5rem;
    color: var(--Maintext);
    margin-bottom: 4rem;
    text-align: center;
}

.explanations-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Books Already Explained */
.book-list {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.book {
    width: 45%; /* Increase the width to better fit content */
    background-color: var(--Secondarybackground);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    text-align: center;
    position: relative; /* Required for absolute positioning of button */
}

.book:hover {
    transform: scale(1.05);
}

/* Image of the book */
.book-info img {
    width: 100%;
    height: 300px; /* تحديد ارتفاع الصورة */
    object-fit: contain; /* عرض الصورة كاملة بدون قص */
    border-radius: 12px 12px 0 0;
}

/* Box with the book info */
.book-box {
    background-color: var(--Secondarybackground);
    padding: 1.5rem;
    border-radius: 0 0 12px 12px;
    position: relative; /* Make box position relative for absolute button */
}

.book-box h4 {
    font-size: 2rem;
    color: var(--Maintext);
    margin: 2rem .5rem;
}

.book-box p {
    font-size: 1rem;
    color: var(--Warningcolor);
    margin: 2rem .5rem;
}

.watch-link, .soon-link {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.4s ease;
    position: absolute;
    bottom: 1rem; /* Positioning the button at the bottom */
    left: 50%;
    transform: translateX(-50%);
}

/* Watch Link Button */
.watch-link {
    background-color: var(--Accentcolor);
    color: var(--Mainbackground);
}

.watch-link:hover {
    background-color: var(--Warningcolor);
}

/* Soon Link Button */
.soon-link {
    background-color: var(--InfoColor); /* Different color for Soon button */
    color: var(--Mainbackground);
}

.soon-link:hover {
    background-color: var(--Warningcolor);
}

/* Soon to be Explained Books */
.soon-books {
    text-align: center;
}

.soon-books h3 {
    font-size: 2rem;
    color: var(--Maintext);
    margin-bottom: 1.5rem;
}

.soon-books .book-list {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.soon-books .book {
    width: 23%; /* Adjust width to fit 4 books in a row */
    background-color: var(--Secondarybackground);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative; /* Position for button */
}

.soon-books .book-info img {
    width: 100%;
    height: 300px; /* تحديد ارتفاع الصورة */
    object-fit: contain;
    border-radius: 12px 12px 0 0;
}

.soon-books .book-info h4 {
    font-size: 1.6rem;
    color: var(--Maintext);
    margin-bottom: 1rem;
}

.soon-books .book-info p {
    font-size: 1rem;
    color: var(--Secondarytext);
}

.soon-link {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.4s ease;
    position: absolute;
    bottom: 1rem; /* Positioning the button at the bottom */
    left: 50%;
    transform: translateX(-50%);
}

/* Watch Link Button */
.soon-link {
    background-color: var(--Warningcolor);
    color: var(--Mainbackground);
}

.soon-link:hover {
    background-color: var(--Warningcolor);
}

/* .................................................... 
................................................ Contact Section
.................................................... */

.contact-me {
    background-color: var(--Secondarybackground);
    padding: 3rem var(--padding);
    text-align: center;
}

.contact-header h2 {
    font-size: 2.5rem;
    color: var(--Maintext);
    margin-bottom: 1rem;
}

.contact-header p {
    font-size: 1.2rem;
    color: var(--Secondarytext);
    margin-bottom: 2rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--Secondarybackground);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.contact-form label {
    font-size: 1.2rem;
    color: var(--Maintext);
    margin-bottom: 0.5rem;
    display: block;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--Accentcolor);
    font-size: 1rem;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    padding: 1rem 2rem;
    background-color: var(--Accentcolor);
    color: var(--Mainbackground);
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.4s ease;
}

.contact-form button:hover {
    background-color: var(--Warningcolor);
}

/* تنسيق الزر */
.scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--Secondarytext); /* اللون الأخضر */
    color: var(--Accentcolor);
    border: none;
    padding: 15px;
    border-radius: 40%;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    opacity: 0; /* يبدأ الزر غير مرئي */
    transition: opacity 0.5s ease-in-out;
    z-index: 1000;
}

/* إظهار الزر عند التمرير */
body {
    min-height: 2000px; /* لجعل الصفحة طويلة للاختبار */
}

/* إظهار الزر عندما يتم التمرير لأسفل */
.scrollToTop {
    opacity: 1;
}

/* عند التمرير لأسفل يظهر الزر */
.scrollToTop:hover {
    background-color: #517c53;
}

html {
    scroll-behavior: smooth; /* يجعل التمرير انسيابيًا */
}

/* .................................................... 
................................................ menu 
.................................................... */
nav ul.is-active {
    display: block; /* أو أي خاصية تريد تفعيلها */
}

#menu {
    display: none; /* في البداية مخفي */
}

#menu {
    display: none;
    position: relative;
    appearance: none;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    user-select: none;
}

#menu span {
    display: block;
    width: 33px;
    height: 4px;
    background-color: #FFFFFF;
    border-radius: 8px;
    transform-origin: 0 0;
    transition: 0.4s;
    margin-bottom: 5px;
}

#menu span:nth-child(1) {
    transform: rotate(0deg);
}

#menu span:nth-child(2) {
    transform: rotate(0deg);
}

/* تصميم زر القائمة */
.menu-button {
    display: none; /* مخفي على الشاشات الكبيرة */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--Maintext);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* إخفاء القائمة افتراضيًا */
.menu-list {
    display: none;
    position: fixed;
    top: 60px;
    right: 0;
    background-color: var(--Mainbackground);
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    flex-direction: column;
    gap: 1rem;
}

.menu-list li {
    list-style: none;
    text-align: center;
}

.menu-list li a {
    font-size: 1rem;
    color: var(--Maintext);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.menu-list li a:hover {
    background-color: var(--Accentcolor);
    color: var(--Mainbackground);
}

/* إظهار القائمة عند الضغط */
.menu-list.active {
    display: flex;
}

/* ------------------------------
   Mobile Styles
------------------------------ */
@media screen and (max-width: 768px) {
    /* Adjust skills layout for mobile */
    .skills-list {
        grid-template-columns: repeat(2, 1fr); /* 2 skills per row */
        gap: 1rem;
        padding: 1rem;
        width: 100%;
    }

    .skill {
        height: 150px; /* Maintain consistent height */
    }

    .skill img {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }

    .skill h4 {
        font-size: 1rem;
    }

    /* Adjust home section for mobile */
    .home {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .container-texts {
        width: 100%;
    }

    .container-texts h1 {
        font-size: 3rem; /* Reduce heading size */
    }

    .container-images {
        display: none; /* Hide images on mobile */
    }

    /* General styles */
    html {
        font-size: 14px; /* تقليل حجم الخط */
    }

    body {
        font-size: 14px; /* تقليل حجم الخط */
    }

    nav {
        padding: 1.5rem var(--padding) 0;
    }

    .home {
        padding: 2rem;
    }

    .content {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .container-texts {
        width: 100%;
        text-align: center;
    }

    .container-texts h1 {
        font-size: 3rem; /* تقليل حجم العنوان */
    }

    .container-texts h2 {
        font-size: 1.8rem; /* تقليل حجم العنوان الفرعي */
    }

    .container-texts h3 {
        font-size: 1.2rem; /* تقليل حجم العنوان الفرعي */
    }

    .container-texts h4 {
        font-size: 1.5rem; /* تقليل حجم العنوان الفرعي */
    }

    .container-texts p {
        font-size: 1rem; /* تقليل حجم النص */
    }

    /* إخفاء الصور الكبيرة */
    .container-images img,
    .cv-image,
    .about .container-images {
        display: none;
    }

    .about {
        padding: 2rem 1rem;
        flex-direction: column;
        align-items: center;
    }

    .about .container-images {
        width: 100%;
        display: none; /* إخفاء الصور على الأجهزة المحمولة */
    }

    .about .container-images img {
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }

    .about .about-text {
        width: 100%;
        text-align: center;
    }

    .about {
        flex-direction: column;
        text-align: center;
    }

    .about .about-text {
        width: 100%;
    }

    .services .box {
        flex-direction: column;
        gap: 1.5rem;
    }

    .services .card {
        width: 100%;
    }

    .skills-content {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .skills-list {
        grid-template-columns: repeat(1, 1fr); /* عرض المهارات في عمودين */
    }

    .book-list,
    .soon-books .book-list {
        flex-direction: column;
        width: 100%;
    }

    .book,
    .soon-books .book {
        width: 100%;
        margin-bottom: 1rem;
    }

    .contact-form {
        width: 90%;
    }

    .scrollToTop {
        bottom: 15px;
        right: 15px;
    }

    .menu-button {
        display: flex;
    }

    nav ul {
        display: none; /* إخفاء القائمة الافتراضية */
    }
} /* Close the @media screen and (max-width: 768px) block */

/* تحسين التصميم على الهواتف المحمولة */
@media screen and (max-width: 768px) {
    /* تعديل الـ Header */
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--Mainbackground);
        padding: 1rem var(--padding); /* تقليل المسافة الداخلية */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .content {
        margin-top: 70px; /* إضافة مسافة لتجنب التداخل مع الـ Header */
    }

    /* تحسين My Skills */
    .skills-list {
        grid-template-columns: repeat(2, 1fr); /* عرض المهارات في عمودين */
        gap: 1rem; /* مسافة بين العناصر */
    }

    .skill {
        padding: 0.8rem; /* تقليل المسافة الداخلية */
        border-radius: 10px; /* تقليل الحواف */
    }

    .skill img {
        width: 35px; /* تصغير حجم الصور */
        height: 35px;
        margin-bottom: 0.5rem; /* تقليل المسافة بين الصورة والنص */
    }

    .skill h4 {
        font-size: 0.9rem; /* تصغير حجم النص */
        text-align: center;
    }
}

@media screen and (max-width: 768px) {
    .content {
        display: flex;
        flex-direction: column;
        justify-content: center; /* لجعل المحتوى في منتصف الصفحة عموديًا */
        align-items: center; /* لجعل المحتوى في منتصف الصفحة أفقيًا */
        height: 200vh; /* اجعل القسم يأخذ ارتفاع الشاشة بالكامل */
        text-align: center; /* توسيط النصوص */
        margin-top: 13rem;
    }

    .content h4 {
        font-size: 20px; /* تكبير حجم النصوص */
    }

    .content h1 {
        font-size: 450px; /* تكبير حجم النصوص */
    }

    .container-texts {
        margin-bottom: 3rem; /* إضافة مسافة بين النصوص والأيقونات */
    }

    .social {
        margin-top: 3rem; /* مسافة بين النصوص والأيقونات */
    }

    .social img {
        width: 40px; /* تصغير حجم الأيقونات */
        height: 40px;
        margin: 0 0.5rem; /* مسافة بين الأيقونات */
    }

    .container-apper img {
        margin-top: 3rem; /* مسافة بين النصوص والصورة */
        width: 220px; /* حجم الصورة */
        height: 220px; /* حجم الصورة */
    }
}

/* تحسين التصميم على الهواتف المحمولة */
@media screen and (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--Mainbackground);
        padding: 1rem var(--padding);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .menu-container {
        display: none; /* إخفاء القائمة الافتراضية */
    }

    .menu-container.active {
        display: flex; /* إظهار القائمة عند التفعيل */
        flex-direction: column;
        gap: 1rem;
    }

    .content {
        margin-top: 70px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: calc(100vh - 70px);
        text-align: center;
    }

    .container-texts {
        width: 100%;
        text-align: center;
    }

    .container-images {
        display: none; /* إخفاء الصور على الهاتف */
    }
}

/* تحسين تصميم About Me */
@media screen and (max-width: 768px) {
    .about {
        display: flex;
        flex-direction: column; /* ترتيب عمودي */
        align-items: center;
        text-align: center;
        gap: 1.5rem; /* مسافة بين النص والصورة */
    }

    .about .container-images {
        width: 80%; /* تصغير عرض الصورة */
    }

    .about .about-text {
        width: 100%;
    }

    .about .about-text h2 {
        font-size: 2rem; /* تصغير حجم العنوان */
    }

    .about .about-text p {
        font-size: 1rem; /* تصغير النص */
        line-height: 1.6;
    }
}

/* تحسين تصميم Home */
@media screen and (max-width: 768px) {
    .home {
        display: flex;
        flex-direction: column;
        justify-content: center; /* لجعل المحتوى في المنتصف عموديًا */
        align-items: center; /* لجعل المحتوى في المنتصف أفقيًا */
        height: calc(100vh - 100px); /* تقليل ارتفاع القسم */
        padding: 2rem var(--padding); /* تقليل المسافات الداخلية */
        text-align: center; /* توسيط النص */
    }

    .home h1 {
        font-size: 2.5rem; /* تصغير حجم العنوان */
        margin-bottom: 1rem;
    }

    .home p {
        font-size: 1.2rem; /* تصغير النص */
        line-height: 1.6;
        color: var(--Secondarytext);
    }

    .home .container-images {
        width: 70%; /* تصغير الصور لتناسب الهاتف */
        height: auto;
        margin-top: 1.5rem;
    }
}

/* Tablet styles */
@media screen and (max-width: 1024px) {
    .home {
        padding: 3rem;
    }

    .container-texts {
        width: 100%;
    }

    .about .container-images {
        display: none; /* إخفاء الصور على الأجهزة اللوحية */
    }

    .about .about-text {
        width: 100%;
    }

    .services .box {
        flex-direction: column;
        gap: 1rem;
    }

    .skills-list {
        grid-template-columns: repeat(3, 1fr); /* عرض المهارات في 3 أعمدة */
    }

    .book-list,
    .soon-books .book-list {
        flex-direction: column;
    }

    .book,
    .soon-books .book {
        width: 100%;
    }

    .contact-form {
        width: 80%;
    }
}

/* Tablet styles */
@media screen and (max-width: 1024px) {
    /* Home Section: Center content and remove the first three images */
    .home {
        display: flex;
        flex-direction: column;
        justify-content: center; /* Center content vertically */
        align-items: center; /* Center content horizontally */
        text-align: center; /* Center text */
        height: 95vh; /* Full screen height */
        padding: 2rem var(--padding);
    }

    .home .container-images {
        display: none; /* Hide the first three images */
    }

    .container-texts {
        width: 100%; /* Full width for text */
    }

    /* My Services Section: Align boxes in one row and make them consistent */
    .services .box {
        display: flex;
        flex-direction: row; /* Align boxes in a single row */
        justify-content: space-between; /* Add space between boxes */
        gap: 1rem; /* Add spacing between boxes */
    }

    .services .card {
        width: 200%; /* Equal width for all boxes */
        padding: 1rem;
        border-radius: 10px;
        background-color: var(--Secondarybackground);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        text-align: center;
        transition: all 0.3s ease;
        height: auto; /* Allow dynamic height based on content */
        overflow: hidden; /* Prevent content from overflowing */
        word-wrap: break-word; /* Break long words to fit inside the box */
    }

    .services .card img {
        width: 50px; /* Consistent image size */
        height: 50px;
        margin-bottom: 1rem;
    }

    .services .card h5 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .services .card p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* My Skills Section: Remove the rightmost image */
    .skills-list {
        grid-template-columns: repeat(3, 1fr); /* Display skills in 3 columns */
        gap: 1.5rem;
    }

    .cv-image {
        display: none; /* Hide the rightmost image */
    }

.container-apper img {
        margin-top: 100px; /* Add margin to the image */
        width: 70%; /* Full width for the image */
        height: auto; /* Maintain aspect ratio */
}

}

/* 
Large screen styles */
@media screen and (min-width: 1200px) {
    .container-apper img {
        display: none;
    }
}

/* تحسين الـ header على الموبايل */
@media screen and (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--Mainbackground);
        padding: 1rem var(--padding);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    nav ul li {
        margin: 0;
    }

    nav ul li a {
        font-size: 1rem;
    }

    .content {
        margin-top: 70px; /* إضافة مسافة لتجنب التداخل مع الـ header */
    }
}

.mobile-nav a {
    text-decoration: none; /* إزالة الخط السفلي */
    color: inherit; /* استخدام نفس لون النص */
}

@media screen and (max-width: 768px) {
    /* تصميم القائمة */
    .mobile-nav {
        display: none; /* إخفاء القائمة افتراضيًا */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: var(--Mainbackground);
        z-index: 1000;
        padding: 1rem var(--padding);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        text-align: center;
    }

    .mobile-nav h2 {
        font-size: 1.5rem;
        color: var (--Maintext);
    }

    .mobile-menu {
        display: flex;
        justify-content: center;
        gap: 1rem;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu li a {
        font-size: 1rem;
        color: var(--Maintext);
        text-decoration: none;
        padding: 0.5rem 1rem;
        border-radius: 5px;
        background-color: var(--Secondarybackground);
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .mobile-menu li a:hover {
        background-color: var(--Accentcolor);
        color: var(--Mainbackground);
    }

    /* إظهار القائمة على الهاتف المحمول فقط */
    @media screen and (max-width: 768px) {
        .mobile-nav {
            display: block; /* إظهار القائمة */
        }
    }

    /* إخفاء القائمة على الشاشات الكبيرة */
    @media screen and (min-width: 768px) {
        .mobile-nav {
            display: none; /* إخفاء القائمة */
        }
    }

    @media screen and (max-width: 768px) {
        .skills-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr); /* عرض المهارات في عمودين متساويين */
            gap: 1rem; /* مسافة بين العناصر */
            padding: 1rem; /* إضافة مسافة داخلية */
            width: 100%; /* جعل العرض متناسق مع الصفحة */
            box-sizing: border-box; /* لضمان أن الحواف لا تؤثر على العرض */
        }

        .skill {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            border-radius: 20px; /* حواف دائرية */
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* إضافة ظل خفيف */
            height: 150px; /* ارتفاع موحد لكل المربعات */
            text-align: center;
            transition: transform 0.3s ease-in-out;
        }

        .skill:hover {
            transform: scale(1.05); /* تكبير المربع عند التمرير */
        }

        .skill img {
            width: 50px; /* حجم موحد للصور */
            height: 50px;
            margin-bottom: 0.5rem; /* مسافة بين الصورة والنص */
        }

        .skill h4 {
            font-size: 1rem; /* حجم موحد للنص */
            color: var(--Maintext); /* لون النص */
        }
    }
}

@media screen and (max-width: 768px) {
    /* My Services Section: Make each card full width */
    .services .box {
        display: flex;
        flex-direction: column; /* Arrange cards in a single column */
        gap: 1.5rem; /* Add spacing between cards */
    }

    .services .card {
        width: 100%; /* Make each card take full width */
        padding: 1.5rem; /* Add padding inside the card */
        border-radius: 10px; /* Rounded corners */
        background-color: var(--Secondarybackground); /* Keep the background color */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add shadow for better appearance */
        text-align: center; /* Center-align the content */
        transition: all 0.3s ease; /* Smooth transition for hover effects */
        height: auto; /* Allow dynamic height based on content */
    }

    .services .card img {
        width: 60px; /* Adjust image size */
        height: 60px;
        margin-bottom: 1rem; /* Add spacing below the image */
    }

    .services .card h5 {
        font-size: 1.5rem; /* Adjust heading size */
        margin-bottom: 1rem; /* Add spacing below the heading */
    }

    .services .card p {
        font-size: 1rem; /* Adjust paragraph size */
        line-height: 1.6; /* Improve readability */
    }
}

