:root {
  --border-color: #282828;
  --link-blue: #007bff;
  --text-gray: #00000067;
}

#comments {
  margin-top: 10rem;
  padding: 2rem 0.5rem;
  background: var(--primary-color);
}

.comments-content-inner {
  max-width: 600px;
  margin: 0 auto;
}

#comments h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  margin-left: 1.5rem;
}

.comments-info {
  color: var(--text-gray);
  font-size: 0.8rem;
  text-align: center;
  font-style: italic;
}

.no-replies.comments-info {
  padding: 2rem 1rem;
}

.end-of-comments.comments-info {
  padding: 1rem 1rem;
}

.comment-error {
  color: #c00;
  font-size: 0.85rem;
  padding-left: 1rem;
}

/* ==========================================================================
   COMMENT & REPLY CARDS (shared styles)
   ========================================================================== */

.comment {
  border: 1px solid var(--border-color);
  border-radius: 35px;
  background: white;
  margin-bottom: 0.5rem;
  padding: 0.9rem 0.9rem;
  transition: background-color 0.5s ease;
}

.reply {
  margin-left: 5rem;
}

.reply::before {
  content: "";
  position: absolute;
  left: -50px; /* Adjust based on your margin */
  top: 0px;
  width: 35px;
  height: calc(50% - 0px); /* Half the comment height */
  border-left: 2px solid #666;
  border-bottom: 2px solid #666;
  border-bottom-left-radius: 30px; /* Optional: rounded corner */
}

.reply {
  position: relative; /* Needed for absolute positioning */
}

.comment-header {
  margin-bottom: 0.25rem;
  padding: 0.25rem 1rem;
  line-height: 1.2;
}

.root.comment .comment-header,
.reply.comment .comment-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.comment-author {
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--text-dark);
}

.comment-time {
  color: var(--text-gray);
  font-size: 0.8rem;
}

.comment-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0.25rem 1rem;
  line-height: 1.2;
  font-size: 1rem;
  color: var(--text-dark);
  font-family: "BodyFont", sans-serif;
}

#comment-form {
  position: relative;
  margin-bottom: 4rem;
}
#comment-form:after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  top: 100%; /* Adjust as needed for spacing */
  height: 1px; /* Thickness of the divider */
  background-color: var(--on-primary-color); /* Use the border color */
  margin-top: 2rem; /* Space above the divider */
}

/* ==========================================================================
   COMMENT FORMS (shared base styles)
   ========================================================================== */

/* Form inputs */
.form .comment-author,
.form .comment-content {
  border: 0;
  resize: none;
  width: 100%;
}
.form .comment-author {
  border-radius: 5px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.form .comment-content {
  border-radius: 5px;
}

.form input:focus-visible,
.form textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #b2d7ff;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.char-counter {
  margin-left: auto;
  margin-right: 1.2rem;
  font-size: 0.75rem;
  color: #999;
}

.comment-buttons {
  display: flex;
  justify-content: end;
  gap: 1rem;
  margin-right: 1.3rem;
}

.comment-btn {
  font-size: 1rem;
  font-family: "BodyFont", sans-serif;
  text-transform: lowercase;
  padding: 0.5rem 1rem;
}

.comment-btn:hover {
  text-decoration: underline;
}

.comment-btn:disabled {
  color: #737373;
  cursor: not-allowed;
  text-decoration: none;
}

.submit-btn,
.reply-btn {
  color: var(--on-primary-color);
  align-self: flex-start;
}

.cancel-btn {
  color: #666;
}

/* ==========================================================================
   @MENTIONS & INTERACTIONS
   ========================================================================== */

.mention {
  color: var(--link-blue);
  cursor: pointer;
  font-weight: 500;
}

.mention:hover {
  text-decoration: underline;
}

.comment-highlighted {
  background-color: #ffefbb !important;
}

/* ==========================================================================
   OWNER COMMENTS (Saska)
   ========================================================================== */

.comment.owner {
  background-color: #fff6f8;
  border-color: #ffb3c1;
}

.comment.owner .comment-author {
  color: #d63384;
  font-weight: 600;
}

.owner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ff8fa3;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(255, 107, 157, 0.2);
}

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

@media (max-width: 768px) {
  .reply {
    margin-left: 3rem;
  }
  .reply::before {
    left: -30px; /* Adjust based on your margin */
    width: 22px;
  }
}
