/* =========================
   PAGE: PROFILE LAYOUT
========================= */

.app-layout {
  width: 100%;
  max-width: 1600px;

  margin: 0 auto;

  padding-top: 120px;
  padding-left: 40px;
  padding-right: 40px;

  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 30px;
}

.feed-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* =========================
   PROFILE BACK BUTTON
========================= */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 18px;

  color: #676F54;

  font-weight: 600;
  text-decoration: none;

  transition: 0.3s ease;
}

.back-btn:hover {
  color: #79B4A9;
  transform: translateX(-3px);
}

/* =========================
   PROFILE BANNER
========================= */

.profile-banner {
  width: 100%;
  height: 260px;

  position: relative;

  background: linear-gradient(
    135deg,
    #D7F2BA,
    #A8C89B,
    #93B78F,
    #79B4A9,
    #676F54
  );

  border-radius: 24px 24px 0 0;
}

.edit-banner-btn {
  position: absolute;
  right: 22px;
  bottom: 22px;

  width: 44px;
  height: 44px;

  border: none;
  border-radius: 50%;

  background: #ffffff;
  color: #676F54;

  font-size: 18px;

  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);

  transition: 0.3s ease;
}

.edit-banner-btn:hover {
  background: #D7F2BA;
  transform: translateY(-2px);
}

/* =========================
   PROFILE INFO CARD
========================= */

.profile-info-card {
  position: relative;

  padding: 100px 35px 35px;

  display: block;

  background: #ffffff;

  border: 1px solid #ececec;
  border-top: none;
  border-radius: 0 0 24px 24px;
}

.profile-avatar {
  position: absolute;
  top: -75px;
  left: 35px;

  width: 150px;
  height: 150px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 6px solid #ffffff;
  border-radius: 50%;
  outline: 2px solid #d4af37;

  background: #79B4A9;
  color: #ffffff;

  font-family: "Inter", sans-serif;
  font-size: 52px;
  font-weight: 700;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.edit-avatar-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;

  width: 38px;
  height: 38px;

  border: 3px solid #ffffff;
  border-radius: 50%;

  background: #79B4A9;
  color: #ffffff;

  font-size: 15px;

  cursor: pointer;
  z-index: 2;

  transition: 0.3s ease;
}

.edit-avatar-btn:hover {
  background: #676F54;
  transform: scale(1.05);
}

/* =========================
   PROFILE CONTENT
========================= */

.profile-content-row {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 36px;
  align-items: flex-start;
}

.profile-info {
  width: 100%;
}

.profile-info h2 {
  margin-top: 15px;
  margin-bottom: 8px;

  color: #2b2b2b;

  font-family: "Belleza", sans-serif;
  font-size: 42px;
  font-weight: 400;
}

.profile-username {
  display: block;

  margin-bottom: 6px;

  color: #2b2b2b;

  font-size: 17px;
}

.profile-bio {
  max-width: 760px;

  margin-bottom: 26px;

  color: #555555;

  font-size: 19px;
  font-style: italic;
  line-height: 1.7;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 15px;
  margin-bottom: 22px;
}

.profile-tag {
  padding: 8px 14px;

  border-radius: 999px;

  background: #eef7eb;
  color: #676F54;

  font-size: 14px;
  font-style: italic;
  font-weight: 600;
}

/* =========================
   PROFILE SUMMARY
========================= */

