* {
  padding: 0px;
  margin: 0px;
  box-sizing: border-box; /*by search*/
}

html {
  /*by search*/
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: #667eea;
  color: white;
}

/*Navbar Section */
#navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px 0;
  position: sticky;
  top: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

#navbar ul {
  text-align: center;
  list-style: none;
  /* padding: 0 20px; */
}

#navbar ul > li {
  display: inline-block;
  margin: 0 10px;
}

#navbar ul li a {
  text-decoration: none;
  color: white;
  font-size: 18px;
  padding: 10px;
  border-radius: 7px;
}

#navbar ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Home Section  */
#home {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 40px;
  min-height: 100vh;
  overflow: hidden;
}

.home-content {
  float: left;
  width: 45%;
  padding-top: 120px;
  padding-left: 50px;
}

#home h1 {
  font-size: 3.5em;
  margin-bottom: 20px;
  line-height: 1.2;
  /* font-weight: bold; */
}

#home h1 .name {
  display: inline-block;
  padding-left: 40px;
  text-align: center;
  margin-top: 10px;
}

#home p {
  font-size: 1.45em;
  padding-left: 80px;
  margin-bottom: 30px;
  opacity: 0.95;
}

.contact-btn {
  float: left;
  color: white;
  padding: 12px 30px;
  margin-left: 140px;
  border: 2px solid white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 1.15em;
  transition: all 0.3s; /*by search */
}

.contact-btn:hover {
  background: white;
  color: #667eea;
  transform: translateY(-2px); /*by search */
}

#home img {
  float: right;
  width: 45%;
  max-width: 480px;
  margin-top: 80px;
  margin-right: 5%;
  border-radius: 15px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s; /*by search */
}

#home img:hover {
  transform: scale(1.02); /*by search */
}

/* كل section يكون background مختلف */
section:nth-child(even) {
  /*by search*/
  background: #f8f9fa;
}

section:nth-child(odd) {
  /*by search*/
  background: white;
}

section h2 {
  text-align: center;
  font-size: 2.5em;
  margin: 25px;
  color: #667eea;
  /* position: relative; */
}

section h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 5px;
  background: #667eea;
  margin: 10px auto;
  border-radius: 3px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/*About Section */

.about-content {
  max-width: 800px;
  margin: 30px auto;
  padding: 30px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 2px 7.5px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s; /*by search */
}
.about-content:hover {
  transform: translateY(-5px); /*by search */
  position: relative;
}

.about-content p {
  font-size: 1.1em;
  text-align: justify;
  line-height: 1.7;
  color: #555;
}

.about-content p::first-line {
  word-spacing: -2px;
}

/*Skills Section */
.skills-main {
  max-width: 1000px;
  margin: 0 auto;
}

.skills-main > div {
  display: inline-block;
  width: 30%;
  margin: 15px;
  vertical-align: top;
}

.skill-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 34px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 2px 10px 15px rgba(102, 126, 234, 0.3);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}
.skill-card h3 {
  font-size: 1.65em;
  margin-bottom: 6px;
}

.skill-card p {
  font-size: 1.1em;
}

/*Project Section */
.projects-main {
  max-width: 475px;
  max-height: 500px;
  margin: 0 auto;
}

/* .projects-main > div {
  display: inline-block;
  width: 30%;
  margin: 0 15%;
  vertical-align: top;
} */

.project-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.project-image {
  /* width: 100%; */
  height: 250px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3em;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-info {
  padding: 25px;
}

.projects-main a {
  text-decoration: none;
}

.project-info h3 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.8em;
  text-align: center;
}

.project-info p {
  /* color: #5e5c5c; */
  color: #555;
  line-height: 1.6;
  text-align: center;
  font-size: 1.2em;
}

/*Contact Section */
.contact-main {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.contact-link {
  display: inline-block;
  width: 40%;
  max-width: 350px;
  margin: 20px;
  text-decoration: none;
  color: #667eea;
}

.contact-item {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s;
}

.contact-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-5px);
}

.contact-item .icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.contact-item h3 {
  margin-bottom: 10px;
  font-size: 1.35em;
}

/* Footer Section  */
footer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 20px 30px;
  font-size: 1.2em;
}

@media screen and (max-width: 992px) {
  .skills-main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  #navbar ul li {
    margin: 0 5px;
  }

  #navbar ul li a {
    font-size: 16px;
    padding: 8px;
  }

  #home {
    padding: 40px 20px;
    min-height: auto;
  }

  .home-content {
    width: 100%;
    padding: 40px 20px;
    float: none;
  }

  #home h1 {
    font-size: 2.5em;
    text-align: center;
  }

  #home h1 .name {
    padding-left: 0;
    display: block;
  }

  #home p {
    font-size: 1.2em;
    padding-left: 0;
    text-align: center;
  }

  .contact-btn {
    margin: 20px auto;
    display: block;
    width: fit-content;
    float: none;
  }

  #home img {
    width: 90%;
    max-width: 350px;
    margin: 30px auto;
    display: block;
    float: none;
  }

  section h2 {
    font-size: 2em;
  }

  .about-content {
    padding: 20px;
    margin: 20px auto;
  }

  .about-content p {
    font-size: 1em;
    text-align: left;
  }

  #skills {
    padding: 40px 0;
  }

  .skills-main {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 15px;
    gap: 15px;
  }

  .skill-card {
    padding: 25px 20px;
  }

  .skill-card h3 {
    font-size: 1.3em;
  }

  .skill-card p {
    font-size: 0.95em;
  }

  .projects-main {
    max-width: 100%;
    padding: 0 20px;
  }

  .project-card {
    margin: 20px 0;
  }

  .project-image {
    height: 200px;
    font-size: 2.5em;
  }

  .project-info {
    padding: 20px;
  }

  .project-info h3 {
    font-size: 1.5em;
  }

  .project-info p {
    font-size: 1em;
  }

  .contact-link {
    width: 100%;
    max-width: 100%;
    margin: 15px 0;
  }

  .contact-item {
    padding: 25px;
  }

  .contact-item .icon {
    font-size: 2.5em;
  }

  .contact-item h3 {
    font-size: 1.2em;
  }

  footer {
    font-size: 1em;
    padding: 15px 20px;
  }
}

@media screen and (max-width: 480px) {
  #navbar ul li {
    margin: 0 3px;
  }

  #navbar ul li a {
    font-size: 14px;
    padding: 6px;
  }

  #home h1 {
    font-size: 2em;
  }

  #home p {
    font-size: 1em;
  }

  section h2 {
    font-size: 1.8em;
    margin: 20px;
  }

  .skills-main {
    padding: 0 10px;
  }

  .skill-card {
    padding: 20px 15px;
  }

  .skill-card h3 {
    font-size: 1.2em;
  }

  .skill-card p {
    font-size: 0.9em;
  }

  .contact-item {
    padding: 20px;
  }
}
