/*
 * Comment Box - Frontend Styles
 * Tách từ themes/9minecraft-1.0.8/style.css
 */

/* ── Block A: line 3235-3842 từ style.css (comment list, like, reply form, pagination, header) ── */
.comment-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: #f2f4f7;
  font-weight: 600;
  cursor: url(../img/hand.png), pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.comment-like-btn .like-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background: url('../img/heart.png') no-repeat center;
  background-size: contain;
  line-height: 1;
}

.comment-like-btn:hover { transform: translateY(-1px); }
.comment-like-btn:active { transform: translateY(0); }

.comment-like-btn.is-liked {
  background: #ffeef5;
}

.comment-like-btn[aria-pressed="true"] .like-icon {
  transform: scale(1.1);
}

.comment-respond {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-top: 20px;
}

.comment-reply-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#commentform textarea {
  height: 120px; 
  min-height: 120px;
  max-height: 300px;
  resize: vertical;
}

#commentform input:focus,
#commentform textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 6px rgba(0,123,255,0.3);
  outline: none;
}

#commentform input[type="submit"] {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: url(../img/hand.png), pointer;
  transition: background 0.3s;
}

#commentform input[type="submit"]:hover {
  background: #0056b3;
}

/* ===== COMMENT LIST - Layout: avatar+date top, bubble below ===== */
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mỗi comment item: layout dọc, full width */
.comment-list li > .comment-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 16px;
  width: 100%;
}

/* Comment cha có thread: giảm padding dưới vì đã có nền + margin bọc ngoài */
.comment-list li.has-children > article.comment-body {
  padding-bottom: 4px;
}

/* Hàng trên: avatar + tên + ngày */
.comment-list .comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  width: 100%;
}

.comment-list .comment-author .comment-avatar,
.comment-list .comment-author img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 2px solid #e9ecef;
}

.comment-list .comment-author .fn {
  display: inline;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

/* Comment main bọc bubble + actions */
.comment-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: flex-start;
}

.comment-list li.by-current-user .comment-main {
  align-items: flex-end;
}

/* Bubble comment: co theo nội dung, tối đa 100% */
.comment-list li:not(.by-current-user) .comment-content,
.comment-list li.by-current-user .comment-content {
  position: relative;
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: 10px 14px;
  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  box-sizing: border-box;
}

/* Bubble của current user: góc trái vuông */
.comment-list li.by-current-user .comment-content {
  border-radius: 12px;
  background: #eef4ff;
  border-color: #c5d8ff;
  margin-left: auto;
}

/* Arrow trỏ lên phía avatar - góc trên trái bubble (comment thường) */
.comment-list li:not(.by-current-user) .comment-content::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 14px;
  border-width: 0 7px 8px 7px;
  border-style: solid;
  border-color: transparent transparent #ddd transparent;
  display: block;
}

.comment-list li:not(.by-current-user) .comment-content::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 14px;
  border-width: 0 7px 8px 7px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
  display: block;
}

/* Arrow trỏ lên phía avatar - góc trên phải bubble (current user) */
.comment-list li.by-current-user .comment-content::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 14px;
  left: auto;
  border-width: 0 7px 8px 7px;
  border-style: solid;
  border-color: transparent transparent #c5d8ff transparent;
  display: block;
}

.comment-list li.by-current-user .comment-content::after {
  content: "";
  position: absolute;
  top: -7px;
  right: 14px;
  left: auto;
  border-width: 0 7px 8px 7px;
  border-style: solid;
  border-color: transparent transparent #eef4ff transparent;
  display: block;
}

/* Bypostauthor highlight */
.comment-list li.bypostauthor .comment-content {
  box-shadow: 0 0 0 2px rgba(0,123,255,0.18) inset;
}

/* Current user: đảo ngược header hàng avatar */
.comment-list li.by-current-user > .comment-body {
  align-items: flex-end;
}

.comment-list li.by-current-user .comment-author {
  flex-direction: row-reverse;
}

.comment-list li.by-current-user .comment-author .fn {
  text-align: right;
}

/* Meta (ngày) và reply link */
.comment-list .comment-meta,
.comment-list .comment-reply {
  display: inline;
  font-size: 12px;
  opacity: 0.7;
  margin-left: 4px;
}

.comment-list .comment-reply a {
  text-decoration: none;
}

/* Actions (like, reply) */
.comment-actions {
  align-self: flex-start;
}

.comment-list li.by-current-user .comment-actions {
  align-self: flex-end;
}

/* ===== THREAD: parent có con - KHÔNG wrap box (parent giữ trắng nổi bật) ===== */
.comment-list li.has-children {
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  border: none;
  border-radius: 0;
}

/* ===== CHILDREN (nested comments) ===== */
.comment-list .children {
  margin: 4px 0 0 28px;
  padding: 0 0 0 24px;
  list-style: none;
  border-left: 2px solid #9ca3af;
  position: relative;
}

