* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  font-family: "Montserrat";
  font-optical-sizing: auto;
  font-style: normal;
}

body {
  background-color: #000;
  color: snow;
  line-height: 1.6;
  overflow-x: hidden;
}

video {
  position: absolute;
}

#logo {
  position: relative;
  left: 50px;
  cursor: pointer;
}

header {
  background: #000;
  color: snow;
  padding: 20px;
  text-align: center;
  box-shadow: 2px 2px rgba(114, 175, 240, 0.477);
  position: fixed;
  width: 100%;
  height: 100px;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-evenly;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
}

nav ul li {
  margin: 0 20px;
}

nav ul li a {
  color: snow;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #6699cc;
}

nav ul li a.active {
  color: #6699cc;
}

section {
  max-width: 1000px;
  margin: 80px auto;
  padding: 20px;
  background: #111;
  border-radius: 10px;
  box-shadow: 0 24px 24px #00aaff8e;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

h2,
h1 {
  color: #6699cc;
  margin-bottom: 10px;
}

#footer {
  width: 100vw;
  height: 100vh;
  color: snow;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: left;
  padding: 20px;
  gap: 80px;
  font-size: 18px;
  position: relative;
}

#footer .mail-div,
#footer .social-div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-right: 10px;
}

.social-div {
  text-align: center;
  margin-top: 5px;
}

.social-div div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  justify-content: center;
  max-width: 300px;
  margin-left: 10%;
}

.social-div div:nth-child(2) {
  grid-template-columns: repeat(2, 1fr);
}

.social-div a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  font-size: 18px;
  margin-right: 20px;
}

.social-div img {
  width: 30px;
  height: 30px;
}

.social-links {
  margin-left: 10px;
  display: flex;
  justify-content: flex-start;
}

#footer img:not(#bg-img3) {
  width: 24px;
  height: 24px;
  background-color: snow;
  border-radius: 50%;
  padding: 5px;
  margin-right: 10px;
  vertical-align: middle;
}

#footer div p {
  font-weight: bold;
  font-size: 20px;
}

#footer a {
  text-decoration: none;
  color: snow;
}

#footer .info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copyright {
  position: absolute;
  bottom: 0;
  margin: 1%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  align-items: center;
  justify-content: center;
}

#footer hr {
  width: 1px;
  align-items: center;
  margin-top: 3%;
  height: 20%;
  border-color: snow;
}

#back-to-top {
  width: 50px;
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0.5%;
  border: 0px;
  cursor: pointer;
  padding: 10px;
  background: none;
  color: snow;
  display: flex;
  align-items: center;
  justify-content: center;
}

form {
  background: #222;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 12px;
  background: #333;
  color: snow;
  font-size: 16px;
  outline: none;
  transition: 0.3s;
}

input:focus,
textarea:focus {
  border-color: #00aaff;
}

#special-btn {
  background: #6699cc;
  color: snow;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

button:hover {
  background: #00aaff;
}

#home {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 3.5rem;
  font-weight: bold;
  transition: opacity 0.5s ease-in-out;
  background-color: #11111135;
}

#bg-img {
  position: absolute;
  width: 110%;
  height: 100%;
  object-fit: contain;
  z-index: -1;
}

#bg-img1 {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  bottom: 0;
  right: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

#bg-img2 {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: fill;
  bottom: 0;
  right: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

#bg-img3 {
  position: absolute;
  width: 90%;
  height: 90%;
  display: block;
  object-fit: contain;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

#bg-img4 {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

#profile-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-size: 2rem;
  font-weight: bold;
  transition: opacity 0.5s ease-in-out;
  background-color: #11111135;
  flex-direction: row;
  display: none;
  padding: 0 20px;
}

.image-wrapper {
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background-color: #d0d8ff;
  padding: 232px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 100px;
  margin-right: 40px;
}

#profile-image {
  width: 480px;
  height: 540px;
  object-fit: cover;
  bottom: 4px;
  right: 3px;
  border-radius: 50%;
  position: relative;
  transform: translateY(-30px);
}

#bio-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 599px;
  color: #fff;
  margin: 0px 100px;
}

#name {
  font-size: 2rem;
  font-weight: bold;
}

#title {
  font-size: 1.5rem;
  color: #ffffff;
}

#bio {
  font-size: 1rem;
  color: snow;
  line-height: 1.6;
  font-family: "Work Sans";
  font-weight: 600;
  text-align: justify;
}

#sec-home {
  display: none;
}

#home p {
  position: relative;
  color: #6699cc;
  font-size: 120%;
  font: bold;
  text-transform: uppercase;
}

