body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: rgb(241, 229, 231);
}

header {
  text-align: center;
  margin-bottom: 30px;
  width: 100%;
}

#about {
  text-align: center;
}

#skills {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

#projects-section {
  margin-top: 0;
  h3 {
    width: 100%;
    text-align: center;
  }
  width: 100%;
  text-align: center;
}

#projects {
  width: 100%;
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-bottom: 20px;
}

.project {
  box-sizing: border-box;
  margin: 0 10px;
  height: 30rem;
  width: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 16px;
}
.project .project-tech-images-div {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.project p {
  margin-bottom: 8px;
}
.project-detail-section {
  margin-bottom: 20px;
}

.project-detail-section h3 {
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.project .long-description {
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.5em;
}

img {
  width: 3rem;
  height: 3rem;
}

.main-tech-images {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.about-modal-content,
.project-modal-content {
  position: relative;
}

.project-modal-content,
.about-modal-content {
  background: white;
  margin: 5% auto; /* Minska från 10% till 5% */
  padding: 20px;
  width: 80%;
  max-width: 800px;
  max-height: 70vh; /* Lägg till maxhöjd */
  border-radius: 8px;
  overflow-y: auto; /* Gör den scrollbar vertikalt */

  height: auto;
  /* Lägg till dessa för att säkerställa scrolling fungerar */
  display: flex;
  flex-direction: column;
}
.close-modal-btn {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2rem;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  z-index: 10;
  padding: 0 8px;
  line-height: 1;
  transition: color 0.2s;
}
.close-modal-btn:hover {
  color: #d00;
}
#contact-desktop {
  display: none;
}

/* Särskild hantering för laptop-storlek */
@media screen and (min-width: 701px) and (max-width: 1200px) {
  .project-modal-content,
  .about-modal-content {
    max-height: 80vh; /* Ännu mindre för laptop */
    margin: 3% auto; /* Mindre margin för mer plats */
    padding-bottom: 100px;
  }
}

@media screen and (max-width: 700px) {
  #first-view {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-bottom: 70px;
  }

  #about-section {
    padding-bottom: 150px;
  }
  body {
    padding-bottom: 60px;
  }

  #projects {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .project {
    width: 90vw;
    max-width: 350px;
    height: auto;
    margin: 0 auto;
  }
  .main-tech-images img {
    width: 2.2rem;
    height: 2.2rem;
  }

  .project-modal-content,
  .about-modal-content {
    width: 90vw;
    max-width: 90vw;
    margin: 5% auto;
    padding: 12px 12px 80px 12px;
    max-height: 90vh;
    overflow-y: auto; /* Gör den scrollbar */
  }
  #contact-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.07);
    padding: 12px 0 30px 0;
    z-index: 100;
    text-align: center;
  }
  #contact-desktop {
    display: none;
  }
  .show-projects-btn {
    display: block;
    margin: 18px auto 24px auto;
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 8px;
    border: none;
    background: #d7b2c4;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  }
  .show-projects-btn:active {
    background: #c08fa7;
  }
}

@media screen and (min-width: 701px) {
  .show-projects-btn {
    display: none;
  }
  #first-view {
    display: block;
  }
  #contact-mobile {
    display: none;
  }
  #contact-desktop {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
  }
}
