/* ===== Wrap ===== */
.msc-wrap {max-width: 920px; margin: 24px auto; padding: 0;}
.msc-title {font-size: 20px; font-weight: 700; margin: 0 0 12px;}

/* ===== List & Items ===== */
.msc-list {display: grid; gap: 12px; margin-bottom: 12px; min-width:0;}
.msc-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(120,120,120,.25);
  border-radius: 6px;
  background: rgba(255,255,255,.02);
  box-sizing: border-box;
  max-width: 100%;
}
/* .msc-item.msc-pinned {border-color:#f59e0b66; background: rgba(245,158,11,.06);} */
.msc-avatar {display:flex; align-items:flex-start; justify-content:center;}
.msc-avatar img {width:40px; height:40px; border-radius:50%; object-fit:cover;}
/* Avatar chữ cái khi không có ảnh */
.msc-avatar-initials{
  width:40px;height:40px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:700;color:#fff;background:#4b5563;text-transform:uppercase;letter-spacing:.5px;
}

.msc-body {min-width:0;}
.msc-head {display:flex; align-items:center; gap:8px; margin-bottom:4px; flex-wrap:wrap;}
.msc-name {font-weight:600;}
.msc-time {opacity:.7; font-size:12px;}
.msc-content {
  line-height:1.6;
  overflow-wrap:anywhere; word-break:break-word; -webkit-hyphens:auto; hyphens:auto;
}
.msc-content a{
  color:#93c5fd; text-decoration:underline; text-underline-offset:2px;
}
.msc-content a:hover{ color:#bfdbfe; }
.msc-content img, .msc-content video {max-width:100%; height:auto; border-radius:6px;}
.msc-empty {opacity:.7;}

/* ===== Badges ===== */
.msc-badge-admin{
  padding:1px 8px; font-size:10px; font-weight:700; border-radius:999px;
  background: linear-gradient(90deg,#fbbf24,#f59e0b); color:#111; line-height:1.6;
}
.msc-badge-pin{
  margin-left:6px; padding:1px 6px; font-size:11px; font-weight:700; border-radius:6px;
  background:#f59e0b; color:#111;
}

/* ===== Actions & Replies ===== */
.msc-actions {display:flex; gap:8px; margin-top:8px; flex-wrap:wrap;}
.msc-actions .msc-reply-toggle {
  background: transparent; border: 1px solid rgba(120,120,120,.35);
  color: #eaeaea; border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: 13px;
}
.msc-actions .msc-reply-toggle:hover { background: rgba(255,255,255,.06); }

.msc-replies-acc-btn{
  background: transparent; border: 1px solid rgba(120,120,120,.35);
  color: #eaeaea; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; white-space:nowrap; max-width:100%;
}
.msc-replies-acc-btn .msc-caret{
  width: 10px; height: 10px; border-right: 2px solid #aaa; border-bottom: 2px solid #aaa;
  transform: rotate(45deg); transition: transform .15s ease;
}
.msc-replies-acc-btn.is-open .msc-caret,
.msc-replies-acc-btn[aria-expanded="true"] .msc-caret{ transform: rotate(-135deg); }

.msc-replies-acc-panel{ margin-top:8px; max-width:100%; overflow:hidden; }
.msc-replies{
  display:grid; gap:10px; margin-top:8px;
  /* indent co giãn theo màn hình để tránh tràn */
  padding-left: 1px;
  border-left: 2px solid rgba(255,255,255,.06);
  min-width:0;
border-radius: 5px;
}
.msc-item .msc-replies .msc-item { background: rgba(255,255,255,.03); }
.msc-item .msc-replies .msc-replies { margin-left: 28px; }

/* ===== Load more buttons ===== */
.msc-loadmore, .msc-loadmore-replies {
  margin: 8px auto 16px; display: block; padding: 10px 16px; border: none; border-radius: 8px;
  background: #3b82f6; color: #fff; font-weight: 600; cursor: pointer;
}
.msc-loadmore:disabled, .msc-loadmore-replies:disabled {opacity:.6; cursor:not-allowed;}

/* ===== Form (top) ===== */
.msc-form-title {margin:0 0 10px; font-size:18px; font-weight:700;}
.msc-label {display:block; font-size:13px; opacity:.85; margin:8px 0 6px;}
.msc-form textarea,
.msc-form input[type="text"],
.msc-form input[type="email"] {
  width:100%; padding:12px 14px; border-radius:10px; border:1px solid rgba(120,120,120,.25);
  background:#1f1f1f; color:#eee; outline:none;
}
.msc-form textarea::placeholder,
.msc-form input::placeholder {color:#aaa;}
.msc-grid {display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:10px;}
@media (max-width: 640px){ .msc-grid {grid-template-columns:1fr;} }
.msc-btn { margin-top:14px; padding:10px 16px; border-radius:5px; border:none; cursor:pointer; background:#bf7c4e; color:#fff; font-weight:600; }
.msc-btn:disabled {opacity:.6; cursor:not-allowed;}
.msc-btn-sm { padding:8px 12px; font-size:14px; }
.msc-note {font-size:12px; opacity:.75; margin-top:8px}

/* Honeypot & Alerts */
.msc-hp {position:absolute !important; left:-9999px !important; top:-9999px !important;}
.msc-status {margin-bottom:10px; display:none;}
.msc-alert {padding:10px 12px; border-radius:10px; border:1px solid rgba(120,120,120,.25); background: rgba(255,255,255,.04); font-size:14px;}
.msc-success { border-color: #22c55e55; }
.msc-error   { border-color: #ef444455; }

/* Turnstile full width */
.msc-turnstile-wrap { width: 100%; }
.msc-turnstile-wrap .cf-turnstile { display:block; width:100%; margin-top: 5px; }

/* Accordion: VIẾT BÌNH LUẬN */
.msc-form-acc {border:1px solid rgba(120,120,120,.25); border-radius:6px; overflow:hidden; background: rgba(255,255,255,.02); margin: 10px 0;}
.msc-form-acc-toggle{
  width:100%; text-align:left; background:transparent; border:0; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 14px; font-weight:700; color:#eaeaea; border-bottom:1px solid rgba(120,120,120,.2);
}
.msc-form-acc-title{ font-size:18px; }
.msc-form-acc-caret{ width:10px; height:10px; border-right:2px solid #aaa; border-bottom:2px solid #aaa; transform:rotate(45deg); transition:transform .15s ease; }
.msc-form-acc-toggle.is-open .msc-form-acc-caret,
.msc-form-acc-toggle[aria-expanded="true"] .msc-form-acc-caret{ transform: rotate(-135deg); }
.msc-form-acc-panel{ padding:12px 14px; display:none; }
/* Khi button ở trạng thái mở -> hiển thị panel */
.msc-form-acc-toggle[aria-expanded="true"] + .msc-form-acc-panel { display:block; }

/* ===== Mobile tweaks ===== */
@media (max-width: 620px) {
  .msc-item { grid-template-columns: 36px 1fr; }
  .msc-avatar img, .msc-avatar-initials { width: 36px; height: 36px; }
  .msc-replies { margin-left: 24px; }
  .msc-item .msc-replies .msc-replies { margin-left: 16px; }
  .msc-actions { gap: 6px; flex-wrap:wrap; }
}
@media (max-width: 420px) {
  .msc-item { grid-template-columns: 40px 1fr; }
  .msc-avatar img, .msc-avatar-initials { width: 32px; height: 32px; }
  .msc-replies { margin-left: 18px; }
  .msc-item .msc-replies .msc-replies { margin-left: 12px; }
  .msc-name { font-size: 14px; }
  .msc-time { font-size: 11px; }
}
/* Badge Admin đã có; thêm Badge Pinned */
.msc-badge-pinned{
  padding:1px 3px; font-size:11px; font-weight:700; border-radius:999px;
  background: linear-gradient(90deg, #fde4d3, #fb923c); color:#111; line-height:1.6;
}
/* ===== Hiệu ứng tên Admin ===== */
.msc-name-admin{
  background: linear-gradient(90deg,#ffffff,#ffd166,#ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 0 rgba(0,0,0,0); /* chống aliasing lạ */
  position: relative;
  animation: mscAdminShine 3.2s linear infinite;
  font-weight: 800;
filter: drop-shadow(0 0 6px rgba(255, 209, 102, .55));
}
.msc-name-admin:hover{
  filter: drop-shadow(0 0 6px rgba(245, 34, 20, .55));
  transform: translateZ(0);
}
@keyframes mscAdminShine{
  0% { background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}
.msc-name-admin{
  background-size: 300% 300%;
}

/* người dùng chọn giảm chuyển động → tắt hiệu ứng */
@media (prefers-reduced-motion: reduce){
  .msc-name-admin{ animation: none; background: none; color: #ffe08a; text-shadow: 0 0 6px rgba(255, 209, 102, .35); }
}

/* Avatar chữ cái (initials) */
.msc-initial-avatar { font-size:14px; color:#111; }
