/* ==========================================================================
   VideoHub design tokens (matches the approved Home / Watch mockups)
   ========================================================================== */
:root,
.vh-app[data-theme="light"]{
  --vh-bg:#F5F7F9; --vh-surface:#FFFFFF; --vh-surface-2:#EEF1F4; --vh-border:#E1E6EB;
  --vh-text:#121A22; --vh-muted:#6B7684; --vh-muted-2:#96A0AB;
  --vh-brand:#2F6F5E; --vh-brand-ink:#FFFFFF;
  --vh-ad-bg:#FFF6E7; --vh-ad-border:#E4B975; --vh-ad-text:#8A6116;
  --vh-danger:#E3573C;
  --vh-shadow:0 1px 2px rgba(18,26,34,.06), 0 1px 10px rgba(18,26,34,.04);
  --vh-player-bg:#0B0F14;
}
.vh-app[data-theme="dark"]{
  --vh-bg:#0E1520; --vh-surface:#161F2B; --vh-surface-2:#1D2733; --vh-border:#283443;
  --vh-text:#EAF0F5; --vh-muted:#97A5B3; --vh-muted-2:#6E7C8A;
  --vh-brand:#4C9782; --vh-brand-ink:#08130F;
  --vh-ad-bg:#231A0D; --vh-ad-border:#8A6116; --vh-ad-text:#E4B975;
  --vh-danger:#F0745C;
  --vh-shadow:0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
  --vh-player-bg:#000000;
}

/* Category accent palette — assigned by hashing the category name (see JS),
   so it stays consistent without hardcoding your real categories. */
.vh-cat-0{ --cc:#E3573C; } .vh-cat-1{ --cc:#D98C2B; } .vh-cat-2{ --cc:#6E5BA6; }
.vh-cat-3{ --cc:#2F6F5E; } .vh-cat-4{ --cc:#3E5C8A; } .vh-cat-5{ --cc:#C2445B; }

*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body.vh-body{margin:0;font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;background:var(--vh-bg);color:var(--vh-text);}
.vh-app{min-height:100vh;display:flex;flex-direction:column;background:var(--vh-bg);color:var(--vh-text);}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;cursor:pointer;}

/* ---------------- Header ---------------- */
.vh-topbar{position:sticky;top:0;z-index:40;background:var(--vh-surface);border-bottom:1px solid var(--vh-border);padding:12px 16px 8px;}
.vh-topbar-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;}
.vh-logo{display:flex;align-items:center;gap:8px;font-family:'Sora',sans-serif;font-weight:700;font-size:17px;color:var(--vh-text);}
.vh-logo-mark{width:26px;height:26px;border-radius:8px;background:var(--vh-brand);display:flex;align-items:center;justify-content:center;color:var(--vh-brand-ink);font-size:13px;}
.vh-topbar-icons{display:flex;gap:8px;align-items:center;}
.vh-icon-btn{width:34px;height:34px;border-radius:50%;background:var(--vh-surface-2);border:none;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--vh-text);position:relative;}
.vh-icon-btn .vh-dot{position:absolute;top:6px;right:7px;width:7px;height:7px;border-radius:50%;background:var(--vh-danger);border:1.5px solid var(--vh-surface);}
.vh-searchbar{display:flex;align-items:center;gap:8px;background:var(--vh-surface-2);border:1px solid var(--vh-border);border-radius:12px;padding:9px 12px;margin-bottom:8px;}
.vh-searchbar input{border:none;background:transparent;outline:none;font-size:13px;color:var(--vh-text);width:100%;font-family:'Inter',sans-serif;}
.vh-searchbar input::placeholder{color:var(--vh-muted);}
.vh-tabs{display:flex;gap:8px;overflow-x:auto;padding:2px 0 4px;}
.vh-tab{flex:0 0 auto;padding:6px 14px;border-radius:18px;font-size:12.5px;font-weight:600;color:var(--vh-muted);background:var(--vh-surface-2);white-space:nowrap;}
.vh-tab.is-active{background:var(--vh-brand);color:var(--vh-brand-ink);}

/* ---------------- Content / Sections ---------------- */
.vh-content{padding:14px 16px 90px;flex:1;max-width:1100px;margin:0 auto;width:100%;}
.vh-loading{text-align:center;color:var(--vh-muted);font-size:13px;padding:40px 0;}
.vh-section-head{display:flex;align-items:center;justify-content:space-between;margin:18px 2px 12px;}
.vh-section-title{display:flex;align-items:center;gap:8px;font-family:'Sora',sans-serif;font-weight:700;font-size:15px;}
.vh-section-title .vh-catdot{width:8px;height:8px;border-radius:50%;background:var(--cc,var(--vh-brand));}
.vh-section-more{font-size:12px;font-weight:600;color:var(--vh-brand);white-space:nowrap;}