#home hr {
  position: relative;
  height: 10%;
  margin: 60px;
  border-color: #6699cc;
  border-width: 1px;
}

#cv-port {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-top: 50px;
}

.box {
  width: 400px;
  height: 250px;
  background-color: #00000054;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-align: center;
  transition: 0.3s;
}

.box:hover {
  background-color: #6699cc42;
  transform: scale(1.1);
}

.box a {
  text-decoration: none;
  color: snow;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10%;
}

.img-cv {
  margin-top: 20%;
  transform: scale(0.9);
  border-radius: 50%;
  padding: 20px;
  filter: invert(1);
}

.img-port {
  margin-top: 20%;
  transform: scale(0.9);
  border-radius: 50%;
  padding: 20px;
  filter: invert(1);
}

.line {
  width: 100px;
  border: 2px solid snow;
  margin-left: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.projects-wrapper {
  width: 1300px;
  overflow: hidden;
}



#development {
  width: 100vw;
  height: 115vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 5px;
  width: 200%;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease-in-out;
}

.line2 {
  width: 50%;
  border: 2px solid snow;
  bottom: 160px;
  left: 25%;
  position: absolute;
  align-items: center;
  justify-content: center;
}
.line3 {
  width: 50%;
  border: 2px solid snow;
  bottom: 80px;
  left: 25%;
  position: absolute;
  align-items: center;
  justify-content: center;
}

.line4 {
  width: 70%;
  border: 1px solid #6699cc;
  top: 60px;
  left: 7%;
  position: absolute;
  align-items: center;
  justify-content: center;
}

#prevBtn,
#nextBtn {
  background: none;
  border: 0;
}

#prevBtn img:hover,
#nextBtn img:hover,
#prev-Btn:hover,
#next-Btn:hover {
  filter: invert(20%);
}

#prevBtn img,
#nextBtn img {
  cursor: pointer;
  transition: color 0.5s;
}

.project-card {
  position: relative;
  flex: 0 0 calc(100% / 8);
  background: #0000000c;
  padding: 100px;
  /* height: 30px; */
  height: 290px;
  text-align: center;
  margin: 5px;
  border-radius: 10px;
  border: 2px solid snow;
}

.project-card .img-add {
  position: absolute;
  top: 60px;
  transform: translateX(-50%);
  height: auto;
}

.project-card .img-add2 {
  position: absolute;
  top: 40px;
  transform: translateX(-50%);
  height: auto;
}

.project-card .img-add3 {
  position: absolute;
  top: 50px;
  transform: translateX(-50%);
  height: auto;
}

.project-card .img-add4 {
  position: absolute;
  top: 40px;
  width: 70px;
  transform: translateX(-50%);
  height: auto;
}

.project-card .img-click {
  position: absolute;
  margin-top: 20px;
  transform: translateX(-50%);
  height: auto;
}

.project-card span {
  position: absolute;
  bottom: 110px;
  width: 100%;
  transform: translateX(-50%);
  font-weight: bold;
}

.project-card div {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 50px;
  justify-content: center;
}

.project-card div a img {
  width: 35px;
  height: 35px;
  background-color: snow;
  padding: 5px;
  border-radius: 50%;
}

.icon {
  position: absolute;
  top: 20px;
  right: 20px;
}

.project-card2 .icon a img {
  width: 35px;
  height: 35px;
  background-color: snow;
  padding: 5px;
  border-radius: 50%;
}

.project-card:hover {
  background-color: #6699cc42;
  border: 2px solid #6699cc;
}

.project-card1 {
  position: relative;
  flex: 0 0 calc(100% / 8);
  background: #0000000c;
  padding: 100px;
  /* height: 30px; */
  height: 290px;
  text-align: center;
  margin: 5px;
  border-radius: 10px;
  border: 2px solid goldenrod;
}

.project-card1 img {
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  height: auto;
}

.project-card1 span {
  position: absolute;
  bottom: 110px;
  transform: translateX(-50%);
  font-weight: bold;
}

.project-card1 div {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 50px;
  justify-content: center;
}

.project-card1 div a img {
  width: 35px;
  height: 35px;
  background-color: snow;
  padding: 5px;
  border-radius: 50%;
}

.project-card1:hover {
  background-color: #6699cc42;
  border: 2px solid #6699cc;
}

.project-card2:hover {
  background-color: #6699cc42;
  border: 2px solid #6699cc;
  transform: scale(1.03);
  transition: 0.4s;
}

.project-card1:hover .per {
  color: #6699cc;
  border-color: #6699cc;
}

.project-card1:hover a img {
  background-color: #6699cc;
}