.comment-list .children > li {
  position: relative;
  margin-top: 10px;
}
.comment-list .children > li:first-child { margin-top: 6px; }

/* Horizontal connector từ tree line → avatar child */
.comment-list .children > li::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 24px;
  width: 22px;
  height: 2px;
  background: #9ca3af;
}

/* Mask: last child không có line kéo xuống dưới */
.comment-list .children > li:last-child::after {
  content: "";
  position: absolute;
  left: -26px;
  top: 26px;
  bottom: -12px;
  width: 4px;
  background: #fff;
  z-index: 1;
}

/* Comment CON: CHỈ bubble (.comment-content) đổi nền - phần avatar/row không bị đụng */
.comment-list .children > li:not(.by-current-user) .comment-content {
  background: #f1f5f9;        /* slate-100 */
  border-color: #cbd5e0;
}
/* Arrow trỏ lên avatar: match bg mới */
.comment-list .children > li:not(.by-current-user) .comment-content::before {
  border-bottom-color: #cbd5e0;
}
.comment-list .children > li:not(.by-current-user) .comment-content::after {
  border-bottom-color: #f1f5f9;
}

/* Avatar + font child nhỏ hơn (visually subordinate) */
.comment-list .children > li .comment-avatar,
.comment-list .children > li .comment-author img {
  width: 32px;
  height: 32px;
}
.comment-list .children > li .fn { font-size: 12px; }

/* Level 3 (cháu): bubble đậm hơn */
.comment-list .children .children > li:not(.by-current-user) .comment-content {
  background: #e2e8f0;
  border-color: #b8c2cf;
}
.comment-list .children .children > li:not(.by-current-user) .comment-content::before {
  border-bottom-color: #b8c2cf;
}
.comment-list .children .children > li:not(.by-current-user) .comment-content::after {
  border-bottom-color: #e2e8f0;
}

/* Level 4+: đậm nhất */
.comment-list .children .children .children > li:not(.by-current-user) .comment-content {
  background: #cbd5e0;
  border-color: #9ca8b7;
}
.comment-list .children .children .children > li:not(.by-current-user) .comment-content::before {
  border-bottom-color: #9ca8b7;
}
.comment-list .children .children .children > li:not(.by-current-user) .comment-content::after {
  border-bottom-color: #cbd5e0;
}

/* Deeper levels: giảm indent */
.comment-list .children .children { margin-left: 20px; padding-left: 20px; }
.comment-list .children .children > li::before { left: -20px; width: 18px; top: 22px; }
.comment-list .children .children > li:last-child::after { left: -22px; top: 24px; }

/* by-current-user: tree line bên phải (giữ feature cũ) */
.comment-list li.by-current-user > .children {
  margin-left: 0;
  margin-right: 28px;
  padding-left: 0;
  padding-right: 24px;
  border-left: none;
  border-right: 2px solid #9ca3af;
}
.comment-list li.by-current-user > .children > li::before {
  left: auto;
  right: -24px;
}
.comment-list li.by-current-user > .children > li:last-child::after {
  left: auto;
  right: -26px;
}

@media (max-width: 600px) {
  .comment-list .children {
    margin-left: 16px;
    padding-left: 14px;
  }
  .comment-list .children > li::before {
    left: -14px;
    width: 12px;
    top: 20px;
  }
  .comment-list .children > li:last-child::after {
    left: -16px;
    top: 22px;
  }

  .comment-list li.by-current-user > .children {
    margin-right: 16px;
    padding-right: 14px;
  }

  .comment-list .comment-author .fn {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
  }

  .card-title a {
    font-size: 20px;
  }
}

