/* --- Wozzy Comments: Cleaned CSS --- */

/* Main Container */
.comments-section {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0 var(--space-6);
  background: var(--color-comments-bg);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  overflow: visible;
  /* Allow animations/glows to bleed if needed */
}

.comments-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  position: relative;
  animation: cmtSmoothReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Divider on top of header - Full width bleed */
.comments-section__header::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(-1 * var(--space-6));
  right: calc(-1 * var(--space-6));
  height: 1px;
  background: var(--color-comments-divider);
}


.comments-section__heading {
  font-size: 0.8125rem;
  /* Smaller: 13px */
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* Sort Pills Container */
.comments-sort-pills {
  display: flex;
  gap: 16px;
  /* Clean, text-only look */
}

.comments-sort-pills button {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  /* Smaller: 12px */
  font-weight: 600;
  color: var(--color-text-dim);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  /* Indicators */
  border-radius: 0;
}

.comments-sort-pills button:hover {
  color: var(--color-text);
  background: transparent;
}

.comments-sort-pills button.active {
  background: transparent;
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

.hidden-comment {
  display: none !important;
}

.comments-section__composer,
.comment-reply-form {
  display: flex;
  align-items: center;
  /* Vertical centering */
  gap: 12px;
  background: var(--color-comments-input-bg);
  border: 1px solid var(--color-comments-input-border);
  border-radius: 8px;
  padding: 6px 6px 6px 12px;
  margin: 16px 0;
  position: relative;
  animation: cmtSmoothReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.comments-section__composer:focus-within,
.comment-reply-form:focus-within {
  background: var(--color-comments-input-focus-bg);
  border-color: var(--color-comments-input-focus-border);
}

.comments-section__composer>div,
.comment-reply-form>div {
  flex: 1;
  display: flex;
  align-items: center;
  /* Centering for the relative wrapper */
}

/* Inputs */
.comments-section__textarea,
.comment-reply-input {
  width: 100%;
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.5;
  resize: none;
  min-height: 20px;
  box-sizing: border-box;
  box-shadow: none !important;
  outline: none !important;
}

/* Primary Button / Icon Button */
.comment-btn-primary {
  display: none;
  /* text buttons hidden if we switch to icons generally, or just usage change */
}

.comment-btn-icon {
  background: transparent;
  color: var(--color-text);
  border: none;
  padding: 6px;
  /* Reduced padding */
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  height: 32px;
  /* Smaller touch target */
  width: 32px;
  flex-shrink: 0;
}

.comment-btn-icon svg {
  width: 16px;
  /* Smaller icon */
  height: 16px;
  stroke-width: 2.5px;
  /* Thicker stroke for visibility at small size */
}

.comment-btn-icon:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.comment-btn-icon:disabled {
  opacity: 0.5;
  cursor: default;
  background: transparent;
}

/* Comment Items */
.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  position: relative;
  animation: cmtSmoothReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.comment-item__avatar-col {
  flex-shrink: 0;
  padding-top: 4px;
  /* Align with first line of title */
}

.comment-item__body {
  flex: 1;
  min-width: 0;
}


.comment-item__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.75rem;
}


.comment-item__header .avatar {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
}

.comment-item__author {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.75rem;
  /* ~12px */
  transition: color 0.2s;
}

.comment-item__author:hover {
  text-decoration: underline;
  color: var(--color-text);
}

.comment-item__op {
  font-size: 0.5rem;
  font-weight: 800;
  color: var(--color-text);
  background: var(--color-text);
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  line-height: normal;
  display: inline-block;
}

.comment-item__separator,
.comment-item__time {
  color: var(--color-text-dim);
  font-size: 0.625rem;
}

.comment-item__content {
  position: relative;
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  padding: 0;
  width: auto;
  max-width: 100%;
  margin-top: 2px;
  display: block;
}

.mention-link {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.75rem;
  /* Small size mention */
}

.mention-link:hover {
  text-decoration: underline;
}

/* Removed accent point */
.comment-item__content::before {
  display: none;
}

/* Actions */
.comment-item__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.comment-action-link,
.comment-confirm-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-dim);
  font-size: 0.6875rem;
  /* ~11px */
  font-weight: 600;
  cursor: pointer;
}

.comment-action-link:hover,
.comment-confirm-link:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.comment-action-link--delete:hover {
  color: var(--color-danger);
}

.comment-delete-confirm {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.comment-delete-confirm span {
  color: #ef4444;
  font-weight: 700;
}

/* Nested Replies - Pulling back to align with parent start */
.comment-replies {
  margin: 0;
  padding: 0;
  margin-left: -32px;
  /* Pull back 20px avatar + 12px gap */
  border: none;
  display: flex;
  flex-direction: column;
}

.comment-replies .comment-item {
  padding-left: 0 !important;
}

@media (max-width: 640px) {
  .comment-replies {
    margin-left: -32px;
    /* Keep strict alignment on mobile too */
  }
}

.comment-replies-toggle {
  background: none;
  border: none;
  padding: 6px 0;
  margin-top: 4px;
  /* Align with left */
  margin-left: 2px;
  color: var(--color-text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-replies-toggle:hover {
  color: var(--color-text);
}

.comment-replies-toggle::before {
  /* Remove the line before toggle since we aren't indenting */
  display: none;
}

/* Load More & Utilities */
.comments-load-more {
  padding: 12px 0;
  text-align: center;
}

.comment-load-more-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 16px;
  border-radius: 99px;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.comment-load-more-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-text-dim);
}

.comments-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--color-text-dim);
  font-size: 0.875rem;
}

.comments-view-more {
  text-align: center;
  padding-top: 16px;
}

.comments-view-more a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-dim);
  text-decoration: none;
}

@keyframes cmtSmoothReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── RTL Overrides ──────────────────────────── */

[dir="rtl"] .comments-section__composer,
[dir="rtl"] .comment-reply-form {
  padding: 6px 12px 6px 6px;
}

[dir="rtl"] .comment-replies {
  margin-left: 0;
  margin-right: -32px;
}

[dir="rtl"] .comment-replies-toggle {
  margin-left: 0;
  margin-right: 2px;
}