.per {
  position: absolute;
  top: 0;
  padding: 1%;
  right: -10%;
  font-size: 12px;
  color: goldenrod;
}

#projects {
  width: 100vw;
  height: 110vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: bold;
  background-color: #11111135;
}

#projectsCarousel {
  width: 100vw;
  height: 110vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: bold;
  background-color: #11111135;
}




.project-card2 {
  position: relative;
  flex: 0 0 calc(100% / 3);
  background: #0000000c;
  padding: 30px;
  height: 270px;
  display: flex;
  flex-direction: column;
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  border-radius: 24px;
  border: 2px solid snow;
}

.project-card2 .description {
  font-size: 1rem;
  font-family: "Work Sans";
  display: flex;
  max-width: 600px;
  overflow: hidden;
  color: snow;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}

.title {
  color: #6699cc;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  font-weight: bold;
  width: 100%;
  margin-bottom: 30px;
}

.projects-grid1 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 20px;
  width: 1300px;
  align-items: center;
  text-align: center;
  justify-content: space-between;
}

.project-card2 {
  display: none;
  opacity: 1;

}

.project-card2.active {
  display: block; 

}

#prev-Btn, #next-Btn {
  margin: 30px;
  cursor: pointer;
  background: none;
  border: none;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: rgb(0, 0, 0);
}

::-webkit-scrollbar-thumb {
  background: snow;
  border-radius: 10px;
  transition: background 0.5s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 250, 250, 0.797);
}

/* كود الموبايل فقط - يضاف في نهاية ملف الـ CSS الأصلي */
@media only screen and (max-width: 768px) {
  /* إعادة ضبط أساسي */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* إصلاح الهيدر */
  header {
    height: auto;
    padding: 15px 10px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  #logo {
    position: static;
    left: auto;
    margin: 0;
    height: 50px;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
  }

  nav ul li {
    margin: 0 5px;
  }

  /* إصلاح الأقسام الرئيسية */
  section {
    width: 95%;
    margin: 80px auto;
    padding: 20px;
    box-sizing: border-box;
  }

  /* إصلاح الصفحة الرئيسية */
  #home {
    padding: 30px 20px;
    font-size: 2rem;
    text-align: center;
  }

  #home hr {
    height: 4vh;
    margin: 30px auto;
    width: 80%;
  }

  /* إصلاح الملف الشخصي */
  #profile-container {
    flex-direction: column;
    padding: 80px 20px 40px;
    align-items: center;
  }

  .image-wrapper {
    width: 250px;
    height: 250px;
    margin: 0 auto 30px;
    padding: 0;
  }

  #profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
    right: auto;
    bottom: auto;
  }

  #bio-details {
    margin: 0;
    padding: 0 10px;
    text-align: center;
    width: 100%;
  }

  /* إصلاح الخلفيات */
  video,
  #bg-img,
  #bg-img1,
  #bg-img2,
  #bg-img3,
  #bg-img4 {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
  }

  /* إصلاح السيرة الذاتية/المحفظة */
  #cv-port {
    flex-direction: column;
    gap: 20px;
    padding: 80px 20px;
  }

  .box {
    width: 100%;
    max-width: 100%;
    height: 180px;
    margin: 10px 0;
  }

  /* إصلاح المشاريع */
  #projects {
    padding: 80px 20px;
    height: auto;
  }

  .projects-grid1 {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 20px;
  }

  .project-card2 {
    padding: 20px;
    height: auto;
  }

  /* إصلاح الفوتر */
  #footer {
    flex-direction: column;
    gap: 30px;
    padding: 40px 20px 80px;
    height: auto;
    text-align: center;
  }

  #footer .mail-div,
  #footer .social-div {
    align-items: center;
    width: 100%;
  }

  .social-div div {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
  }

  #footer hr {
    display: none;
  }

  /* عناصر إضافية */
  #back-to-top {
    right: 15px;
    bottom: 15px;
  }

  /* التأكد من توسيط كل العناصر */
  h1, h2, h3, p, span, div {
    text-align: center !important;
  }
}

