/* site/css/site.css
   Toàn bộ class ở đây đặt tiền tố "vb-" (video blog) để không trùng với css/js bên admin.
*/
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0f1420; color: #e5e9f2;
}

.vb-header {
  position: sticky; top: 0; z-index: 40; min-height: 56px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: nowrap;
  padding: 10px 16px; background: rgba(15,20,32,.95);
  border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px);
}
.vb-brand { flex-shrink: 0; }
.vb-header-actions { flex-shrink: 0; }
.vb-brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.vb-brand strong { font-weight: 600; color: #fff; }
.vb-header-actions { display: flex; align-items: center; gap: 14px; }
.vb-nav-link { font-size: 13px; color: #7dd3fc; text-decoration: none; font-weight: 500; }
.vb-nav-link:hover { color: #fff; text-decoration: underline; }
.vb-admin-link { font-size: 12px; color: #cbd5e1; text-decoration: none; display: flex; align-items: center; gap: 5px; }
.vb-admin-link:hover { color: #fff; }

.vb-container { max-width: 1024px; margin: 0 auto; padding: 12px 20px 32px; }
.vb-page-title { font-size: 24px; font-weight: 600; margin: 0 0 4px; color: #fff; }
.vb-page-sub { color: #94a3b8; font-size: 13px; margin: 0 0 24px; }
.vb-filter-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.vb-filter-row { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.vb-filter-bar .vb-tag-pill { text-decoration: none; }
.vb-filter-bar .vb-tag-pill:hover { background: rgba(56,189,248,.3); }

.vb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.vb-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: border-color .2s ease;
  content-visibility: auto; contain-intrinsic-size: auto 280px;
}
.vb-card:hover { border-color: rgba(56,189,248,.5); }
.vb-card__thumb { aspect-ratio: 16/9; background: #1e293b; position: relative; overflow: hidden; }
.vb-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.vb-card:hover .vb-card__thumb img { transform: scale(1.06); }
.vb-card__thumb-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #475569; }
.vb-card__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity .2s ease;
}
.vb-card:hover .vb-card__play { opacity: 1; }
.vb-card__body { padding: 12px; }
.vb-card__title { font-size: 13.5px; font-weight: 500; margin: 0 0 8px; line-height: 1.4; color: #f1f5f9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vb-card__cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.vb-tag-pill { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: rgba(56,189,248,.15); color: #7dd3fc; text-decoration: none; display: inline-block; }
a.vb-tag-pill:hover { background: rgba(56,189,248,.3); }
.vb-tag-pill-alt { background: rgba(255,255,255,.08); color: #cbd5e1; }
a.vb-tag-pill-alt:hover { background: rgba(255,255,255,.16); }
.vb-card__meta { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vb-card__meta-item { display: inline-flex; align-items: center; gap: 4px; }
.vb-empty { color: #64748b; font-size: 13px; }

.vb-back-link { background: none; border: none; color: #94a3b8; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 0; margin-bottom: 16px; }
.vb-back-link:hover { color: #fff; }

.vb-detail-title { font-size: 22px; font-weight: 600; margin: 0 0 12px; color: #fff; }
.vb-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.vb-detail-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 16px; }
.vb-detail-stats .vb-updated,
.vb-detail-meta .vb-updated { margin-left: 0; font-size: 11px; color: #64748b; display: inline-flex; align-items: center; gap: 4px; }

.vb-player { aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; position: relative; }
.vb-player iframe { width: 100%; height: 100%; border: 0; }
.vb-player-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 13px; }

/* TVC pre-roll */
.vb-tvc { position: absolute; inset: 0; background: #000; }
.vb-tvc-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vb-tvc-hit { position: absolute; inset: 0; z-index: 2; }
/* Nhãn Quảng cáo — góc trái trên */
.vb-tvc-label {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  font-size: 11px; color: #fff; background: rgba(225,29,72,.92);
  padding: 4px 10px; border-radius: 4px; font-weight: 700; letter-spacing: .03em;
  pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
/* Nút Bỏ qua — góc phải dưới */
.vb-tvc-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 10px 12px; background: linear-gradient(transparent, rgba(0,0,0,.7));
  pointer-events: none;
}
.vb-tvc-skip {
  pointer-events: auto; border: 0; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 7px 14px;
  background: rgba(255,255,255,.94); color: #0f172a;
}
.vb-tvc-skip:disabled { opacity: .55; cursor: not-allowed; }
.vb-tvc-skip:not(:disabled):hover { background: #fff; }
.vb-tvc-tap {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer;
  background: rgba(0,0,0,.55);
  color: #fff; border: 0; width: 100%;
  font-size: 15px; font-weight: 600;
}
.vb-tvc-tap span {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.95); color: #0f172a;
  padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.vb-tvc-tap small { opacity: .85; font-size: 12px; font-weight: 500; }


.vb-server-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.vb-server-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  flex: 1 1 auto;
}
.vb-server-btn {
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vb-server-btn:hover:not(:disabled) { border-color: #38bdf8; }
.vb-server-btn.vb-active { background: #0284c7; border-color: #0284c7; color: #fff; }
.vb-server-btn:disabled { opacity: .3; cursor: not-allowed; }
.vb-like-btn { margin-left: auto; }


.vb-detail-content { font-size: 14px; line-height: 1.7; color: #cbd5e1; }
.vb-detail-content p { margin: 0 0 0.6em; }
.vb-detail-content a { color: #38bdf8; text-decoration: none; }
.vb-detail-content a:hover { text-decoration: underline; }
.vb-detail-content em { font-style: italic; }
.vb-detail-content strong { font-weight: 600; color: #e2e8f0; }

.vb-hidden { display: none !important; }


/* Phân trang */
.vb-pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 28px; padding-top: 8px;
}
.vb-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04); color: #cbd5e1;
  font-size: 13px; text-decoration: none; cursor: pointer;
}
a.vb-page-btn:hover { border-color: #38bdf8; color: #fff; background: rgba(56,189,248,.12); }
.vb-page-current {
  background: #0284c7; border-color: #0284c7; color: #fff; font-weight: 600; cursor: default;
}
.vb-page-disabled { opacity: .35; cursor: not-allowed; }
.vb-page-ellipsis { color: #64748b; padding: 0 4px; font-size: 13px; }
.vb-page-count { color: #64748b; font-size: 12px; }

/* Nút + xem thêm tag/chuyên mục */
.vb-tag-more {
  font-weight: 600; text-align: center; white-space: nowrap;
  background: rgba(56,189,248,.25) !important; color: #e0f2fe !important;
}
.vb-tag-more:hover { background: rgba(56,189,248,.4) !important; }
a.vb-tag-pill-alt.vb-tag-more {
  background: rgba(255,255,255,.12) !important; color: #e2e8f0 !important;
}
a.vb-tag-pill-alt.vb-tag-more:hover { background: rgba(255,255,255,.2) !important; }

/* Danh sách chuyên mục / thẻ */
.vb-term-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
}
.vb-term-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: #e5e9f2; text-decoration: none; font-size: 13.5px;
  transition: border-color .15s ease, background .15s ease;
}
.vb-term-item:hover { border-color: rgba(56,189,248,.45); background: rgba(56,189,248,.08); }
.vb-term-name { font-weight: 500; }
.vb-term-arrow { color: #64748b; font-size: 12px; }
.vb-term-item:hover .vb-term-arrow { color: #7dd3fc; }

/* Video liên quan */
.vb-related { margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.vb-related-title { font-size: 18px; font-weight: 600; color: #fff; margin: 0 0 16px; }


/* Search header */
.vb-search-form {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0; max-width: 360px;
  margin: 0; height: 36px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; overflow: hidden;
}
.vb-search-input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: #e2e8f0;
  padding: 0 4px 0 14px; font-size: 13px; outline: none; height: 100%;
  -webkit-appearance: none; appearance: none;
}
.vb-search-input::placeholder { color: #64748b; }
.vb-search-btn {
  flex-shrink: 0; border: 0; background: transparent; color: #94a3b8;
  padding: 0 12px; height: 100%; cursor: pointer; display: inline-flex; align-items: center;
}
.vb-search-btn:hover { color: #38bdf8; }

/* Footer + top search */
.vb-footer {
  margin-top: 40px; border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25); padding: 22px 16px 28px;
}
.vb-footer-inner { max-width: 1100px; margin: 0 auto; }
.vb-top-search-title {
  font-size: 13px; font-weight: 600; color: #94a3b8; margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .04em;
}
.vb-top-search-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.vb-top-search-item {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-size: 12.5px; color: #cbd5e1;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: 5px 10px 5px 6px;
}
.vb-top-search-item:hover { color: #fff; border-color: rgba(56,189,248,.4); background: rgba(56,189,248,.12); }
.vb-top-search-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700;
  background: rgba(56,189,248,.2); color: #7dd3fc;
}
.vb-footer-copy {
  max-width: 1100px; margin: 18px auto 0; font-size: 12px; color: #64748b; text-align: center;
}

@media (max-width: 720px) {
  .vb-header { flex-wrap: wrap; row-gap: 10px; }
  .vb-search-form {
    order: 3; flex: 1 1 100%; max-width: none; width: 100%;
    margin: 0;
  }
  .vb-brand { order: 1; }
  .vb-header-actions { order: 2; margin-left: auto; }
}


/* Ads */
/* ===== Ads — PC ~25% ngang (như demo), mobile gần full ===== */
.vb-ad {
  text-align: center;
  position: relative;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.vb-ad-body {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  display: block;
}

/* Mobile: gần full; PC: ~25vw / max 420px — nhiều khoảng trống quanh */
.vb-ad-header,
.vb-ad-player,
.vb-ad-footer {
  padding: 2px 0 8px;
  margin: 0 auto 0;
  display: block;
  width: 72%;
  max-width: 72%;
  box-sizing: border-box;
  background: transparent !important;
  border: 0 !important;
  position: relative;
  z-index: 1; /* dưới .vb-header sticky */
  overflow: visible;
  isolation: isolate;
  line-height: 0;
}
.vb-ad-header { margin-bottom: 0; }
.vb-ad-player { margin-top: 4px; margin-bottom: 6px; }
@media screen and (min-width: 768px) {
  .vb-ad-header,
  .vb-ad-player,
  .vb-ad-footer {
    width: 25vw;
    max-width: 420px;
    min-width: 300px;
  }
}

.vb-ad-banners {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.vb-ad-item {
  display: block;
  line-height: 0;
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.vb-ad-item img,
.vb-ad-banners > img,
.vb-ad-body > a > img,
.vb-ad-body > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 38px;
  object-fit: fill;
  margin: 0 auto;
  border-radius: 0;
}
@media screen and (min-width: 768px) {
  .vb-ad-item img,
  .vb-ad-banners > img,
  .vb-ad-body > a > img,
  .vb-ad-body > img {
    max-height: 52px;
  }
}

.vb-ad-square {
  display: block;
  max-width: 220px;
  margin: 0 auto;
}
.vb-ad-square img {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
}
@media screen and (min-width: 768px) {
  .vb-ad-square,
  .vb-ad-square img {
    max-width: 286px;
  }
}

.vb-ad-closeable { position: relative; }
.vb-ad-dismiss {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background-color: #fff;
  color: #e11d48;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  /* tránh lệch % + transform cha trên iOS */
  transform: none !important;
  -webkit-transform: none !important;
}
.vb-ad-dismiss:hover { background-color: #f8fafc; color: #be123c; }
@media screen and (min-width: 768px) {
  .vb-ad-dismiss { width: 26px; height: 26px; font-size: 16px; }
}

.vb-ad-body > .vb-ad-dismiss,
.vb-ad-header .vb-ad-dismiss,
.vb-ad-player .vb-ad-dismiss,
.vb-ad-footer .vb-ad-dismiss {
  top: auto;
  bottom: -6px;
  right: -6px;
  transform: none !important;
}

/* Catfish Top — cùng cỡ ngang header */
.vb-ad-catfish-top {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  /* Sát đỉnh màn hình, trên header */
  top: 0;
  z-index: 100;
  background: transparent !important;
  border: 0 !important;
  padding: 4px 0 6px;
  width: 72%;
  max-width: 72%;
  box-sizing: border-box;
  pointer-events: none;
  overflow: visible;
}
@media screen and (min-width: 768px) {
  .vb-ad-catfish-top {
    width: 25vw;
    max-width: 420px;
    min-width: 300px;
  }
}
.vb-ad-catfish-top .vb-ad-body,
.vb-ad-catfish-top .vb-ad-catfish-inner {
  width: 100%;
  margin: 0 auto;
  position: relative;
  pointer-events: auto;
}
.vb-ad-catfish-top .vb-ad-banners { gap: 2px; width: 100%; }
.vb-ad-catfish-top .vb-ad-item { width: 100%; pointer-events: auto; }
.vb-ad-catfish-top .vb-ad-item img {
  width: 100%;
  height: auto;
  max-height: 38px;
  object-fit: fill;
}
@media screen and (min-width: 768px) {
  .vb-ad-catfish-top .vb-ad-item img {
    max-height: 52px;
  }
}
.vb-ad-catfish-top .vb-ad-dismiss {
  top: auto;
  bottom: -6px;
  right: -6px;
  transform: none !important;
  pointer-events: auto;
  z-index: 5;
}

/* Catfish Bottom */
.vb-ad-catfish,
.vb-ad-catfish-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 90;
  background: transparent !important;
  border: 0 !important;
  padding: 0;
  margin: 0;
  width: 72%;
  max-width: 72%;
  box-sizing: border-box;
  pointer-events: none;
  overflow: visible;
  line-height: 0;
}
@media screen and (min-width: 768px) {
  .vb-ad-catfish,
  .vb-ad-catfish-bottom {
    width: 25vw;
    max-width: 420px;
    min-width: 300px;
  }
}
.vb-ad-catfish .vb-ad-body,
.vb-ad-catfish-inner {
  width: 100%;
  margin: 0 auto;
  position: relative;
  pointer-events: auto;
}
.vb-ad-catfish .vb-ad-banners {
  gap: 2px;
  pointer-events: auto;
  width: 100%;
  align-items: stretch;
}
.vb-ad-catfish .vb-ad-item { pointer-events: auto; width: 100%; }
.vb-ad-catfish .vb-ad-item img {
  width: 100%;
  height: auto;
  max-height: 38px;
  object-fit: fill;
}
@media screen and (min-width: 768px) {
  .vb-ad-catfish .vb-ad-item img {
    max-height: 52px;
  }
}
.vb-ad-catfish .vb-ad-dismiss,
.vb-ad-catfish-close {
  top: -6px;
  right: -6px;
  bottom: auto;
  transform: none !important;
  pointer-events: auto;
  z-index: 5;
}

/* Preload */
.vb-ad-preload {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  background: transparent;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  margin: 0 !important;
  transform: none !important;
}
.vb-ad-preload .vb-ad-preload-box {
  pointer-events: auto;
}
.vb-ad-preload.vb-ad-preload-hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.vb-ad-preload-box {
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  max-width: min(220px, 66vw);
  width: auto;
  box-shadow: none;
  pointer-events: auto;
  border-radius: 0;
}
@media screen and (min-width: 768px) {
  .vb-ad-preload-box {
    max-width: 286px;
  }
}
.vb-ad-preload-close,
.vb-ad-preload .vb-ad-dismiss {
  top: -10px;
  right: -10px;
  bottom: auto;
  left: auto;
  transform: none;
  z-index: 6;
}
.vb-ad-preload-inner {
  text-align: center;
  line-height: 0;
}
.vb-ad-preload-inner img,
.vb-ad-preload-inner a img,
.vb-ad-preload-inner .vb-ad-item img {
  width: auto;
  max-width: min(220px, 66vw);
  max-height: min(200px, 42vh);
  height: auto;
  border-radius: 0;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
@media screen and (min-width: 768px) {
  .vb-ad-preload-inner img,
  .vb-ad-preload-inner a img,
  .vb-ad-preload-inner .vb-ad-item img {
    max-width: 286px;
    max-height: 286px;
  }
}
.vb-ad-preload .vb-ad-square {
  max-width: 220px;
  width: auto;
  margin: 0 auto;
}
.vb-ad-preload .vb-ad-square img {
  border-radius: 0;
  object-fit: contain;
  max-width: 220px;
  max-height: 220px;
}
@media screen and (min-width: 768px) {
  .vb-ad-preload .vb-ad-square {
    max-width: 286px;
  }
  .vb-ad-preload .vb-ad-square img {
    max-width: 286px;
    max-height: 286px;
  }
}

/* Chỉ chừa đúng chiều cao catfish — JS cập nhật --vb-catfish-h */
body.vb-has-catfish {
  padding-bottom: var(--vb-catfish-h, 0px);
}

/* Catfish top nằm dưới .vb-header — không padding-top body (tránh header bị “dài”) */
body.vb-has-catfish-top .vb-container {
  padding-top: calc(32px + 8px);
}



/* Footer text links / bạn bè */
.vb-footer-links {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  justify-content: center; align-items: center;
  padding: 8px 4px 4px; font-size: 13px; line-height: 1.5;
}
.vb-footer-links a {
  color: #94a3b8; text-decoration: none;
}
.vb-footer-links a:hover { color: #7dd3fc; text-decoration: underline; }
.vb-footer-links-sep { color: #475569; user-select: none; }