.profile-summary-card {
  width: 100%;

  margin-top: 20px;
  padding: 22px;

  background: #f8f8f5;

  border: 1px solid #ececec;
  border-radius: 20px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;

  margin-bottom: 18px;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-item strong {
  color: #676F54;

  font-size: 14px;
}

.summary-item span {
  color: #2b2b2b;

  font-size: 15px;
  line-height: 1.4;
}

/* =========================
   PROFILE STATS
========================= */

.profile-stats {
  width: 100%;

  margin-top: 35px;

  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.stat-box {
  min-width: 0;

  padding: 18px 20px;

  background: #f8f8f5;

  border: 1px solid #ececec;
  border-radius: 18px;

  text-align: center;

  transition: 0.3s ease;
}

.stat-box:hover {
  background: #eef7eb;
  transform: translateY(-3px);
}

.stat-box strong {
  display: block;

  margin-bottom: 6px;

  color: #2b2b2b;

  font-size: 26px;
}

.stat-box span {
  color: #676F54;

  font-size: 14px;
  font-weight: 600;
}

/* =========================
   PROFILE ACTIONS
========================= */

.profile-actions {
  display: flex;
  justify-content: flex-end;

  margin: 22px 0 10px;
}

.edit-profile-btn {
  padding: 12px 24px;

  border: none;
  border-radius: 999px;

  background: #79B4A9;
  color: #ffffff;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;
  transition: 0.3s ease;
}

.edit-profile-btn:hover {
  background: #676F54;
  transform: translateY(-2px);
}

/* =========================
   PROFILE POSTS SECTION
========================= */

.profile-posts-section {
  padding: 28px;

  background: #ffffff;

  border: 1px solid #ececec;
  border-radius: 24px;
}

.profile-posts-section h2 {
  margin-bottom: 22px;

  color: #2b2b2b;

  font-size: 26px;
}

#profilePostsContainer {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* =========================
   PUBLIC PROFILE ACTIONS
========================= */

.public-profile-actions {
  display: flex;
  gap: 12px;

  margin-top: 22px;
}

.follow-profile-btn,
.message-profile-btn {
  padding: 12px 24px;

  border: none;
  border-radius: 999px;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;
  transition: 0.3s ease;
}

.follow-profile-btn {
  background: #79B4A9;
  color: #ffffff;
}

.follow-profile-btn:hover {
  background: #676F54;
  transform: translateY(-2px);
}

.follow-profile-btn.following {
  background: #f8f8f5;
  color: #676F54;

  border: 1px solid #ececec;
}

.follow-profile-btn.following:hover {
  background: #fff1f1;
  color: #b42318;
}

.message-profile-btn {
  background: #f8f8f5;
  color: #676F54;

  border: 1px solid #ececec;
}

.message-profile-btn:hover {
  background: #D7F2BA;
  color: #2b2b2b;
  transform: translateY(-2px);
}

/* =========================
   EDIT PROFILE MODAL
========================= */

.modal-overlay {
  position: fixed;
  inset: 0;

  padding: 24px;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.45);

  z-index: 9999;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  width: 650px;
  max-width: 95%;
  max-height: 85vh;

  padding: 30px;

  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 18px;

  background: #ffffff;

  border-radius: 24px;
}

.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #79B4A9;
  border-radius: 999px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  color: #2b2b2b;

  font-size: 26px;
}

.modal-close-btn {
  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  background: #f8f8f5;

  font-size: 24px;

  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;

  margin-top: 10px;
}

/* =========================
   MODAL FORM
========================= */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #676F54;

  font-weight: 700;
}

.form-group input,
.form-group textarea {
  width: 100%;

  padding: 13px 15px;

  border: 1px solid #dedede;
  border-radius: 14px;

  font-family: "Inter", sans-serif;
  font-size: 15px;

  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #79B4A9;
  box-shadow: 0 0 0 4px rgba(121, 180, 169, 0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: none;
}

.form-group small {
  color: #888888;

  font-size: 12px;
}

.cancel-profile-btn,
.save-profile-btn {
  padding: 12px 22px;

  border: none;
  border-radius: 999px;

  font-weight: 700;

  cursor: pointer;
}

.cancel-profile-btn {
  background: #f8f8f5;
  color: #676F54;
}

.save-profile-btn {
  background: #79B4A9;
  color: #ffffff;
}

.save-profile-btn:hover {
  background: #676F54;
}

/* =========================
   MODAL TAGS / GENRES
========================= */

.tag-options,
.genre-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-option,
.genre-option {
  padding: 10px 16px;

  border: none;
  border-radius: 999px;

  background: #f8f8f5;
  color: #676F54;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
  transition: 0.2s ease;
}

.tag-option:hover,
.genre-option:hover {
  background: #D7F2BA;
}

.tag-option.active,
.genre-option.active {
  background: #79B4A9;
  color: #ffffff;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {
  .app-layout {
    grid-template-columns: 220px 1fr;
  }

  .sidebar-right {
    display: none;
  }
}

@media (max-width: 1000px) {
  .profile-content-row {
    grid-template-columns: 1fr;
  }

  .profile-summary-card {
    margin-top: 20px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .app-layout {
    grid-template-columns: 1fr;

    padding-top: 150px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .sidebar-left,
  .sidebar-right {
    display: none;
  }

  .profile-banner {
    height: 190px;
  }

  .profile-info-card {
    padding: 90px 22px 28px;
  }

  .profile-avatar {
    top: -65px;
    left: 22px;

    width: 125px;
    height: 125px;

    font-size: 44px;
  }

  .profile-info h2 {
    font-size: 34px;
  }

  .profile-bio {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .profile-banner {
    height: 150px;
  }

  .edit-banner-btn {
    right: 15px;
    bottom: 15px;

    width: 38px;
    height: 38px;
  }

  .profile-info-card {
    padding: 75px 18px 24px;
  }

  .profile-avatar {
    top: -55px;
    left: 18px;

    width: 105px;
    height: 105px;

    font-size: 36px;
  }

  .edit-avatar-btn {
    width: 32px;
    height: 32px;

    font-size: 13px;
  }

  .profile-info h2 {
    font-size: 28px;
  }

  .profile-tags {
    font-size: 14px;
  }

  .profile-bio {
    font-size: 15px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-box {
    padding: 14px 12px;
  }

  .stat-box strong {
    font-size: 22px;
  }

  .modal-content {
    max-width: 95%;
    padding: 22px;
  }
}