/* إصلاحات مخصصة لقسم Development والخلفيات - تضاف داخل media query الموبايل */
@media only screen and (max-width: 768px) {
  /* إصلاح قسم Development */
  #development {
    height: auto;
    min-height: 100vh;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  .projects-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .projects-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    transform: none !important;
    gap: 20px;
  }

  .project-card,
  .project-card1 {
    width: 100%;
    height: auto;
    min-height: 300px;
    padding: 30px 20px;
    margin: 0;
    position: relative;
  }

  .project-card .img-add,
  .project-card .img-add2,
  .project-card .img-add3,
  .project-card .img-add4 {
    position: relative;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    margin: 20px 0;
    width: 80px;
    height: auto;
  }

  .project-card span {
    position: relative;
    bottom: auto;
    margin: 15px 0;
    width: 100%;
    text-align: center;
  }

  .project-card div {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 20px 0;
    gap: 20px;
    justify-content: center;
  }

  /* إصلاح الخلفيات */
  #bg-img,
  #bg-img1,
  #bg-img2,
  #bg-img3,
  #bg-img4 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
  }

  /* إصلاح الخطوط الفاصلة */
  .line2,
  .line3,
  .line4 {
    position: relative;
    width: 80%;
    left: 10%;
    margin: 30px auto;
    bottom: auto;
  }

  /* إصلاح أزرار التنقل */
  #prevBtn,
  #nextBtn,
  #prev-Btn,
  #next-Btn {
    display: none; /* يمكن إظهارها إذا كنت تريدها */
  }

  /* التأكد من ظهور العناصر */
  .project-card2.active {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }

  .title {
    text-align: center;
    justify-content: center;
  }

  .project-card2 .description {
    text-align: center;
  }
}
@media only screen and (max-width: 768px) {
  /* إصلاح جذري لقسم البايو */
  #profile-container {
    display: flex;
    flex-direction: column;
    padding: 80px 20px 40px;
    min-height: 100vh;
    overflow: visible;
    position: relative;
  }

  .image-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    padding: 0;
  }

  #bio-details {
    width: 100%;
    margin: 0;
    padding: 0;
    position: static;
    transform: none;
  }

  #bio {
    font-size: 1rem;
    line-height: 1.8;
    text-align: justify;
    padding: 15px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    display: block;
    background-color: rgba(0,0,0,0.5); /* خلفية شبه شفافة لتحسين القراءة */
    border-radius: 10px;
  }

  #name {
    font-size: 1.8rem;
    margin: 15px 0 10px;
    text-align: center;
    width: 100%;
  }

  #title {
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-align: center;
    color: #6699cc;
  }

  /* حل بديل إذا استمرت المشكلة */
  @supports (-webkit-overflow-scrolling: touch) {
    #profile-container {
      overflow: scroll;
      -webkit-overflow-scrolling: touch;
    }
    #bio {
      padding-bottom: 50px;
    }
  }
}

@media only screen and (max-width: 768px) {
  /* إصلاح مشكلة العنوان المختفي */
  #name {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 2rem;
    color: #6699cc;
    margin: 0 auto 15px;
    padding: 0 20px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 10;
    text-transform: uppercase;
  }

  /* إصلاحات إضافية للتأكد من الظهور */
  #bio-details {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }

  #bio {
    margin-top: 20px;
  }
}

@media only screen and (max-width: 768px) {
  .line4 {
    display: none !important;
  }
}

@media only screen and (max-width: 768px) {
  #home hr {
    display: none !important;
  }
}

@media only screen and (max-width: 768px) {
  /* إصلاح مشكلة العنوان المختفي تحت النافبار */
  #profile-container {
    padding-top: 100px !important; /* زيادة الـ padding لتعويض النافبار الثابت */
  }

  #name {
    position: relative !important;
    top: 0 !important;
    margin-top: 30px !important;
    padding-top: 20px !important;
    z-index: 1 !important;
    font-size: 2rem !important;
    text-align: center !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
  }}

  @media only screen and (max-width: 768px) {
  /* تثبيت ارتفاع قسم الهوم */
  #home {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
  }

  /* ضبط قسم السيرة الذاتية */
  #cv-port {
    margin-top: 50px;
    position: relative;
    z-index: 2;
  }

  /* منع التداخل مع الخلفيات */
  #home::after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    background: #000;
    z-index: 1;
  }
}

@media (max-width: 768px) {
  /* إخفاء الخطين في الموبايل فقط */
  .project-card .line2,
  .project-card .line3 {
    display: none;
  }

  
  }


@media (max-width: 768px) {
  /* إخفاء جميع الخطوط الأفقية في الموبايل */
  .project-card1 .line2,
  .project-card1 .line3 {
    display: none;
  }

}


@media (max-width: 768px) {
  /* تطبيق مقاسات project-card1 بالضبط مع ضبط التنسيقات */
  .project-card {
    flex: 0 0 calc(50% - 10px);
    height: 250px;
    padding: 20px 10px 60px;
    margin: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
  }

  /* ضبط الصور */
  .project-card .img-add,
  .project-card .img-add2,
  .project-card .img-add3,
  .project-card .img-add4 {
     width: 80px;
    height: auto;
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    
  }



  /* ضبط منطقة الأيقونات */
  .project-card > div {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    top: 30px;
  }

  /* ضبط أيقونة الضغط */
  .project-card .img-click {
    width: 35px;
    height: 35px;
    background-color: snow;
    padding: 5px;
    border-radius: 50%;
  }

}