.comment-reply-to {
display: block;
width: 100%;
font-size: 12px;
color: #555;
margin-bottom: 6px;
padding: 6px 10px;
background: #f8f9fa;
border-left: 4px solid var(--accent-color, #007bff);
border-radius: 4px;
font-style: italic;
line-height: 1.3;
}

.comment-reply-title {
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 10px;
}

.comment-reply-title small a {
color: red;
margin-left: 10px;
font-weight: bold;
text-decoration: none;
font-size: 16px;
}

.post_comments {
color: #475FAE;
font-weight: 700;
font-family: "Roboto Condensed", sans-serif;
font-size: 16px;
text-decoration: none;
transition: color 0.3s;
}

.post_comments:hover {
color: #d90202;
text-decoration: underline;
}

.comment-reply-to i.fa-reply {
margin-right: 8px;
color: var(--accent-color, #007bff);
}

.comment-reply-to .reply-excerpt {
color: #666;
font-size: 0.9em;
margin-left: 5px;
}

.in-reply-to {
font-size: 0.9em;
color: #888;
margin-left: 10px;
}

.comment-actions a {
font-size: 13px;
font-weight: normal;
color: #555;
padding: 4px 8px;
border-radius: 6px;
background: #f2f4f7;
transition: background 0.2s;
}

.comment-actions a:hover {
background: #e9ecef;
color: #222;
text-decoration: none;
}

.comment-pagination-wrapper {
margin: 20px 0;
text-align: left;
clear: both;
position: relative;
}

.comment-pagination-wrapper::before {
content: "💬 Comment Page:";
display: block;
font-weight: 600;
font-size: 15px;
color: #2e7d32;
margin-bottom: 6px;
font-family: "Roboto Condensed", sans-serif;
}

.comment-pagination {
display: inline-block;
}

.comment-pagination .page-numbers,
.comment-pagination a.page-numbers:visited {
display: inline-block;
margin: 3px 6px 3px 0;
padding: 7px 13px;
font-size: 14px;
color: #2e2e2e;
text-decoration: none;
border: 1px solid #c8e6c9;
border-radius: 6px;
background: #ffffff;
transition: all 0.2s ease;
font-family: "Roboto", sans-serif;
}

/* Cover :hover + :focus + :active để override global a:active { color:#d90202 } */
.comment-pagination a.page-numbers:hover,
.comment-pagination a.page-numbers:focus,
.comment-pagination a.page-numbers:active {
background: #43a047;
border-color: #388e3c;
color: #fff !important;
box-shadow: 0 2px 6px rgba(0,0,0,0.12);
outline: none;
}

.comment-pagination .page-numbers.current {
background: #2e7d32;
border-color: #2e7d32;
color: #fff;
font-weight: 600;
box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.comment-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin: 30px 0 20px;
padding-bottom: 12px;
border-bottom: 1px solid #e2e2e2;
}

.comment-header-icon {
width: 28px;
height: 28px;
flex-shrink: 0;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.comment-title {
font-family: "Oswald", sans-serif;
font-size: 24px;
font-weight: 600;
color: #222;
margin: 0;
line-height: 1.2;
position: relative;
}

.comment-title::after {
content: "";
display: block;
height: 3px;
width: 40px;
background: linear-gradient(90deg, #861023, #d63447);
margin-top: 6px;
border-radius: 2px;
}

.comment-sort-form {
margin-left: auto;
}

.comment-sort-form select {
padding: 6px 10px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 6px;
background: #fff;
cursor: url(../img/hand.png), pointer;
}



.comment-list .comment-content {
word-break: break-word;
overflow-wrap: anywhere;
}

/* ── Block B: line 5212-5311 từ style.css (form title inner + policy banner) ── */
.comment-form-title-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 22px 26px 20px;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
    margin: -32px -32px 28px -32px;
    border-radius: 14px 14px 0 0;
    position: relative;
}

.comment-form-title-inner::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 26px;
    width: 48px;
    height: 3px;
    background: #007bff;
    border-radius: 2px 2px 0 0;
}

.comment-form-title-icon {
    width: 22px;
    height: 22px;
    color: #007bff;
    flex-shrink: 0;
    stroke-width: 1.8;
    opacity: 0.85;
}

.comment-form-title-text {
    font-family: 'Oswald', 'Roboto Condensed', sans-serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: #1a202c;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}

.comment-form-title-sub {
    font-family: 'Roboto', sans-serif;
    font-size: 0.82rem;
    font-weight: 300;
    color: #718096;
    letter-spacing: 0.2px;
    width: 100%;
    margin-top: -6px;
    padding-left: 34px;
    line-height: 1.4;
}

.comment-policy-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 4px 0 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e8edf2;
}

.comment-policy-icon {
    width: 18px;
    height: 18px;
    color: #4a90d9;
    flex-shrink: 0;
    margin-top: 2px;
    stroke-width: 1.8;
    opacity: 0.8;
}

.comment-policy-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.comment-policy-content strong {
    font-family: 'Roboto', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4a90d9;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: block;
}

.comment-policy-content span {
    font-family: 'Roboto', sans-serif;
    font-size: 0.88rem;
    font-weight: 300;
    color: #718096;
    line-height: 1.55;
    letter-spacing: 0.1px;
}

/* ── Copy Link button — modern minimal style ──────────────────── */
.comment-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.comment-share-btn:hover {
    background: #f1f5f9;
    color: #2271b1;
}
.comment-share-btn:active {
    transform: scale(.92);
}
.comment-share-btn.is-copied {
    background: #d1fae5;
    color: #065f46;
}
.comment-share-btn .cs-icon {
    display: block;
    pointer-events: none;
}

/* Toast "Copied!" floating ở trên nút */
.comment-share-toast {
    position: fixed;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-family: -apple-system, system-ui, sans-serif;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    white-space: nowrap;
}
.comment-share-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.comment-share-toast::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 7px;
    height: 7px;
    background: #10b981;
}
