/* ==========================================================================
   COMMENTS.CSS - HỆ THỐNG BÌNH LUẬN TRADIMEOW
   Chuẩn Dark Magma, Xúc giác 3D cơ học (Rule 88) & Chống mù màu (Rule #4)
   Tuyệt đối KHÔNG sử dụng màu xanh lá.
   ========================================================================== */

.comments-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 87, 34, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e2e8f0;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.comments-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-count-badge {
  background: rgba(0, 127, 254, 0.16);
  color: #007ffe;
  border: 1px solid rgba(0, 127, 254, 0.35);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.comments-auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

/* User Pill khi đã đăng nhập */
.comment-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: #111420;
  border: 1px solid #1f273b;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.82rem;
  box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.3);
}

.comment-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #007ffe;
}

.comment-logout-link {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.78rem;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.comment-logout-link:hover {
  color: #ff3b30;
}

/* Nút đăng nhập Google 3D xúc giác */
.btn-comment-google-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #0f1422;
  border: 1.5px solid #007ffe;
  border-radius: 8px;
  color: #007ffe;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #005ecc, 0 3px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-comment-google-login:hover {
  background: rgba(0, 127, 254, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #005ecc, 0 5px 8px rgba(0, 0, 0, 0.45);
}

.btn-comment-google-login:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #005ecc, 0 1px 2px rgba(0, 0, 0, 0.25);
}

.google-icon-svg {
  width: 16px;
  height: 16px;
}

/* Khung soạn thảo bình luận */
.comment-composer {
  background: #0c0f18;
  border: 1px solid #1a2030;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255, 255, 255, 0.03);
}

.comment-composer.is-reply {
  margin-top: 10px;
  margin-bottom: 12px;
  background: #080a10;
  border-color: #242c40;
}

.comment-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  color: #f1f5f9;
  font-size: 0.92rem;
  line-height: 1.5;
  box-sizing: border-box;
  font-family: inherit;
}

.comment-textarea::placeholder {
  color: #64748b;
}

.comment-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #161b28;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-char-counter {
  font-size: 0.76rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.comment-char-counter.is-warning {
  color: #ff9500;
  font-weight: 700;
}

.comment-char-counter.is-exceeded {
  color: #ff3b30;
  font-weight: 800;
}

.comment-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-comment-cancel {
  background: transparent;
  border: 1px solid #2d3748;
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-comment-cancel:hover {
  background: #1a202c;
  color: #cbd5e1;
}

/* Nút Gửi bình luận 3D Electric Blue */
.btn-comment-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: #007ffe;
  border: 1px solid #3399ff;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #005ecc, 0 3px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.btn-comment-submit:hover:not(:disabled) {
  background: #1a8cff;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #005ecc, 0 4px 7px rgba(0, 0, 0, 0.45);
}

.btn-comment-submit:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 0 0 #005ecc, 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn-comment-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Thông báo cảnh báo lỗi inline */
.comment-alert-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-alert-box.is-error {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.35);
  color: #ff6b6b;
}

.comment-alert-box.is-info {
  background: rgba(0, 127, 254, 0.1);
  border: 1px solid rgba(0, 127, 254, 0.3);
  color: #60a5fa;
}

/* Banner nhắc đăng nhập */
.comment-guest-banner {
  background: #0d111c;
  border: 1px dashed #243048;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.comment-guest-text {
  font-size: 0.88rem;
  color: #94a3b8;
}

/* Danh sách bình luận */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-empty-placeholder {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.9rem;
  background: #0a0d16;
  border-radius: 10px;
  border: 1px solid #161b28;
}

/* Thẻ bình luận */
.comment-card {
  display: flex;
  gap: 12px;
  background: #0c0f18;
  border: 1px solid #192030;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s ease;
}

.comment-card:hover {
  border-color: #263248;
}

.comment-avatar-wrap {
  flex-shrink: 0;
}

.comment-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #1f273b;
  background: #111420;
}

.comment-main-wrap {
  flex-grow: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.comment-role-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.comment-role-badge.badge-admin {
  background: rgba(255, 87, 34, 0.18);
  color: #ff5722;
  border: 1px solid rgba(255, 87, 34, 0.4);
}

.comment-role-badge.badge-moderator {
  background: rgba(175, 82, 222, 0.18);
  color: #af52de;
  border: 1px solid rgba(175, 82, 222, 0.4);
}

.comment-timestamp {
  font-size: 0.74rem;
  color: #64748b;
  margin-left: auto;
}

.comment-body-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.comment-body-hidden {
  font-style: italic;
  color: #64748b;
  font-size: 0.82rem;
  background: #080a10;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px dashed #242c40;
}

/* Thanh hành động bình luận (Thả tim, Trả lời, Xóa, Báo cáo) */
.comment-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
}

.btn-comment-action {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: inherit;
  transition: all 0.15s ease;
}

.btn-comment-action:hover {
  background: #141a28;
  color: #e2e8f0;
}

/* Nút Thả tim */
.btn-comment-action.action-heart:hover {
  color: #ff3b30;
}

.btn-comment-action.action-heart.is-active {
  color: #ff3b30;
  font-weight: 700;
}

.btn-comment-action.action-heart.is-active svg {
  fill: #ff3b30;
}

/* Nút Trả lời */
.btn-comment-action.action-reply:hover {
  color: #007ffe;
}

/* Nút Xóa */
.btn-comment-action.action-delete:hover {
  color: #ff3b30;
}

/* Nút Báo cáo */
.btn-comment-action.action-report:hover {
  color: #ff9500;
}

/* Luồng Trả lời lồng 1 cấp */
.comment-replies-thread {
  margin-top: 14px;
  padding-left: 18px;
  border-left: 2px solid #1a2234;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-replies-thread .comment-card {
  background: #090c14;
  border-color: #171d2b;
}

.comment-replies-thread .comment-author-avatar {
  width: 28px;
  height: 28px;
}

/* Modal Popup Báo Cáo Vi Phạm */
.comment-report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.comment-report-modal {
  background: #0f1420;
  border: 1.5px solid #242f48;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  color: #f1f5f9;
}

.comment-report-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ff9500;
}

.comment-report-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  background: #0a0d16;
  border: 1px solid #1a2234;
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}

.comment-report-option:hover {
  border-color: #007ffe;
}

.comment-report-option input[type="radio"] {
  accent-color: #007ffe;
}

.comment-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
   THEME COMIC MEOW OVERRIDES
   ========================================================================== */
[data-theme="comic-meow"] .comments-section {
  border-top-color: #000000;
}

[data-theme="comic-meow"] .comment-card {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow: 3px 3px 0 #000000;
  color: #1a1a1a;
}

[data-theme="comic-meow"] .comment-author-name {
  color: #000000;
}

[data-theme="comic-meow"] .comment-body-text {
  color: #1a1a1a;
}

[data-theme="comic-meow"] .comment-composer {
  background: #faf8f5;
  border: 2px solid #000000;
  box-shadow: 3px 3px 0 #000000;
}

[data-theme="comic-meow"] .comment-textarea {
  color: #000000;
}

[data-theme="comic-meow"] .btn-comment-submit {
  background: #007ffe;
  border: 2px solid #000000;
  box-shadow: 2px 2px 0 #000000;
}

[data-theme="comic-meow"] .btn-comment-submit:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000000;
}

[data-theme="comic-meow"] .btn-comment-submit:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 #000000;
}
