/*
Theme Name:  VietBestMedia
Theme URI:   https://www.youtube.com/@vietbesttv8376
Author:      VietBestMedia
Author URI:  https://www.vietbestmedia.com
Description: Video-first YouTube channel theme for VietBestMedia. Clean, mobile-first layout with hero, trending, latest, shows, community sections and YouTube auto-import. No other plugins required.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vietbestmedia-theme
Tags:        video, youtube, responsive, mobile-first, dark
*/

/* ── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #0f0f0f;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* ── WRAPPER ─────────────────────────────────────────── */
#vbm-wrap {
  min-height: 100vh;
  padding-bottom: 64px; /* bottom nav space on mobile */
}

/* ── TOP NAV ─────────────────────────────────────────── */
#vbm-nav {
  position: sticky;
  top: 0;
  z-index: 300;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
}
.vbm-logo {
  font-size: 18px;
  font-weight: 800;
  color: #ff3d3d;
  letter-spacing: -0.5px;
  flex: 1;
  white-space: nowrap;
}
.vbm-logo span { color: #ffffff; }
.vbm-logo em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: #555;
  margin-left: 6px;
  letter-spacing: 0;
}
.vbm-top-links { display: flex; gap: 2px; }
.vbm-tl {
  color: #888;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.vbm-tl:hover, .vbm-tl.active { color: #fff; background: rgba(255,255,255,0.08); }
.vbm-tl-live { color: #ff3d3d !important; }
.vbm-tl-live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: #ff3d3d;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  animation: livepulse 1.4s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity:1; } 50% { opacity:.2; } }

/* ── SECTIONS ────────────────────────────────────────── */
.vbm-section {
  padding: 14px 12px 12px;
  background: #111;
  margin-bottom: 3px;
}

/* ── SECTION HEADING ─────────────────────────────────── */
.vbm-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.vbm-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red    { background: #ff3d3d; }
.dot-orange { background: #ff8800; }
.dot-blue   { background: #3d9eff; }
.dot-green  { background: #3dcc70; }
.dot-purple { background: #9944ee; }

/* ── VIDEO CARD ──────────────────────────────────────── */
.vbm-card {
  background: #1c1c1c;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s;
}
.vbm-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* 16:9 thumbnail */
.vbm-thumb {
  display: block;
  position: relative;
  overflow: hidden;
}
.vbm-thumb::before {
  content: '';
  display: block;
  padding-bottom: 56.25%;
}
.vbm-thumb img,
.vbm-thumb .vbm-noimg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.vbm-noimg {
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* play button */
.vbm-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0,0,0,.3);
  transition: opacity .2s;
}
.vbm-play-btn::after {
  content: '';
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: inset 8px 0 0 6px rgba(255,255,255,.7);
}
.vbm-card:hover .vbm-play-btn { opacity: 1; }

/* card text */
.vbm-card-body { padding: 8px 9px 10px; flex: 1; }
.vbm-card-title {
  font-size: 12px;
  font-weight: 500;
  color: #ddd;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.vbm-card:hover .vbm-card-title { color: #fff; }
.vbm-card-big .vbm-card-title { font-size: 14px; }

/* ── HERO ────────────────────────────────────────────── */
.vbm-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vbm-hero-main { grid-row: span 3; }
.vbm-hero-side { display: flex; flex-direction: column; gap: 8px; }

/* ── STANDARD GRID ───────────────────────────────────── */
.vbm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 col default (mobile) */
  gap: 8px;
}

/* ── SHOWS ROW (horizontal scroll) ──────────────────── */
.vbm-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.vbm-row::-webkit-scrollbar { height: 3px; }
.vbm-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.vbm-row-item {
  min-width: 148px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ── TAGS ────────────────────────────────────────────── */
.vbm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.vbm-tag {
  font-size: 11px;
  color: #777;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 4px 11px;
  transition: background .15s, color .15s;
}
.vbm-tag:hover { background: rgba(255,255,255,.1); color: #ccc; }

/* ── LIVE SECTION ────────────────────────────────────── */
.vbm-live-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.vbm-live-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.vbm-live-placeholder {
  padding: 24px;
  text-align: center;
  background: #180000;
  border: 1px solid rgba(255,61,61,.2);
  border-radius: 8px;
  color: #888;
  font-size: 13px;
}
.vbm-live-placeholder a { color: #ff3d3d; }

/* ── EMPTY STATE ─────────────────────────────────────── */
.vbm-empty {
  color: #555;
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* ── FOOTER ──────────────────────────────────────────── */
#vbm-footer {
  background: #0a0a0a;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 24px 16px;
  text-align: center;
  color: #444;
  font-size: 12px;
}
#vbm-footer a { color: #666; margin: 0 8px; }
#vbm-footer a:hover { color: #aaa; }

/* ── MOBILE BOTTOM NAV ───────────────────────────────── */
#vbm-bot-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: #0a0a0a;
  border-top: 1px solid rgba(255,255,255,.07);
  justify-content: space-around;
  align-items: stretch;
  height: 58px;
}
.vbm-bn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #4a4a4a;
  font-size: 9px;
  font-weight: 500;
  flex: 1;
  transition: color .15s;
  padding: 0 4px;
}
.vbm-bn svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vbm-bn:hover, .vbm-bn.active { color: #ff3d3d; }

/* ── ADMIN BAR OFFSET ────────────────────────────────── */
.admin-bar #vbm-nav { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #vbm-nav { top: 46px; }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

/* Tablet 600px+ */
@media (min-width: 600px) {
  .vbm-grid { grid-template-columns: repeat(3, 1fr); }
  .vbm-row-item { min-width: 170px; }
  .vbm-section { padding: 16px 16px 12px; }
}

/* Desktop 960px+ */
@media (min-width: 960px) {
  #vbm-wrap { padding-bottom: 0; }
  .vbm-section { padding: 20px 24px 16px; }
  .vbm-grid { grid-template-columns: repeat(4, 1fr); }
  .vbm-card-title { font-size: 13px; }
  .vbm-card-big .vbm-card-title { font-size: 15px; }
  .vbm-row-item { min-width: 200px; }
}

/* Mobile only */
@media (max-width: 599px) {
  .vbm-top-links { display: none; }
  #vbm-bot-nav   { display: flex; }

  /* hero stacks on mobile */
  .vbm-hero { grid-template-columns: 1fr; }
  .vbm-hero-main { grid-row: auto; }
  .vbm-hero-side {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }
  .vbm-hero-side .vbm-card {
    min-width: 145px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}