@media (max-width: 768px) {
  /* تطبيق نفس تنسيقات الـ span من project-card1 بالضبط مع تحسينات الموبايل */
  .project-card span {
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    width: 100%;
    text-align: center;
    font-size: 14px;
    padding: 0 15px;
    box-sizing: border-box;
  }

  /* تعديلات داعمة لضمان التنسيق الصحيح */
  .project-card {
    position: relative; /* ضروري ليعمل الـ absolute بشكل صحيح */
    height: 250px; /* نفس ارتفاع project-card1 في الموبايل */
  }

  /* إصلاح مشكلة التوسيط إذا كانت موجودة */
  .project-card .img-add,
  .project-card .img-add2,
  .project-card .img-add3,
  .project-card .img-add4 {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .social-links {
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط أفقي للعناصر */
    gap: 10px;
    padding: 15px;
  }

  .social-links a {
    display: flex;
    align-items: center;
    width: 100%; /* عرض كامل */
    max-width: 250px; /* تحديد أقصى عرض */
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  /* حل جذري لمشكلة المحاذاة */
  .social-links a img {
    width: 24px !important;
    height: 24px !important;
    margin-right: 12px !important;
    object-fit: contain;
    flex-shrink: 0; /* منع تغير حجم الأيقونة */
  }

  .social-links a span {
    font-size: 14px;
    flex-grow: 1; /* يأخذ المساحة المتبقية */
    text-align: left; /* محاذاة نص ثابتة */
  }
}


/* ========== Responsive Fixes ========== */

@media (max-width: 1024px) {
  .my-info h1 {
    font-size: 48px;
  }
}

@media (max-width: 768px) {
  .about-me .container {
    flex-direction: column;
    text-align: center;
  }

  .my-info h1 {
    font-size: 36px;
  }

  .about-me .image-container {
    margin-bottom: 20px;
  }

  .cards {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .my-info h1 {
    font-size: 28px;
  }

  .card {
    width: 90%;
  }

  .contact form input,
  .contact form textarea {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #home {
    position: relative;
    text-align: center;
    padding: 20px 10px;
  }

  #bg-img2 {
    width: 100%;
    height: auto;
  }

  #logo2 {
    width: 120px;
    height: auto;
    margin-top: 10px;
  }

  #home p {
    font-size: 18px;
    margin-top: 10px;
  }

  #home hr {
    width: 50%;
    margin: 10px auto;
  }
}

@media (max-width: 480px) {
  #home {
    position: relative;
    text-align: center;
    padding: 20px 10px;
    overflow: hidden;
  }

  #bg-img2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
  }

  #logo2 {
    width: 100px;
    height: auto;
    margin-top: 20px;
  }

  #home p {
    margin-top: 10px;
    position: relative;
    z-index: 2;
  }

  #home hr {
    width: 50%;
    margin: 10px auto;
    border-color: white;
    position: relative;
    z-index: 2;
  }
}

@media screen and (max-width: 600px) {
  #bio {
    font-size: 10px;
  }
}

@media screen and (max-width: 600px) {
  p {
    font-size: 16px;
  }

  .social-links a {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .social-div p {
    font-size: 16px;
  }

  .social-links {
    padding: 0;
  }

  .social-links a img {
    width: 16px; /* أصغر حجم للأيقونات */
  }

  /* تصغير المسافات */
  .social-links a {
    display: flex;
    align-items: center;
  }

  .social-links a span {
    font-size: 12px;
  }
  
  /* تقليل المسافة بين الأقسام */
  .social-div, .contact-div {
    padding: 5px;
  }
}

@media(max-width:768px){
  .project-card .img-add,
  .project-card .img-add2,
  .project-card .img-add3,
  .project-card1 .img-per,
  .project-card1 .img-per2,
  .project-card .img-add4{
    width: 40px;
    height: 40px;
  }
}

@media(max-width:768px){
  .project-card1 span,
  .project-card2 span
  {
   white-space: nowrap;
  }
}

@media (max-width:768px){


.project-card1 .img-per,
.project-card1 .img-per2 {
  position: absolute;
  margin-top: 50px;
}
.project-card1 div ,
.project-card2 div{
  margin-bottom: 30px;
}
}

@media(max-width:768px){
  .icon a img {
    width: 25px !important;
    height: 25px !important;
  }
}