/* ---------------- Video grid (2-col mobile / more on desktop) ---------------- */
.vh-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:6px;}
.vh-card{cursor:pointer;}
.vh-thumb{position:relative;border-radius:12px;overflow:hidden;aspect-ratio:16/10;background:var(--vh-surface-2);box-shadow:var(--vh-shadow);}
.vh-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.vh-thumb .vh-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center;color:#20272E;font-size:12px;}
.vh-thumb .vh-cat-tag{position:absolute;top:6px;left:6px;font-size:9px;font-weight:700;color:#fff;padding:2px 7px;border-radius:6px;background:var(--cc,var(--vh-brand));}
.vh-thumb video{width:100%;height:100%;object-fit:cover;display:block;}
.vh-card-meta{display:flex;gap:8px;margin-top:8px;}
.vh-avatar{width:24px;height:24px;border-radius:50%;flex:0 0 auto;background:var(--vh-surface-2);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:var(--vh-muted);box-shadow:0 0 0 1px var(--vh-border);}
.vh-card-text{flex:1;min-width:0;}
.vh-card-text .vh-vtitle{font-size:12.5px;font-weight:600;line-height:1.35;color:var(--vh-text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.vh-card-text .vh-vmeta{font-size:11px;color:var(--vh-muted);margin-top:3px;}

/* ---------------- Ad slots ---------------- */
.vh-ad-banner{width:100%;min-height:64px;border-radius:14px;background:var(--vh-ad-bg);border:1px solid var(--vh-ad-border);display:flex;align-items:center;justify-content:center;gap:8px;margin:16px 0;color:var(--vh-ad-text);font-size:12px;font-weight:600;text-align:center;padding:8px;}
.vh-ad-banner .vh-ad-label{font-size:9px;letter-spacing:.06em;text-transform:uppercase;border:1px solid var(--vh-ad-border);padding:2px 6px;border-radius:6px;}
.vh-ad-sticky{position:sticky;bottom:66px;z-index:30;}

/* ---------------- Bottom nav (mobile) ---------------- */
.vh-bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:50;background:var(--vh-surface);border-top:1px solid var(--vh-border);display:flex;justify-content:space-around;padding:9px 6px 12px;}
.vh-nav-item{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;color:var(--vh-muted-2);font-weight:600;}
.vh-nav-item.is-active{color:var(--vh-brand);}
.vh-nav-item .vh-ic{font-size:17px;}
.vh-nav-fab .vh-fab{width:38px;height:38px;border-radius:50%;background:var(--vh-brand);color:var(--vh-brand-ink);display:flex;align-items:center;justify-content:center;font-size:16px;margin-top:-18px;box-shadow:0 4px 10px rgba(47,111,94,.4);}

/* ---------------- Shorts strip (on Home) ---------------- */
.vh-shorts-strip{display:flex;gap:10px;overflow-x:auto;margin-bottom:6px;padding-bottom:2px;}
.vh-short-card{flex:0 0 auto;width:104px;}
.vh-short-thumb{width:104px;height:172px;border-radius:14px;position:relative;overflow:hidden;box-shadow:var(--vh-shadow);background:var(--vh-surface-2);display:flex;align-items:flex-end;}
.vh-short-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.vh-short-thumb .vh-play-sm{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:26px;height:26px;border-radius:50%;background:rgba(255,255,255,.9);display:flex;align-items:center;justify-content:center;font-size:10px;color:#20272E;z-index:2;}
.vh-short-thumb .vh-cap{position:relative;z-index:2;width:100%;background:linear-gradient(to top,rgba(0,0,0,.6),transparent);padding:20px 8px 6px;color:#fff;font-size:10.5px;font-weight:600;line-height:1.3;}

/* ---------------- Watch page ---------------- */
.vh-player-wrap{position:relative;background:var(--vh-player-bg);width:100%;max-width:900px;margin:0 auto;border-radius:0;overflow:hidden;}
.vh-player-wrap video{width:100%;display:block;max-height:60vh;background:#000;}
.vh-back{position:absolute;top:10px;left:10px;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:flex;align-items:center;justify-content:center;font-size:14px;z-index:3;}
.vh-adpill{position:absolute;top:10px;right:10px;background:var(--vh-ad-bg);color:var(--vh-ad-text);border:1px solid var(--vh-ad-border);font-size:9.5px;font-weight:700;padding:3px 9px;border-radius:7px;z-index:3;}
.vh-watch-body{max-width:900px;margin:0 auto;}
.vh-vtitle-main{font-size:16px;font-weight:700;line-height:1.4;margin:14px 2px 6px;}
.vh-vmeta-main{font-size:12px;color:var(--vh-muted);margin:0 2px 12px;}
.vh-channel-row{display:flex;align-items:center;gap:10px;padding:12px 2px;border-top:1px solid var(--vh-border);border-bottom:1px solid var(--vh-border);margin-bottom:14px;}
.vh-channel-row .vh-avatar{width:38px;height:38px;font-size:13px;}
.vh-channel-info{flex:1;}
.vh-channel-info .vh-name{font-size:13px;font-weight:700;}
.vh-channel-info .vh-desc{font-size:11px;color:var(--vh-muted);}
.vh-sub-btn{background:var(--vh-brand);color:var(--vh-brand-ink);font-size:12px;font-weight:700;padding:8px 16px;border-radius:20px;border:none;}
.vh-actions-row{display:flex;gap:8px;margin:0 2px 16px;overflow-x:auto;}
.vh-action-chip{flex:0 0 auto;display:flex;align-items:center;gap:6px;background:var(--vh-surface-2);border:1px solid var(--vh-border);border-radius:18px;padding:8px 14px;font-size:12px;font-weight:600;color:var(--vh-text);}

/* ---------------- Shorts (full reel) ---------------- */
.vh-reel{position:fixed;inset:0;background:#000;z-index:60;}
.vh-reel-scroller{height:100%;overflow-y:scroll;scroll-snap-type:y mandatory;scrollbar-width:none;}
.vh-reel-scroller::-webkit-scrollbar{display:none;}
.vh-reel-item{position:relative;height:100vh;height:100dvh;scroll-snap-align:start;display:flex;align-items:center;justify-content:center;background:#0b0b0b;}
.vh-reel-item video{width:100%;height:100%;object-fit:cover;}
.vh-reel-topbar{position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:14px 16px;z-index:2;color:#fff;font-weight:700;font-size:13px;padding-top:calc(14px + env(safe-area-inset-top));}
.vh-reel-topbar a{color:#fff;font-size:18px;}
.vh-reel-side{position:absolute;right:12px;bottom:110px;display:flex;flex-direction:column;gap:16px;align-items:center;z-index:2;}
.vh-reel-side .vh-ic{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.15);display:flex;align-items:center;justify-content:center;font-size:16px;color:#fff;}
.vh-reel-bottom{position:absolute;left:14px;right:70px;bottom:34px;z-index:2;color:#fff;}
.vh-reel-bottom .vh-r-user{font-size:13px;font-weight:700;margin-bottom:4px;}
.vh-reel-bottom .vh-r-desc{font-size:12px;opacity:.9;}
.vh-reel-cat-tag{display:inline-block;font-size:9px;font-weight:700;padding:2px 8px;border-radius:6px;background:var(--cc,#2F6F5E);color:#fff;margin-bottom:6px;}

.vh-reel-ad{position:relative;height:100vh;height:100dvh;scroll-snap-align:start;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--vh-ad-bg);color:var(--vh-ad-text);gap:14px;padding:24px;text-align:center;}
.vh-reel-ad .vh-ad-badge{position:absolute;top:calc(14px + env(safe-area-inset-top));left:16px;font-size:10px;font-weight:700;border:1px solid var(--vh-ad-border);padding:3px 9px;border-radius:7px;}
.vh-reel-ad .vh-ad-slot{width:220px;height:220px;border:1px dashed var(--vh-ad-border);border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;}
.vh-reel-ad.vh-dual{flex-direction:column;gap:14px;}
.vh-reel-ad.vh-dual .vh-ad-slot{width:180px;height:180px;}
.vh-reel-continue{font-size:12px;font-weight:700;border:1px solid var(--vh-ad-border);padding:8px 18px;border-radius:20px;background:transparent;color:var(--vh-ad-text);}

/* ---------------- Category chooser (no category selected) ---------------- */
.vh-cat-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px;}
.vh-cat-choice{border-radius:14px;padding:20px 14px;background:var(--vh-surface);border:1px solid var(--vh-border);text-align:center;font-weight:700;font-size:13px;box-shadow:var(--vh-shadow);}
.vh-cat-choice .vh-catdot{width:10px;height:10px;border-radius:50%;background:var(--cc,var(--vh-brand));margin:0 auto 8px;}

/* ---------------- Desktop / tablet (SEO layout) ---------------- */
@media (min-width: 900px){
  .vh-bottomnav{display:none;}
  .vh-content{padding-bottom:60px;}
  .vh-grid{grid-template-columns:repeat(4,1fr);}
  .vh-cat-choices{grid-template-columns:repeat(3,1fr);}
  .vh-ad-banner{min-height:90px;}
  .vh-topbar{padding:14px 32px 10px;}
  .vh-content{padding-left:32px;padding-right:32px;}
  .vh-searchbar{max-width:420px;}
  .vh-player-wrap video{max-height:70vh;}
}
