/* ===============================
   Global Wrapper
================================== */
.comment-section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Comic Sans MS',  sans-serif;
}

/* ===============================
   Header Input Area
================================== */



.comments-title {
  font-size: 60px;
  font-weight: bold;
  color: #7c33c4;
  text-align: center;
  margin-bottom: 20px;
}


.comment-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.comment-header .pfp img {
  width: 150px;
  height: 150px;
  object-fit: cover;
}


.comment-login-prompt {
  margin: 20px auto;
  text-align: center;
}

.login-button {
  display: inline-block;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: bold;
  background-color: #7c33c4;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  font-family: 'Comic Sans MS', sans-serif;
}

.login-button:hover {
  background-color: #5e26a1;
}



.comment-header .input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


#comment-input {
  font-family: 'Comic Sans MS', sans-serif;
  font-size: 16px;
  padding: 10px;
  line-height: 1.4;
  width: 100%;
  border-radius: 8px;
  border: 2px solid #7fbefa;
  background-color: #fff;
}



.comment-header .box textarea {
  width: 100%;
  height: 150;
  font-size: 16px;
  padding: 10px;
  resize: vertical;
  border: 2px solid #ccc;
  border-radius: 8px;
  min-height: 150px;
  background-color: #fff;
}

.submit {
  display: flex;
  justify-content: flex-start;
}

.comment-header .submit button {
  /* Remove align-self: flex-end */
  padding: 8px 16px;
  font-size: 24px;
  font-weight: bold;
  background-color: #5739e2;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: 'Comic Sans MS', sans-serif;
}

.comment-header .submit button:hover {
  background-color: #947dff;
}

/* ===============================
   Comment Body
================================== */
.comment-body {
  margin: 0 auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 600px;
}

/* ===============================
   Single Comment Block
================================== */
.single-comment {
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.single-comment .comment-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.comment-avatar img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #b6a3f3;
}

/* ===============================
   Comment Text Block
================================== */
.comment-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-content .displayname {
  font-weight: bold;
  font-size: 20px;
  color: #baa2f9;
  text-align: left;
}

.comment-content .comment-text {
  font-size: 18px;
  white-space: pre-wrap;
  line-height: 1.5;
  color: #333;
  background-color: #fff;
  padding: 12px;
  border: 2px solid #8dbcf5; /* placeholder color */
  border-top-left-radius: 4px;   /* slightly sharper */
  border-top-right-radius: 30px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
    text-align: left;

}


.comment-content .comment-footer {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
  align-items: center; /* optional for vertical alignment */
  gap: 10px; /* optional spacing between items */

}

.comment-footer button {
  background: none;
  border: none;
  color: #555;
    font-size: 18px;
  cursor: pointer;
  margin-right: 12px;
  padding: 0;
    font-family: 'Comic Sans MS', sans-serif;

}



/* ===============================
   Responsive
================================== */
@media (max-width: 600px) {
  .comment-header .pfp img {
    width: 64px;
    height: 64px;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment-header .submit button {
    width: 100%;
  }

  .single-comment .comment-row {
    flex-direction: column;
  }


}


/* ===============================
   Reply Box Style
================================== */
.reply-box {
  margin-top: 12px;
  margin-left: 70px; /* Aligns under comment content */
}

.reply-box .comment-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.comment-avatar-img.reply {
  width: 50px;
  height: 50px;
}

.reply-box .comment-avatar img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
}

.reply-box .comment-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-box textarea.reply-input {
  font-family: 'Comic Sans MS', sans-serif;
  font-size: 16px;
  padding: 10px;
  line-height: 1.4;
  width: 100%;
  border-radius: 8px;
  border: 2px solid #7fbefa;
  min-height: 80px;
  resize: vertical;
}

.reply-box button.submit-reply {
  padding: 6px 12px;
  font-size: 18px;
  font-weight: bold;
  background-color: #5739e2;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Comic Sans MS', sans-serif;
  width: fit-content;
}

.reply-box button.submit-reply:hover {
  background-color: #947dff;
}


.single-comment.reply {
  margin-left: 40px;
  padding-left: 12px;
    border-radius: 10px;
  padding-top: 10px;
}

.sort-bar {
  display: flex;
  justify-content: center; /* 🔹 center the buttons */
  gap: 12px;
  margin: 10px 0 20px;
  padding: 0 10px;
}

.sort-button {
  padding: 10px 20px;
  font-size: 18px;
  font-weight: bold;
  font-family: 'Comic Sans MS', sans-serif;
  background-color: #d1c4e9; /* light purple base */
  color: #4a2a85;
  border: 2px solid #7c33c4;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-button:hover {
  background-color: #b39ddb; /* slightly darker on hover */
}

.sort-button.active {
  background-color: #7c33c4;
  color: white;
  border-color: #5e26a1;
}


/* ===============================
   Mobile Fixes for Comments
================================== */
@media (max-width: 600px) {
  /* Keep avatar + input side by side */
  .comment-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }

  /* Shrink avatar a bit */
  .comment-header .pfp img {
    width: 64px;
    height: 64px;
  }

  /* Input area fills the rest of the row */
  .comment-header .input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Textarea scales wide + shorter */
  #comment-input {
    width: 100%;
    min-height: 80px;   /* shorter box for phones */
    font-size: 14px;
    padding: 8px;
    border-radius: 6px;
    box-sizing: border-box;
  }

  /* Button matches width of textarea */
  .comment-header .submit button {
    width: 100%;
    font-size: 16px;
    padding: 8px;
  }

  /* Ensure comment body spans full screen */
  .comment-body {
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  /* Single comment rows look good on narrow screens */
  .single-comment .comment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .comment-content .comment-text {
    font-size: 16px;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
  }

  .comment-content .displayname {
    font-size: 16px;
  }
}
