@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  background-color: white;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}

body {
  width: 100vw;
  height: 100vh;
  background-color: #fcf5e5;
  font-size: 16px;
}

main {
  padding: 10px 80px;
}

.first-section {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-block: 20px;
  width: 100%;
  height: auto;
}

.profile-section {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 635px;
  gap: 20px;
}
/* 
.left-section {
  display: flex;
  gap: 1rem;
} */

.profile-img {
  width: 192px;
  height: 192px;
  border-radius: 10px;
}

.profile-text {
  display: flex;
  flex-direction: column;
  width: 420px;
  height: 100%;
  gap: 12px;
}

.post {
  width: 157px;
  height: 52px;
  border-radius: 8px;
  background-color: #212121;
  color: white;
  padding: 18px 32px;
  align-self: flex-end;
  transition: all 0.2s ease;
}

.post:hover {
  background-color: #212121;
  opacity: 80%;
  cursor: pointer;
}

.heading-text {
  font-family: "poppins";
  font-weight: 500;
  font-size: 2em;
  color: #212121;
  height: 96px;
  line-height: 100%;
}

.profile-parag {
  font-family: "poppins";
  color: #212121b2;
  width: 420px;
  height: 48px;
  line-height: 100%;
  flex-grow: 1;
}

.edit-icon {
  color: #212121;
  opacity: 70%;
  font-family: "poppins";
  border: none;
  text-align: left;
  background-color: #fcf5e5;
  transition: all 0.2s ease;
}

.edit-icon:hover {
  color: #212121;
  opacity: 100%;
  cursor: pointer;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
  width: 100%;
  padding-block: 20px;
  font-family: "poppins";
}

.gallery-item {
  width: 100%;
  height: 445px;
  border-radius: 8px;
}

.gallery-image {
  width: 100%;
  height: 413px;
  border-radius: 8px;
  object-fit: cover;
}

.gallery-caption {
  padding: 10px 0px;
  font-size: 1.2em;
  font-weight: 500;
  line-height: 120%;
  color: #212121;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "poppins";
}

.heart-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  stroke: #999;
  stroke-width: 2;
  fill: none;
  transition: all 0.2s ease;
}

.heart-icon:hover {
  stroke: black;
}

.heart-icon.active {
  fill: red;
  stroke: red;
}

.heart-icon.active:hover {
  fill: red;
  stroke: red; 
}

footer {
  padding: 30px;
  font-size: 1rem;
  color: #212121;
  text-align: center;
}

/* edit profile 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.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fcf5e5;
  border: 1px solid #0000;
  padding: 2rem;
  width: 90%;
  max-width: 350px;
  border-radius: 12px;
  position: relative;
}

.modal-content > h2 {
  text-align: center;
  margin-bottom: 10px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-form > div > label {
  display: block;
  margin: 3px 0;
}

.modal-form > div > input {
  width: 100%;
  margin-bottom: 8px;
  border-radius: 5px;
}

#username {
  border: 1px solid #000;
  padding: 3px;
  background-color: #fff;
}

.modal-form > div > textarea {
  width: 100%;
  margin-bottom: 8px;
  max-width: 100%;
  padding: 3px;
  border-radius: 5px;
}

.modal-form > button {
  margin-top: 20px;
  background: #000;
  color: #fff;
  padding: 8px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 8px;
}

.modal-form > button:hover {
  opacity: 0.9;
}

.close-btn {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 1.5rem;
  cursor: pointer;
}

.close {
  color: #aaa;
  float: right;
  font-size: 30px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

#preview-image {
  width: 100%;
  height: auto;
  max-height: 400px;
}

#preview-title {
  font-family: "poppins";
  font-size: 18px;
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 390px) {
  footer {
    max-width: 95%;
  }
}

@media screen and (min-width: 391px) and (max-width: 767px) {
  body {
    font-size: 15px;
    position: absolute;
    overflow-x: hidden;
  }

  main {
    padding: 10px 20px 0 20px;
    margin: 0 auto;
  }

  .first-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* display: block;
    text-align: center;
    position: relative; */
  }

  .profile-section {
    width: 100%;
  }

  .left-section {
    width: 100%;

    .profile-img {
      display: block;
      margin: auto;
      padding: 0;
    }
  }

  .profile-text {
    width: 100%;
    margin: auto;
    position: relative;
    top: 20px;
    .profile-parag {
      width: 100%;
      font-size: 16px;
      padding: 0 5px;
      margin-bottom: 12px;
    }
    .edit-icon {
      margin: 5px auto;
      font-size: 16px;
    }
  }

  .post {
    position: relative;
    top: 50px;
    width: 100%;
    margin: auto;
  }

  .post-hr {
    position: relative;
    top: 60px;
  }

  .gallery {
    gap: 25px;
    position: relative;
    top: 70px;
  }

  footer {
    position: relative;
    top: 120px;
  }

  .line {
    position: relative;
    top: 70px;
  }
}

@media screen and (max-width: 390px) {
  body {
    font-size: 12px;
    position: absolute;
    overflow-x: hidden;
  }

  main {
    padding: 10px 20px 0 20px;
    margin: 0 auto;
  }

  .first-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* display: block;
    text-align: center;
    position: relative; */
  }

  .profile-section {
    width: 100%;
  }

  .left-section {
    width: 100%;

    .profile-img {
      display: block;
      margin: auto;
      padding: 0;
    }
  }

  .profile-text {
    width: 100%;
    margin: auto;
    position: relative;
    top: 20px;
    .profile-parag {
      width: 100%;
      font-size: 16px;
      padding: 0 5px;
      margin-bottom: 10px;
    }
    .edit-icon {
      margin: 5px auto;
      font-size: 16px;
    }
  }

  .post {
    position: relative;
    top: 50px;
    width: 100%;
    margin: auto;
  }

  .post-hr {
    position: relative;
    top: 60px;
  }

  .gallery {
    gap: 25px;
    position: relative;
    top: 70px;
  }

  footer {
    position: relative;
    top: 120px;
  }

  .line {
    position: relative;
    top: 70px;
  }
}
