/* gaigoigiare.vip overrides */

/* Hide empty containers left by thread cleanup */
.node-extra:empty,
.block-body:empty,
.porta-article-item:empty {
  display: none;
}

/* Hide non-functional elements */
.js-quickSearch,
.js-globalSearchContainer,
.formSubmitRow--sticky,
.shareButtons .shareButtons-button[href*="facebook.com"],
.shareButtons .shareButtons-button[href*="twitter.com"],
.shareButtons .shareButtons-button[href*="reddit.com"] {
  display: none !important;
}

/* ─── User Nav (logged in) ─── */
.cvip-user-nav {
  display: flex; align-items: center; gap: 8px; position: relative; cursor: pointer; padding: 4px 8px;
}
.cvip-user-trigger {
  display: flex; align-items: center; gap: 8px;
}
.cvip-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}
.cvip-avatar--default {
  width: 32px; height: 32px; border-radius: 50%; background: #394456; color: #73bdf7;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.cvip-username {
  color: #73bdf7; font-size: 13px; font-weight: 600;
}
.cvip-notif-badge {
  background: #e94560; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.cvip-dropdown {
  display: none; position: absolute; top: 100%; right: 0; background: #282c30;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 100; overflow: hidden;
}
.cvip-dropdown--open { display: block; }
.cvip-dropdown-header {
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13px;
}
.cvip-dropdown-header small { color: #888; }
.cvip-dropdown-item {
  display: block; padding: 8px 14px; color: #e0e0e0; font-size: 13px; transition: 0.15s;
}
.cvip-dropdown-item:hover { background: rgba(115,189,247,0.08); color: #73bdf7; text-decoration: none; }
.cvip-dropdown-item--danger { color: #e94560; }
.cvip-dropdown-item--danger:hover { background: rgba(233,69,96,0.1); color: #e94560; }

/* ─── Badges ─── */
.cvip-badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; vertical-align: middle; margin-left: 4px;
}
.cvip-badge--admin { background: rgba(233,69,96,0.15); color: #e94560; }
.cvip-badge--mod { background: rgba(255,152,0,0.15); color: #ff9800; }

/* ─── Comment System ─── */
.cvip-comments {
  margin-top: 24px;
}
.cvip-comments .block-header {
  padding: 12px 16px;
}
.cvip-comments .block-header h3 {
  font-size: 16px; font-weight: 600; color: #e0e0e0;
}
.cvip-comment-form {
  padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cvip-comment-form-row {
  display: flex; gap: 12px; align-items: flex-start;
}
.cvip-comment-form-row .cvip-avatar,
.cvip-comment-form-row .cvip-avatar--default {
  flex-shrink: 0;
}
.cvip-comment-input, .cvip-reply-input, .cvip-edit-input {
  width: 100%; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1); color: #e0e0e0;
  padding: 10px 14px; border-radius: 6px; font-size: 14px; resize: vertical; font-family: inherit;
}
.cvip-comment-input:focus, .cvip-reply-input:focus, .cvip-edit-input:focus {
  border-color: #73bdf7; outline: none;
}
.cvip-comment-form-actions {
  display: flex; justify-content: flex-end; margin-top: 8px;
}
.cvip-login-prompt {
  padding: 16px; color: #888; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cvip-login-prompt a { color: #73bdf7; }

.cvip-comment {
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cvip-comment--reply {
  margin-left: 24px; padding-left: 14px; border-left: 2px solid rgba(115,189,247,0.15);
}
.cvip-comment-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.cvip-comment-header .cvip-avatar,
.cvip-comment-header .cvip-avatar--default {
  width: 28px; height: 28px; font-size: 12px;
}
.cvip-comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cvip-comment-author { font-weight: 600; font-size: 13px; color: #73bdf7; }
.cvip-comment-time { font-size: 12px; color: #666; }
.cvip-comment-body { font-size: 14px; line-height: 1.6; margin-bottom: 6px; word-break: break-word; }
.cvip-comment-actions { display: flex; gap: 12px; }
.cvip-action {
  font-size: 12px; color: #666; cursor: pointer; transition: 0.15s;
}
.cvip-action:hover { color: #73bdf7; text-decoration: none; }
.cvip-no-comments { padding: 30px; text-align: center; color: #666; }

.cvip-reply-form {
  margin: 8px 0 8px 38px; display: flex; flex-direction: column; gap: 6px;
}
.cvip-reply-actions, .cvip-edit-actions {
  display: flex; gap: 6px;
}

.cvip-comment-pagination {
  display: flex; gap: 4px; padding: 12px 16px; justify-content: center;
}
.cvip-page-btn {
  padding: 4px 10px; border-radius: 4px; color: #888; background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.08); font-size: 13px;
}
.cvip-page-btn:hover { border-color: #73bdf7; color: #73bdf7; text-decoration: none; }
.cvip-page-btn--active { background: #73bdf7; color: #000; border-color: #73bdf7; }

/* ─── Error Messages ─── */
.cvip-error {
  margin: 8px 0; padding: 10px 14px; background: rgba(233,69,96,0.1);
  border: 1px solid rgba(233,69,96,0.3); border-radius: 4px; color: #e94560; font-size: 13px;
}

/* ─── Notification Panel ─── */
.cvip-notif-panel {
  position: absolute; top: 100%; right: 0; background: #282c30;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 101; overflow: hidden;
}
.cvip-notif-panel-header {
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600;
}
.cvip-notif-read-all { font-size: 11px; color: #73bdf7; }
.cvip-notif-list { max-height: 360px; overflow-y: auto; }
.cvip-notif-item {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #888; font-size: 13px; transition: 0.15s;
}
.cvip-notif-item:hover { background: rgba(115,189,247,0.05); text-decoration: none; color: #e0e0e0; }
.cvip-notif-item--unread { color: #e0e0e0; background: rgba(115,189,247,0.03); }
.cvip-notif-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.cvip-notif-body { flex: 1; min-width: 0; }
.cvip-notif-msg { display: block; line-height: 1.4; }
.cvip-notif-time { display: block; font-size: 11px; color: #666; margin-top: 2px; }
.cvip-notif-empty { padding: 30px; text-align: center; color: #666; font-size: 13px; }

/* ─── Online Users Widget ─── */
.cvip-online-block { margin-bottom: 16px; }
.cvip-online-block .block-header h3 { font-size: 14px; font-weight: 600; color: #e0e0e0; }
.cvip-online-list { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.cvip-online-user {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px;
  background: rgba(115,189,247,0.04); border-radius: 16px; font-size: 12px;
}
.cvip-online-name { color: #73bdf7; font-weight: 500; }
.cvip-online-empty { padding: 12px; color: #666; font-size: 13px; text-align: center; width: 100%; }

/* ─── Avatar Sizes ─── */
.cvip-avatar--sm { width: 22px; height: 22px; border-radius: 50%; }
.cvip-avatar--sm.cvip-avatar--default { font-size: 10px; width: 22px; height: 22px; }

/* Fix broken avatar placeholders */
.avatar .avatar--default--dynamic {
  background: #394456;
  color: #73bdf7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 50%;
}

/* Clean up broken external widget areas */
.notices--block .notice--primary {
  border-left: 3px solid #73bdf7;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 4px;
}

/* Better spacing for thread listings */
.structItem {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.structItem:last-child {
  border-bottom: none;
}

/* Improve readability for member profile pages */
.memberProfileBanner {
  min-height: 120px;
  background: linear-gradient(135deg, #1a1a2e 0%, #394456 100%);
}

/* Fix image overflow in posts */
.bbWrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Smooth scroll for page navigation */
html {
  scroll-behavior: smooth;
}

/* Subtle highlight for porta article items */
.porta-article-item {
  transition: background 0.2s;
  border-radius: 6px;
  overflow: hidden;
}
.porta-article-item:hover {
  background: rgba(255,255,255,0.03);
}

/* Clean up star rating display */
.message-userExtras img[src*="Rank"] {
  vertical-align: middle;
  margin-top: -2px;
}

/* Better tag styling */
.tagItem {
  border-radius: 12px;
  padding: 2px 10px;
  transition: background 0.15s;
}

/* Fix pagination spacing */
.pageNav {
  margin: 16px 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Offline banner */
.offline-banner {
  background: linear-gradient(90deg, #394456, #282c30);
  color: #73bdf7;
  text-align: center;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* ─── Telegram floating button + contact popover ─────────────── */
.cvip-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.cvip-float-btn {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff;
  border-radius: 999px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(34,158,217,0.45), 0 0 0 0 rgba(42,171,238,0.6);
  text-decoration: none;
  animation: cvip-tg-pulse 2.6s infinite;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.cvip-float-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 30px rgba(34,158,217,0.6);
}
.cvip-float-btn svg { flex-shrink: 0; display: block; }
.cvip-float-label {
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  transition: max-width 0.3s ease, margin 0.3s ease;
}
.cvip-float-btn:hover .cvip-float-label {
  max-width: 180px;
  margin-left: 10px;
  margin-right: 6px;
}
@keyframes cvip-tg-pulse {
  0%   { box-shadow: 0 8px 24px rgba(34,158,217,0.45), 0 0 0 0 rgba(42,171,238,0.55); }
  70%  { box-shadow: 0 8px 24px rgba(34,158,217,0.45), 0 0 0 16px rgba(42,171,238,0); }
  100% { box-shadow: 0 8px 24px rgba(34,158,217,0.45), 0 0 0 0 rgba(42,171,238,0); }
}

/* Contact popover above the button */
.cvip-contact-pop {
  width: 260px;
  background: #15151f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.cvip-contact-pop.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cvip-contact-pop-head {
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(42,171,238,0.18), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cvip-contact-pop-body { padding: 6px; }
.cvip-contact-line {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}
.cvip-contact-line:hover { background: rgba(255,255,255,0.05); }
.cvip-contact-k { font-size: 11px; color: #8a8aa0; text-transform: uppercase; letter-spacing: 0.5px; }
.cvip-contact-v { font-size: 14px; color: #e8e8f0; font-weight: 500; margin-top: 1px; word-break: break-all; }
.cvip-contact-pop-note {
  padding: 11px 16px;
  font-size: 12px;
  color: #9a9ab0;
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
}

/* Owner (chủ bài đăng) comment badge */
.cvip-badge--owner {
  background: linear-gradient(135deg, rgba(42,171,238,0.2), rgba(6,182,212,0.2));
  color: #5fc8f5;
  border: 1px solid rgba(42,171,238,0.35);
}

@media (max-width: 600px) {
  .cvip-float { right: 14px; bottom: 14px; }
  .cvip-contact-pop { width: calc(100vw - 28px); max-width: 300px; }
}

/* ─── Admin inline content editor (on thread pages) ─────────────── */
.cvip-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6,182,212,0.3);
  transition: filter 0.15s, transform 0.15s;
}
.cvip-edit-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.cvip-edit-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.cvip-inline-editor {
  border: 1px solid rgba(6,182,212,0.45);
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0;
  background: #0f1420;
  box-shadow: 0 12px 34px rgba(0,0,0,0.45), 0 0 20px rgba(6,182,212,0.08);
}
.cvip-ie-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  background: rgba(6,182,212,0.1);
  border-bottom: 1px solid rgba(6,182,212,0.25);
  font-size: 13px;
  font-weight: 700;
  color: #67e8f9;
}
.cvip-ie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cvip-ie-bar button {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s;
}
.cvip-ie-cancel { background: rgba(255,255,255,0.08); color: #cbd5e1; }
.cvip-ie-cancel:hover { background: rgba(255,255,255,0.14); }
.cvip-ie-save { background: #06b6d4; color: #fff; }
.cvip-ie-save:hover { filter: brightness(1.12); }
.cvip-ie-save:disabled { opacity: 0.6; cursor: default; }
.cvip-ie-body {
  padding: 18px 20px;
  min-height: 160px;
  max-height: 62vh;
  overflow-y: auto;
  color: #e8e8f0;
  font-size: 15px;
  line-height: 1.85;
  outline: none;
}
.cvip-ie-body:focus { background: rgba(255,255,255,0.012); }

/* Prominent admin link in the account dropdown */
.cvip-dropdown-item--admin {
  display: flex !important;
  align-items: center;
  color: #22d3ee !important;
  font-weight: 700;
  background: rgba(6,182,212,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cvip-dropdown-item--admin:hover { background: rgba(6,182,212,0.16) !important; }

/* ─── Telegram speed-dial (3 support agents) ─────────────── */
.cvip-float { position: fixed; right: 22px; bottom: 22px; z-index: 9000; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cvip-float-menu {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  opacity: 0; transform: translateY(12px) scale(0.97); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.cvip-float.open .cvip-float-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.cvip-float-menu-head {
  align-self: flex-end; background: #15151f; color: #8a8aa0; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
}
.cvip-fab-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 18px 8px 9px;
  background: #15151f; border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); transition: transform .15s, filter .15s;
  animation: cvip-fab-in .3s backwards;
}
.cvip-fab-item:hover { transform: translateX(-3px); filter: brightness(1.12); }
.cvip-float.open .cvip-fab-item:nth-child(2) { animation-delay: .03s; }
.cvip-float.open .cvip-fab-item:nth-child(3) { animation-delay: .06s; }
.cvip-float.open .cvip-fab-item:nth-child(4) { animation-delay: .09s; }
@keyframes cvip-fab-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.cvip-fab-ic {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.cvip-fab-item--tg .cvip-fab-ic { background: #229ed9; }
.cvip-fab-item--zalo .cvip-fab-ic { background: #0068ff; }
.cvip-fab-item--phone .cvip-fab-ic { background: #22c55e; }
.cvip-fab-item--fb .cvip-fab-ic { background: #1877f2; }
.cvip-fab-item--email .cvip-fab-ic { background: #f43f5e; }
.cvip-fab-txt { line-height: 1.2; }
.cvip-fab-sep { height: 1px; width: 60%; align-self: flex-end; background: rgba(255,255,255,.1); margin: 2px 0; }
.cvip-fab-main {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(34,158,217,.45);
  animation: cvip-tg-pulse 2.6s infinite; transition: transform .2s;
}
.cvip-fab-main:hover { transform: scale(1.08); }
.cvip-float.open .cvip-fab-main { animation: none; transform: scale(1.05); box-shadow: 0 8px 28px rgba(34,158,217,.6); }
@media (max-width: 600px) {
  .cvip-float { right: 14px; bottom: 14px; }
  .cvip-fab-item { font-size: 13px; }
}


/* ═══════════ SEARCH ═══════════ */
/* ─── Public Search: header box ─────────────────────────────── */
.cvip-search {
  display: flex; align-items: center; gap: 6px; position: relative;
  flex: 0 1 300px; min-width: 0; margin: 0 10px 0 auto;
  background: #15151f; border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; padding: 4px 5px 4px 14px; height: 38px;
  transition: border-color .15s, box-shadow .15s;
}
.cvip-search:focus-within { border-color: #73bdf7; box-shadow: 0 0 0 3px rgba(115,189,247,.12); }
.cvip-search-input {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: 0;
  color: #e8e8f0; font-size: 14px; padding: 0 2px; line-height: 1.2;
}
.cvip-search-input::placeholder { color: #8a8aa0; }
.cvip-search-btn {
  flex-shrink: 0; width: 30px; height: 30px; border: 0; cursor: pointer; padding: 0;
  border-radius: 50%; background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: filter .15s, transform .15s;
}
.cvip-search-btn:hover { filter: brightness(1.12); transform: scale(1.05); }
.cvip-search-btn svg { display: block; }
.cvip-search--floating { position: fixed; top: 10px; right: 10px; z-index: 8000; flex-basis: 260px; }
@media (max-width: 980px) { .cvip-search { flex-basis: 210px; } }
@media (max-width: 760px) {
  .cvip-search { flex-basis: 150px; height: 34px; padding-left: 11px; margin-left: 8px; }
  .cvip-search-input { font-size: 13px; }
}
@media (max-width: 480px) { .cvip-search { flex: 1 1 110px; } }

/* ─── Public Search: results overlay ────────────────────────── */
.cvip-sr-overlay {
  position: fixed; inset: 0; z-index: 9500; display: none;
  background: rgba(6,8,15,.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  padding: 70px 16px 24px; align-items: flex-start; justify-content: center;
}
.cvip-sr-overlay--open { display: flex; }
body.cvip-sr-lock { overflow: hidden; }
.cvip-sr-modal {
  width: 100%; max-width: 760px; max-height: 84vh; display: flex; flex-direction: column;
  background: #12121c; border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: cvip-sr-pop .18s ease;
}
@keyframes cvip-sr-pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.cvip-sr-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
  background: linear-gradient(135deg, rgba(42,171,238,.1), transparent);
}
.cvip-sr-htitle { font-size: 15px; color: #e8e8f0; font-weight: 500; min-width: 0; word-break: break-word; }
.cvip-sr-htitle b { color: #73bdf7; font-weight: 700; }
.cvip-sr-count { color: #8a8aa0; font-size: 13px; font-weight: 400; }
.cvip-sr-close {
  flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.06); color: #cbd5e1; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.cvip-sr-close:hover { background: rgba(233,69,96,.18); color: #e94560; }
.cvip-sr-body { overflow-y: auto; padding: 8px; flex: 1 1 auto; }
.cvip-sr-card {
  display: flex; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.cvip-sr-card:hover { background: rgba(115,189,247,.06); border-color: rgba(115,189,247,.15); text-decoration: none; }
.cvip-sr-thumb { flex-shrink: 0; width: 92px; height: 72px; border-radius: 8px; overflow: hidden; background: #161b26; }
.cvip-sr-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cvip-sr-main { min-width: 0; flex: 1 1 auto; }
.cvip-sr-title {
  color: #e8e8f0; font-weight: 600; font-size: 14.5px; line-height: 1.35; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cvip-sr-card:hover .cvip-sr-title { color: #73bdf7; }
.cvip-sr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #8a8aa0; margin-bottom: 4px; }
.cvip-sr-forum { color: #5fc8f5; }
.cvip-sr-dot { color: #444; }
.cvip-sr-excerpt {
  font-size: 12.5px; color: #9a9ab0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cvip-sr-empty { padding: 46px 24px; text-align: center; color: #9a9ab0; font-size: 14px; line-height: 1.7; }
.cvip-sr-empty b { color: #e8e8f0; }
.cvip-sr-empty span { display: block; margin-top: 6px; font-size: 12.5px; color: #6b6b80; }
.cvip-sr-loading { padding: 46px 24px; text-align: center; color: #9a9ab0; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cvip-sr-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(115,189,247,.25); border-top-color: #73bdf7; animation: cvip-sr-rot .7s linear infinite; }
@keyframes cvip-sr-rot { to { transform: rotate(360deg); } }
.cvip-sr-foot:empty { display: none; }
.cvip-sr-pag { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.cvip-sr-pbtn { padding: 7px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: #1a1a2e; color: #cbd5e1; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.cvip-sr-pbtn:hover:not(:disabled) { border-color: #73bdf7; color: #73bdf7; }
.cvip-sr-pbtn:disabled { opacity: .4; cursor: default; }
.cvip-sr-pinfo { font-size: 13px; color: #8a8aa0; }
@media (max-width: 600px) {
  .cvip-sr-overlay { padding: 56px 8px 12px; }
  .cvip-sr-thumb { width: 70px; height: 58px; }
}

/* ═══════════ LISTINGS ═══════════ */
/* ─── Listing power features (VIP / kiểm định / trạng thái / lượt xem) ─── */
.cvip-listing-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.cvip-lb {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; line-height: 1.5; white-space: nowrap;
}
.cvip-lb--vip { background: linear-gradient(135deg, #f59e0b, #f43f5e); color: #fff; box-shadow: 0 2px 10px rgba(245,158,11,.35); }
.cvip-lb--verified { background: rgba(16,185,129,.16); color: #34d399; border: 1px solid rgba(16,185,129,.4); }
.cvip-lb--status { border: 1px solid transparent; }
.cvip-lb--available { background: rgba(16,185,129,.15); color: #34d399; border-color: rgba(16,185,129,.35); }
.cvip-lb--busy { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.35); }
.cvip-lb--off { background: rgba(148,163,184,.15); color: #94a3b8; border-color: rgba(148,163,184,.3); }
.cvip-lb--views { background: rgba(6,182,212,.12); color: #22d3ee; border: 1px solid rgba(6,182,212,.3); }

/* Homepage Nổi bật / Bài hot sections */
.cvip-home-listings { margin: 0 0 18px; display: flex; flex-direction: column; gap: 18px; }
.cvip-ll-block { background: rgba(19,19,31,.5); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; overflow: hidden; }
.cvip-ll-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  font-size: 15px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06);
}
.cvip-ll-block--vip .cvip-ll-head { background: linear-gradient(90deg, rgba(245,158,11,.18), transparent); }
.cvip-ll-block--hot .cvip-ll-head { background: linear-gradient(90deg, rgba(244,63,94,.18), transparent); }
.cvip-ll-ic { font-size: 16px; }
.cvip-ll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px 16px; }
.cvip-lc {
  display: flex; flex-direction: column; background: rgba(10,10,15,.5);
  border: 1px solid rgba(255,255,255,.06); border-radius: 12px; overflow: hidden;
  transition: transform .18s, border-color .18s; text-decoration: none;
}
.cvip-lc:hover { transform: translateY(-3px); border-color: rgba(6,182,212,.4); text-decoration: none; }
.cvip-lc-thumb { position: relative; aspect-ratio: 3/4; background: #13131f; }
.cvip-lc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cvip-lc-img--empty { display: flex; align-items: center; justify-content: center; color: #475569; font-size: 12px; }
.cvip-lc-views {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.65); color: #e2e8f0;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; backdrop-filter: blur(4px);
}
.cvip-lc-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.cvip-lc-title {
  font-size: 13px; font-weight: 600; color: #e2e8f0; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cvip-lc:hover .cvip-lc-title { color: #22d3ee; }
.cvip-lc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cvip-lc-tags .cvip-lb { padding: 2px 7px; font-size: 10px; }
@media (max-width: 600px) { .cvip-ll-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

/* ═══════════ COMMUNITY ═══════════ */
/* Append the following to the END of public/css/custom.css. All classes are new (cvip-toast, cvip-bookmark-*, cvip-overlay*, cvip-ov-*, cvip-bm-*, cvip-pf-*, cvip-profile-link) — no existing rule is touched. */

/* ─── Toast (public site) ─── */
.cvip-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #15151f; color: #e8e8f0; border: 1px solid rgba(255,255,255,0.12);
  padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 10000; opacity: 0;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: 86vw;
}
.cvip-toast--show { opacity: 1; transform: translate(-50%, 0); }

/* ─── Bookmark button (thread pages) ─── */
.cvip-bookmark-bar { margin: 0 0 14px; }
.cvip-bookmark-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px; cursor: pointer;
  background: rgba(115,189,247,0.08); color: #73bdf7;
  border: 1px solid rgba(115,189,247,0.35);
  font-size: 13px; font-weight: 700;
  transition: background 0.15s, transform 0.15s, filter 0.15s;
}
.cvip-bookmark-btn svg { display: block; }
.cvip-bookmark-btn:hover { background: rgba(115,189,247,0.16); transform: translateY(-1px); }
.cvip-bookmark-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.cvip-bookmark-btn--saved {
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(34,158,217,0.3);
}
.cvip-bookmark-btn--saved:hover { filter: brightness(1.1); background: linear-gradient(135deg, #2aabee, #229ed9); }

/* ─── Overlay shell (bookmarks + member profile) ─── */
.cvip-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(6,8,15,0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; opacity: 0; transition: opacity 0.2s; overflow-y: auto;
}
.cvip-overlay--open { opacity: 1; }
.cvip-overlay-card {
  width: 100%; max-width: 440px; background: #15151f;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6); overflow: hidden;
  transform: translateY(14px) scale(0.98); transition: transform 0.22s;
}
.cvip-overlay--open .cvip-overlay-card { transform: translateY(0) scale(1); }
.cvip-overlay-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(135deg, rgba(42,171,238,0.12), transparent);
}
.cvip-overlay-title { font-size: 15px; font-weight: 700; color: #e8e8f0; }
.cvip-overlay-close {
  background: rgba(255,255,255,0.06); border: none; color: #9a9ab0;
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.cvip-overlay-close:hover { background: rgba(233,69,96,0.15); color: #e94560; }
.cvip-overlay-body { padding: 14px 18px 18px; max-height: 70vh; overflow-y: auto; }
.cvip-ov-loading, .cvip-ov-empty { padding: 36px 10px; text-align: center; color: #888; font-size: 14px; }

/* ─── Saved-thread list ─── */
.cvip-bm-list { display: flex; flex-direction: column; gap: 10px; }
.cvip-bm-item { display: flex; align-items: center; gap: 10px; }
.cvip-bm-link {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 8px; border-radius: 10px; text-decoration: none;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s, border-color 0.15s;
}
.cvip-bm-link:hover { background: rgba(115,189,247,0.06); border-color: rgba(115,189,247,0.25); text-decoration: none; }
.cvip-bm-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #0f1420; }
.cvip-bm-thumb--ph { background: linear-gradient(135deg, #1a1a2e, #394456); }
.cvip-bm-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cvip-bm-title {
  font-size: 14px; font-weight: 600; color: #e8e8f0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cvip-bm-meta { font-size: 12px; color: #8a8aa0; }
.cvip-bm-remove {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: #9a9ab0; font-size: 13px; line-height: 1; transition: background 0.15s, color 0.15s;
}
.cvip-bm-remove:hover { background: rgba(233,69,96,0.15); color: #e94560; border-color: rgba(233,69,96,0.3); }

/* ─── Member profile card ─── */
.cvip-profile-link { cursor: pointer; }
.cvip-comment-author.cvip-profile-link:hover { text-decoration: underline; }
.cvip-online-user.cvip-profile-link:hover { background: rgba(115,189,247,0.1); }
.cvip-pf-head { display: flex; gap: 14px; align-items: center; }
.cvip-pf-avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cvip-pf-avatar--ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #394456, #1a1a2e); color: #73bdf7;
  font-size: 28px; font-weight: 700;
}
.cvip-pf-ident { min-width: 0; }
.cvip-pf-name { font-size: 18px; font-weight: 700; color: #e8e8f0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cvip-pf-username { font-size: 13px; color: #73bdf7; margin-top: 2px; }
.cvip-pf-join { font-size: 12px; color: #8a8aa0; margin-top: 3px; }
.cvip-pf-bio {
  margin-top: 14px; padding: 11px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  font-size: 13px; color: #cbd5e1; line-height: 1.6; word-break: break-word;
}
.cvip-pf-stats { display: flex; gap: 10px; margin-top: 14px; }
.cvip-pf-stat {
  flex: 1; text-align: center; padding: 12px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
}
.cvip-pf-stat-num { display: block; font-size: 20px; font-weight: 800; color: #73bdf7; }
.cvip-pf-stat-label { display: block; font-size: 11px; color: #8a8aa0; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }
.cvip-pf-section { margin: 18px 0 10px; font-size: 13px; font-weight: 700; color: #e8e8f0; }
.cvip-pf-acts { display: flex; flex-direction: column; gap: 8px; }
.cvip-pf-act {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s, border-color 0.15s;
}
.cvip-pf-act:hover { background: rgba(115,189,247,0.06); border-color: rgba(115,189,247,0.25); text-decoration: none; }
.cvip-pf-act-thread { font-size: 13px; font-weight: 600; color: #73bdf7; }
.cvip-pf-act-snippet {
  font-size: 13px; color: #cbd5e1; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cvip-pf-act-time { font-size: 11px; color: #666; }
.cvip-pf-noacts { margin-top: 10px; padding: 20px; text-align: center; color: #666; font-size: 13px; }

@media (max-width: 600px) {
  .cvip-overlay { padding: 4vh 10px 10px; }
  .cvip-overlay-card { max-width: 100%; }
}

/* ═══════════ REVIEWS ═══════════ */
/* ─── Review / Star Rating System ─── */
.cvip-reviews { margin-top: 24px; }
.cvip-reviews .block-header { padding: 12px 16px; }
.cvip-reviews .block-header h3 { font-size: 16px; font-weight: 600; color: #e0e0e0; }

.cvip-reviews-summary { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cvip-reviews-empty-sum { color: #888; font-size: 14px; }
.cvip-reviews-score { display: flex; align-items: center; gap: 16px; }
.cvip-reviews-avg { font-size: 40px; font-weight: 700; color: #ffb400; line-height: 1; }
.cvip-reviews-score-right { display: flex; flex-direction: column; gap: 4px; }
.cvip-reviews-count { font-size: 13px; color: #888; }

/* Fractional star bar: grey row underneath, gold row clipped to the score width on top */
.cvip-stars { position: relative; display: inline-block; line-height: 0; white-space: nowrap; }
.cvip-stars svg { width: 18px; height: 18px; display: inline-block; }
.cvip-stars-empty svg { fill: rgba(255,255,255,0.15); }
.cvip-stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; }
.cvip-stars-fill svg { fill: #ffb400; }

/* Star picker (input) */
.cvip-review-form { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cvip-review-form-title { font-size: 14px; font-weight: 600; color: #e0e0e0; margin-bottom: 8px; }
.cvip-star-input { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.cvip-star-pick { cursor: pointer; line-height: 0; }
.cvip-star-pick svg { width: 28px; height: 28px; fill: rgba(255,255,255,0.18); transition: fill 0.12s ease, transform 0.12s ease; }
.cvip-star-pick:hover svg { transform: scale(1.12); }
.cvip-star-pick--hover svg, .cvip-star-pick--on svg { fill: #ffb400; }
.cvip-star-hint { font-size: 13px; color: #888; margin-left: 8px; }
.cvip-review-input {
  width: 100%; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1); color: #e0e0e0;
  padding: 10px 14px; border-radius: 6px; font-size: 14px; resize: vertical; font-family: inherit;
}
.cvip-review-input:focus { border-color: #73bdf7; outline: none; }
.cvip-review-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Review list */
.cvip-review-item { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cvip-review-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cvip-review-item-head .cvip-avatar,
.cvip-review-item-head .cvip-avatar--default { width: 28px; height: 28px; font-size: 12px; flex-shrink: 0; }
.cvip-review-item-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cvip-review-author { font-weight: 600; font-size: 13px; color: #73bdf7; }
.cvip-review-time { font-size: 12px; color: #666; }
.cvip-review-del { font-size: 12px; color: #666; cursor: pointer; flex-shrink: 0; align-self: flex-start; }
.cvip-review-del:hover { color: #e94560; text-decoration: none; }
.cvip-review-item-body { font-size: 14px; line-height: 1.6; color: #cfd2da; word-break: break-word; padding-left: 38px; }

/* =================================================================== */
/* MOBILE RESPONSIVE FIXES - toàn site                                 */
/* =================================================================== */

/* ----- Tablet (<=1024px) ----- */
@media (max-width: 1024px) {
  .p-body-inner, .p-body-main, .p-body-pageContent { padding-left: 10px !important; padding-right: 10px !important; }
  .block-container { margin-left: 0 !important; margin-right: 0 !important; }
}

/* ----- Mobile phones (<=768px) ----- */
@media (max-width: 768px) {
  html { font-size: 15px; }
  body { overflow-x: hidden; }

  /* Header mobile — gọn, chừa chỗ cho hamburger button bên trái */
  .p-header { padding: 8px 10px !important; }
  .p-header-content {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding-left: 60px !important;
    overflow: hidden;
  }
  .p-header-logo img { max-height: 30px !important; }
  .p-header-logo {
    max-width: calc(100vw - 180px) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto !important;
    min-width: 0;
  }
  .p-navSticky, .p-nav { padding: 0 !important; }

  /* p-navEl--search là ICON BUTTON (không phải input) — không stretch! */
  .p-navEl--search,
  .p-navEl--menuTrigger,
  .p-navEl {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
  }
  .p-navEl--search a,
  .p-navEl a {
    padding: 6px 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Nav opposite (icons bên phải header) - gọn gàng */
  .p-nav-opposite {
    display: flex !important;
    gap: 2px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }
  .p-nav-opposite .p-navEl {
    padding: 0 !important;
  }

  /* Toggle sidebar - button nhỏ gọn */
  .uix-toggleSidebar, .p-nav-opposite .button {
    padding: 6px 10px !important;
    font-size: 13px !important;
    min-width: auto !important;
  }
  .uix-toggleSidebar span, .uix-toggleSidebar .uix-icon ~ * {
    display: none !important;  /* chỉ hiện icon */
  }

  /* Nav tabs */
  .p-nav-list { font-size: 14px; }
  .p-nav-list .p-navEl > a { padding: 10px 12px !important; }

  /* Account menu + search icon - lại gần nhau */
  .p-account, .p-navgroup, .p-nav-opposite { gap: 4px !important; }

  /* Content area */
  .block-row { padding: 10px 12px !important; }
  .block-outer, .block-header, .block-footer { padding: 8px 12px !important; }
  .block-body { padding: 0 !important; }

  /* Thread list cards */
  .structItem {
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .structItem-cell { padding: 4px 0 !important; }
  .structItem-cell--icon {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }
  .structItem-cell--icon .avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
  .structItem-cell--meta, .structItem-cell--latest {
    text-align: left !important;
    font-size: 12px;
    color: #888;
  }
  .structItem-title { font-size: 15px !important; line-height: 1.3 !important; }
  .structItem-minor { font-size: 12px !important; }

  /* Forum list */
  .node--category .node-title { font-size: 16px !important; }
  .node--forum .node-title a { font-size: 14px !important; }
  .node-description { font-size: 12px !important; line-height: 1.5; }
  .node-stats { font-size: 11px !important; }
  .node-extra { display: none !important; } /* ẩn "last post" bên phải */

  /* Thread view - post card */
  .message { padding: 10px !important; }
  .message-cell { padding: 6px 0 !important; }
  .message-userDetails { font-size: 12px; }
  .message-user { gap: 6px; }
  .message-avatar img { width: 40px !important; height: 40px !important; }
  .message-body { font-size: 15px; line-height: 1.6; word-wrap: break-word; }
  .message-attribution { font-size: 11px; padding: 4px 8px; }

  /* bbWrapper (post content) - responsive */
  .bbWrapper { font-size: 15px; line-height: 1.7; word-break: break-word; }
  .bbWrapper img, .bbImage, .message-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
  }
  .bbMediaWrapper, .bbMediaJustifier { max-width: 100% !important; }
  .bbWrapper iframe, .bbWrapper video { max-width: 100% !important; height: auto !important; }

  /* Tables responsive - cho mobile scroll ngang */
  .message-body table, .bbWrapper table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    white-space: nowrap;
  }

  /* Pagination mobile */
  .pageNav-main .pageNav-page { padding: 4px 8px !important; font-size: 13px; }

  /* Form inputs mobile */
  input[type="text"], input[type="password"], input[type="email"], input[type="search"],
  textarea, select {
    font-size: 16px !important; /* tránh iOS auto-zoom */
  }

  /* UIX left sidebar nav (categories) - drawer slide từ trái */
  /* Dùng class riêng .cvip-nav-open để tránh conflict với UIX's sidebarNav--active */
  .uix_sidebarNav,
  .uix_sidebarNav .uix_sidebarNavList,
  .uix_sidebarNav__inner {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 82vw !important;
    max-width: 320px !important;
    height: 100vh !important;
    z-index: 9998 !important;
    overflow-y: auto !important;
    background: #13131f !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    padding: 60px 12px 20px !important;
    visibility: hidden !important;
  }
  html.cvip-nav-open .uix_sidebarNav,
  html.cvip-nav-open .uix_sidebarNav__inner,
  html.cvip-nav-open .uix_sidebarNav .uix_sidebarNavList,
  /* Class .cvip-is-open add vào element qua JS - selector chuyên biệt cao hơn */
  .uix_sidebarNav.cvip-is-open,
  .uix_sidebarNav__inner.cvip-is-open,
  .uix_sidebarInner.cvip-is-open,
  .p-body-sidebar.cvip-is-open,
  aside.p-body-sidebar.cvip-is-open {
    transform: translateX(0) !important;
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Overlay dark khi sidebar mở */
  html.cvip-nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9997;
    backdrop-filter: blur(3px);
  }

  /* HIDE các nút hamburger built-in của UIX + XenForo để tránh trùng */
  .uix_sidebarNav--trigger,
  .uix_sidebarTrigger,
  .uix_sidebarTrigger__component,
  .p-nav-menuTrigger,
  button[class*="sidebarNav--trigger"],
  button[class*="p-nav-menuTrigger"] {
    display: none !important;
  }

  /* Floating hamburger button - LUÔN ở góc TRÁI (không nhảy) */
  #cvip-nav-toggle {
    display: flex !important;
    position: fixed !important;
    top: 70px !important;
    left: 12px !important;
    right: auto !important;
    z-index: 9999 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #22d3ee, #a855f7) !important;
    border: none !important;
    color: #0a0a0f !important;
    cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(34,211,238,0.4) !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s !important;
    padding: 0 !important;
  }
  #cvip-nav-toggle:hover { transform: scale(1.05); }
  #cvip-nav-toggle svg { width: 22px !important; height: 22px !important; }

  /* Khi sidebar MỞ: nút sang trái cạnh sidebar + đổi màu đỏ (close) */
  html.cvip-nav-open #cvip-nav-toggle {
    left: calc(82vw - 55px) !important;
    background: linear-gradient(135deg, #ef4444, #f97316) !important;
    box-shadow: 0 4px 16px rgba(239,68,68,0.4) !important;
  }

  /* Icon toggle: đóng/mở */
  #cvip-nav-toggle .ic-open { display: block !important; }
  #cvip-nav-toggle .ic-close { display: none !important; }
  html.cvip-nav-open #cvip-nav-toggle .ic-open { display: none !important; }
  html.cvip-nav-open #cvip-nav-toggle .ic-close { display: block !important; }

  /* Main content: KHÔNG bị squeeze */
  .p-body-main.p-body-main--withSidebar,
  .p-body-main--withSidebar,
  .p-body-main,
  .p-body-pageContent {
    margin-left: 0 !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    width: 100% !important;
  }

  /* Footer mobile */
  .p-footer-row { flex-direction: column !important; gap: 10px; }
  .p-footer-copyright { text-align: center; font-size: 12px; }

  /* Breadcrumb mobile */
  .p-breadcrumbs { font-size: 12px !important; padding: 6px 10px !important; overflow-x: auto; white-space: nowrap; }

  /* Modals / overlays */
  .overlay-container, .overlay { max-width: 95vw !important; width: 95vw !important; }
}

/* ----- Small phones (<=480px) ----- */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .p-header-logo img { max-height: 30px !important; }
  .p-header-logo { max-width: 50vw; font-size: 14px; }

  /* Hide less critical icons on very small screens */
  .notice--primary, .notice--accent { padding: 8px 10px !important; font-size: 13px; }

  /* Thread card: hide secondary info */
  .structItem-cell--latest { display: none !important; }

  /* Message attribution - compact */
  .message-attribution-opposite { display: none !important; }

  /* Smaller buttons */
  .button, .p-nav-list .p-navEl > a { font-size: 13px !important; padding: 8px 10px !important; }
}

/* Floating Telegram button - mobile tweak */
@media (max-width: 768px) {
  .cvip-float {
    bottom: 16px !important;
    right: 16px !important;
    z-index: 9500 !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
  }
  .cvip-fab-main {
    width: 54px !important;
    height: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .cvip-float-menu {
    right: 10px !important;
    left: auto !important;
    max-width: calc(100vw - 20px) !important;
    bottom: 70px !important;
  }
}

/* Dark theme image placeholder - khi ảnh die */
img.broken,
img[src*="placeholder=1"] {
  background: linear-gradient(135deg, #1c1c2e, #13131f);
  object-fit: contain;
  min-height: 100px;
  opacity: 0.7;
}

/* Smooth loading placeholder */
img[loading="lazy"]:not([data-loaded]) {
  background: linear-gradient(135deg, #1c1c2e 25%, #22222e 50%, #1c1c2e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Scrollbar đẹp hơn (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a4e; }

/* ============================================================ */
/* Admin modal: nút Save LUÔN sticky ở đáy, modal scroll bên trong */
/* ============================================================ */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.75) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  padding: 20px !important;
  overflow-y: auto !important;
}
.modal-overlay .modal {
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  margin: auto;
  background: #13131f !important;
  border-radius: 12px !important;
  border: 1px solid #2a2a3e !important;
  overflow: hidden !important;
  position: relative !important;
}
.modal-overlay .modal h3 {
  padding: 20px 24px 12px !important;
  margin: 0 !important;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(34,211,238,0.03);
}
.modal-overlay .modal .modal-meta {
  padding: 10px 24px !important;
  margin: 0 !important;
  flex-shrink: 0;
  font-size: 12px;
  color: #9a9ab0;
}
/* Phần giữa modal cuộn được */
.modal-overlay .modal > *:not(h3):not(.modal-actions):not(.modal-meta) {
  overflow-y: auto;
  padding: 0 24px !important;
}
.modal-overlay .modal .form-group,
.modal-overlay .modal .form-row {
  padding: 0 24px !important;
}
/* Nút Save/Hủy LUÔN hiện ở đáy, không bị khuất */
.modal-overlay .modal .modal-actions {
  flex-shrink: 0 !important;
  padding: 16px 24px !important;
  background: #1c1c2e !important;
  border-top: 1px solid #2a2a3e !important;
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  position: sticky !important;
  bottom: 0 !important;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.modal-overlay .modal .modal-actions .btn {
  min-width: 100px;
  padding: 10px 20px !important;
  font-weight: 600;
}
.modal-overlay .modal .modal-actions .btn-primary {
  background: linear-gradient(135deg, #22d3ee, #a855f7) !important;
  color: #0a0a0f !important;
  border: none !important;
}

/* Content editor trong modal */
.content-editor-rich {
  background: #0a0a0f !important;
  border: 1px solid #2a2a3e !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
  color: #e8e8f0;
  font-size: 14px;
  line-height: 1.6;
}
.content-editor-rich:empty::before {
  content: 'Nhập nội dung...';
  color: #64748b;
}
.content-editor-rich:focus {
  outline: none;
  border-color: #22d3ee !important;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}

/* ============================================================ */
/* DISABLED: Widget "Đang trực tuyến" phía user - không cần hiện */
/* Admin xem online users ở /admin panel riêng                   */
/* ============================================================ */
.cvip-online-block,
.block.cvip-online-block {
  display: none !important;
}

/* ============================================================ */
/* FIX CHỒNG LAYOUT: Mobile stack VERTICAL (sidebar xuống dưới) */
/* ============================================================ */
@media (max-width: 900px) {
  /* XenForo layout - buộc single column */
  .p-body-content, .p-body-inner, .p-body-pageContent,
  .block-container, .block-outer, .p-body-main {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Sidebar right / widgets panel - xuống dưới main */
  .p-body-sideNav, .p-body-sidebar--opposite,
  .p-body-sideNavInner, aside.p-body-sidebar,
  .widget-area, .sidebar-right {
    width: 100% !important;
    float: none !important;
    position: static !important;
    margin-top: 20px !important;
    clear: both !important;
    display: block !important;
  }

  /* Any 2-column grid - stack */
  [class*="col-"]:not([class*="col-xs-12"]) {
    width: 100% !important;
    float: none !important;
  }

  /* Flex rows wrap */
  .block-row, .block, .structItemContainer,
  .p-body-pageContent > * {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    box-sizing: border-box !important;
  }

  /* Grid 2 cols -> 1 col */
  .grid-2, .grid-3, .grid-4,
  [style*="grid-template-columns"] {
    display: block !important;
  }

  /* Table of cards -> block */
  .structItemContainer-group[data-widget-id],
  .structItemContainer-group {
    display: block !important;
    width: 100% !important;
  }

  /* Position fix - không overflow */
  body { position: relative; overflow-x: hidden !important; }
  .p-body { overflow-x: hidden !important; }

  /* Floating widgets - đảm bảo không đè main */
  .cvip-trending, .cvip-popular, .cvip-most-viewed,
  .trending-widget, .popular-widget {
    position: static !important;
    width: 100% !important;
    margin-top: 16px !important;
    clear: both;
  }
}

/* Phones (<=600px) - thêm padding bớt */
@media (max-width: 600px) {
  .p-body-pageContent, .block-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* ============================================================ */
/* XenPorta 2 + UIX theme - FIX layout chồng trên mobile       */
/* ============================================================ */
@media (max-width: 900px) {
  /* Portal 2 columns -> stack vertical */
  .porta-articles-above-split,
  .porta-articles-below-split,
  .porta-widgets-split,
  .porta-articles-above-full,
  .porta-articles-below-full {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    clear: both !important;
  }

  /* Container flex -> block */
  .porta-article-container {
    display: block !important;
    flex-direction: column !important;
  }

  /* Masonry: 2-3 cols -> 1 col */
  .porta-masonry {
    column-count: 1 !important;
    columns: 1 !important;
    -webkit-column-count: 1 !important;
    -moz-column-count: 1 !important;
  }
  .porta-article-item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Widget sidebar - đặt dưới + 1 cột */
  .porta-widgets-split {
    margin-top: 16px !important;
  }
  .porta-widgets-split .block {
    width: 100% !important;
    margin-bottom: 12px !important;
  }

  /* (BLOCK CŨ ĐÃ XÓA — gây conflict với hamburger logic ở trên) */
  .uix_sidebar--scroller {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Giấu widget phụ chiếm chỗ trên mobile (admin xem /admin) */
  .uix_welcomeSection,
  .porta-copyright,
  .uix_extendedFooterRow {
    display: none !important;
  }

  /* Message/thread view cards */
  .message-cell--main, .message-cell--user {
    display: block !important;
    width: 100% !important;
  }
}

/* Phones (<=600px) - masonry 1 col chắc chắn */
@media (max-width: 600px) {
  .porta-masonry,
  [class*="porta-masonry"] {
    column-count: 1 !important;
    columns: 1 !important;
  }
  .porta-article-item img {
    max-width: 100% !important;
    height: auto !important;
  }
  .porta-article-header,
  .porta-header-text {
    font-size: 14px !important;
    line-height: 1.35 !important;
  }
}

/* ============================================================ */
/* THREAD VIEW mobile - sidebar RIGHT xuống dưới, không overlap */
/* ============================================================ */
@media (max-width: 900px) {
  /* Main content full width (bỏ "withSidebar") */
  .p-body-main.p-body-main--withSidebar,
  .p-body-main--withSidebar {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
    float: none !important;
    display: block !important;
  }

  /* Right sidebar - xuống dưới, static position */
  .p-body-sidebar:not(.uix_sidebarNav) {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 20px !important;
    margin-left: 0 !important;
    float: none !important;
    clear: both !important;
    display: block !important;
    transform: none !important;
    height: auto !important;
  }

  /* (BLOCK CŨ ĐÃ XÓA — gây conflict với hamburger logic) */

  /* Block opposite (right side of post attribution) - stack */
  .block-outer-opposite,
  .message-attribution-opposite,
  .p-footer-row-opposite,
  .p-nav-opposite {
    float: none !important;
    width: 100% !important;
    text-align: left !important;
    margin-top: 8px !important;
    display: block !important;
  }

  /* Message attribution: 2 cột -> stack */
  .message-attribution {
    flex-wrap: wrap !important;
  }
  .message-attribution-main,
  .message-attribution-user {
    width: 100% !important;
  }

  /* Thread view: body-content wrapper không grid */
  .p-body-content {
    display: block !important;
  }
}

/* Giữ CSS cũ cho trường hợp admin dùng (nếu cần bật lại thì xóa display:none ở trên) */
.cvip-online-block {
  margin-bottom: 12px !important;
}
.cvip-online-list {
  max-height: 180px !important;
  overflow-y: auto !important;
  padding: 8px 12px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}
.cvip-online-user {
  padding: 4px 10px !important;
  background: rgba(34,211,238,0.08);
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

/* Mobile: online widget siêu compact (chỉ 1 dòng tổng) */
@media (max-width: 768px) {
  .cvip-online-block {
    position: relative;
    margin-bottom: 8px !important;
    background: #1c1c2e !important;
    border-radius: 10px !important;
    border: 1px solid #2a2a3e;
  }
  .cvip-online-block .block-header {
    padding: 8px 12px !important;
    cursor: pointer;
  }
  .cvip-online-block .block-header h3 {
    font-size: 13px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .cvip-online-block .block-header h3::after {
    content: '▼';
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
  }
  .cvip-online-block.collapsed .block-header h3::after {
    transform: rotate(-90deg);
  }
  .cvip-online-list {
    max-height: 120px !important;
    padding: 8px !important;
  }
  .cvip-online-block.collapsed .cvip-online-list {
    display: none !important;
  }
  .cvip-online-user {
    padding: 3px 8px !important;
    font-size: 11px !important;
  }
  .cvip-online-name {
    font-size: 11px !important;
  }

  /* Sidebar mobile - padding nhỏ hơn, các block compact */
  .p-body-sidebar .block {
    margin-bottom: 10px !important;
  }
  .p-body-sidebar .block-header {
    padding: 10px 12px !important;
  }
  .p-body-sidebar .block-header h3 {
    font-size: 13px !important;
    margin: 0 !important;
  }
  .p-body-sidebar .block-body {
    padding: 10px 12px !important;
  }
}
