/* ======================
   VinePoster Comments
   ====================== */

/* ---------- Base Container ---------- */
.vp-comments {
  max-width: 760px;
  margin: 2rem auto;
  background: transparent;
  border: none;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1c1e21;
}

/* ---------- Header ---------- */
.comment_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.comment_header .total {
  font-weight: 600;
  color: #050505;
  font-size: 1.05rem;
}

.comment_header .write_comment_btn {
  display: none;
}

/* ---------- Lists & Structure ---------- */
.vp-comments__list,
.vp-comments__list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vp-comments__list>.vp-comment {
  margin-top: 0.8rem;
}

/* Empty State Message */
.vp-cmt-empty {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #65676b;
  list-style: none;
}

/* ---------- Individual Comment ---------- */
.vp-comment {
  display: block;
  margin-bottom: 0.6rem;
}

.vp-comment__card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0f2f5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 18px;
  padding: 0.7rem 1rem;
  transition: background 0.2s ease;
}

.vp-comment__card:hover {
  background: #e9ebee;
}

.vp-comment--highlight .vp-comment__card {
  animation: vp-comment-pop 0.8s ease;
  background: color-mix(in srgb, var(--vp-accent, var(--accent-color, #1a73e8)) 5%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--vp-accent, var(--accent-color, #1a73e8)) 25%, transparent);
}


@keyframes vp-comment-pop {
  0% {
    transform: scale(0.98);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.01);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- Avatar ---------- */
.vp-comment__avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* ---------- Meta & Text ---------- */
.vp-comment__meta {
  font-size: 0.8rem;
  color: #65676b;
  margin-bottom: 0.1rem;
}

.vp-comment__author {
  color: #050505;
  font-weight: 600;
  font-size: 0.9rem;
}

.vp-comment__date {
  color: #777;
  font-size: 0.8rem;
}

.vp-comment__text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #1c1e21;
  margin-top: 0.15rem;
}

/* ---------- Actions (Like · Reply · Time) ---------- */
.vp-comment__actions {
  font-size: 0.8rem;
  margin-top: 0.3rem;
  color: #65676b;
  user-select: none;
}

.vp-comment__actions a {
  background: none;
  color: var(--vp-accent, #f0f2f5);
  text-decoration: none;
  font-weight: 500;
  margin-right: 0.5rem;
  padding: 0;
  transition: color 0.2s ease;
}

.vp-comment__actions a:hover {
  text-decoration: underline;
  color: var(--vp-accent-dark, #c2185b);
}

/* ---------- Nested Replies ---------- */
.vp-comments .children {
  margin-left: 1.8rem;
  padding-left: 0.6rem;
  /*border-left: 2px solid #e4e6eb;*/
  margin-top: 0.4rem;
}

.vp-comments .children .vp-comment__card {
  background: #f5f6f7;
}

.vp-comments .children .children {
  margin-left: 2rem;
  /*border-left: 1.5px solid #ddd;*/
  opacity: 0.95;
}

/* ============================================================
   Composer 
   ============================================================ */

.write_comment {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.write_comment .vp-comment__avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  transition: opacity 0.25s ease;
  opacity: 0.9;
}

.write_comment .c_form:focus-within~.vp-comment__avatar img,
.write_comment:focus-within .vp-comment__avatar img {
  opacity: 1;
}

/* ---------- Form Container ---------- */
.write_comment .c_form {
  position: relative;
  display: flex;
  flex: 1;
  background: #f0f2f5;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 0.5rem 0.8rem 0.8rem;
  transition: background 0.2s ease;
}

.write_comment .c_form:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--vp-accent, #f0f2f5) 25%, transparent);

}

/* ---------- Textarea ---------- */
.write_comment .c_form textarea {
  border: none;
  background: transparent;
  resize: none;
  flex: 1;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #050505;
}

.write_comment .c_form textarea:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* ---------- Submit Button ---------- */
.write_comment .c_form .c_submit {
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 0;
  color: transparent;
  transition: transform 0.15s ease, opacity 0.2s ease;
  opacity: 0.4;
  pointer-events: none;
}

.write_comment .c_form .c_submit:hover {
  transform: translateX(1px) translateY(-1px) scale(1.05);
  opacity: 0.9;
}

.write_comment .c_form .c_submit::before {
  font-family: 'Material Icons Outlined';
  content: "\e163";
  /* Unicode for send icon */
  font-size: 26px;
  display: inline-block;
  line-height: 1;
  vertical-align: bottom;
  text-transform: none;
  letter-spacing: normal;
  font-variant-ligatures: none;
  word-wrap: normal !important;
  white-space: nowrap !important;
  text-rendering: optimizeLegibility;
  font-variation-settings:
    'FILL' 0,
    'wght' 500,
    'GRAD' 0,
    'opsz' 24;
  transition: color 0.2s ease, transform 0.15s ease;
  transform: translateY(3px);
  color: #bbb;
}

.write_comment .c_form .c_submit:hover::before {
  color: var(--vp-accent-dark, #f0f2f5);
  transform: translateY(2px) scale(1.1);
}

.write_comment.active .c_form .c_submit {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.write_comment.active .c_form .c_submit::before {
  color: var(--vp-accent, #f0f2f5) !important;
}

.write_comment .c_form:focus-within .c_submit::before {
  color: var(--vp-accent, #1a73e8);
}

.write_comment #c_cancel_reply {
  display: none !important;
}

/* ============================================================
   Inline Reply Composer — Mirror of Top Composer
   ============================================================ */

.write_comment.inline {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.8rem;
  width: 100%;
  padding-left: 0;
}

.vp-comment__card+.write_comment.inline {
  margin-top: 0.6rem;
  margin-left: 0;
}

.write_comment.inline .vp-comment__avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.9;
}

/* identical to top composer */
.write_comment.inline .c_form {
  position: relative;
  flex: 1;
  background: #f0f2f5;
  border-radius: 24px;
  padding: 0.5rem 0.8rem 0.8rem;
  transition: background 0.2s ease;
}

.write_comment.inline .c_form:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--vp-accent, #f0f2f5) 25%, transparent);

}

.write_comment.inline .c_form textarea {
  border: none;
  background: transparent;
  resize: none;
  flex: 1;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #050505;
}

.write_comment.inline .c_form .c_submit {
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 0;
  color: transparent;
  transition: transform 0.15s ease, opacity 0.2s ease;
  opacity: 0.4;
  pointer-events: none;
}

/* reuse the same active logic */
.write_comment.inline.active .c_form .c_submit {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.write_comment.inline .c_form .c_submit::before {
  font-family: 'Material Icons Outlined';
  content: "\e163";
  /* Unicode for send icon */
  font-size: 26px;
  display: inline-block;
  line-height: 1;
  vertical-align: bottom;
  text-transform: none;
  letter-spacing: normal;
  font-variant-ligatures: none;
  word-wrap: normal !important;
  white-space: nowrap !important;
  text-rendering: optimizeLegibility;
  font-variation-settings:
    'FILL' 0,
    'wght' 500,
    'GRAD' 0,
    'opsz' 24;
  transition: color 0.2s ease, transform 0.15s ease;
  transform: translateY(3px);
  color: #bbb;
}

/* identical hover + active color logic */
.write_comment.inline .c_form .c_submit:hover::before {
  color: var(--vp-accent-dark, #f0f2f5);
  transform: translateY(2px) scale(1.1);
}

.write_comment.inline.active .c_form .c_submit::before {
  color: var(--vp-accent, #f0f2f5) !important;
}

.write_comment.inline .c_form:focus-within .c_submit::before {
  color: var(--vp-accent, #1a73e8);
}

/* ============================================================
   Accessibility & Responsive
   ============================================================ */

#c_status {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.6rem;
}

@media (max-width: 640px) {
  .vp-comments {
    padding: 0 0.5rem;
  }

  .vp-comments .children {
    margin-left: 1.2rem;
    padding-left: 0.6rem;
  }

  .vp-comment__avatar img {
    width: 32px;
    height: 32px;
  }

  .vp-comment__card {
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
  }

  .write_comment .c_form {
    padding: 0.3rem 0.6rem;
  }
}

.vp-comments .vp-comment__avatar img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  max-width: none !important;
  display: inline-block !important;
  object-fit: cover !important;
  box-shadow: none !important;
  background: none !important;
}

/* ============================================================
   Scoped Overrides for Submit Button
   ============================================================ */

.vp-comments .c_submit {
  background: transparent;
  border: none;
  color: transparent;
  text-transform: none;
  letter-spacing: normal;
  font-family: inherit;
}

.vp-comments .c_submit::before {
  font-family: 'Material Icons Outlined';
  content: "\e163";
  font-size: var(--vp-icon-md);
  color: var(--vp-accent);
  opacity: 1;
}