/*
 * Innova Player - three-pane browse layout styles, SHARED by all
 * outputs (desktop web, Samsung Tizen, LG webOS): categories in a
 * collapsible left rail, roomy content in the center, and a
 * preview / info pane on top, mirroring the Android TV app.
 * Loaded after app.css in every package.
 * Original code, INNOVATVPLUS LLC.
 */

/* The browse screen manages its own internal scrolling. */
#scr-browse.wb { overflow: hidden; }
#scr-browse.wb .screen-head { margin-bottom: 16px; }
#scr-browse.wb .screen-head h1 { font-size: 34px; }

.wb-layout {
  display: flex; gap: 22px;
  height: calc(100% - 76px);
}

/* ---------------- left rail: categories ---------------- */
.wb-rail {
  width: 322px; flex: none; display: flex; flex-direction: column;
  background: #10160f; border: 2px solid #26362c; border-radius: 14px;
  overflow: hidden;
}
.wb-rail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 2px solid #26362c;
}
.wb-rail-title { flex: 1; font-size: 21px; font-weight: 700; color: #35d461; }
.wb-rail-toggle {
  width: 38px; height: 38px; font-size: 24px; line-height: 1;
  background: #1c2620; border: 2px solid #33463a; border-radius: 8px;
}
.wb-rail-body { flex: 1; overflow-y: auto; padding: 10px; }
.wb-layout.wb-railoff .wb-rail { width: 62px; }
.wb-layout.wb-railoff .wb-rail-title,
.wb-layout.wb-railoff .wb-rail-body { display: none; }
.wb-layout.wb-railoff .wb-rail-head { justify-content: center; padding: 12px 6px; }
.wb-layout.wb-norail .wb-rail { display: none; }

.wb-cat {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; margin-bottom: 4px; font-size: 20px; line-height: 1.3;
  border-radius: 9px; border: 2px solid transparent; color: #d8e4da;
}
.wb-cat:hover { background: rgba(53, 212, 97, 0.08); }
.wb-cat.wb-on {
  background: rgba(53, 212, 97, 0.16); border-color: #35d461; color: #fff; font-weight: 600;
}
.wb-all { font-weight: 700; color: #fff; }
.wb-lock {
  border: 2px dashed #6b5636; color: #ffd94d; font-weight: 600; margin-top: 10px;
}

.wb-group { margin-bottom: 4px; }
.wb-ghead {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 11px 12px; font-size: 19px; font-weight: 700; color: #9fd8ae;
  background: #16211a; border: 2px solid #26362c; border-radius: 9px;
}
.wb-chev { color: #35d461; width: 18px; flex: none; }
.wb-glabel { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-gcount {
  flex: none; font-size: 14px; color: #0b0f0c; background: #35d461;
  border-radius: 999px; padding: 1px 9px; font-weight: 700;
}
.wb-gbody { padding: 6px 0 2px 18px; }
.wb-group.wb-closed .wb-gbody { display: none; }

/* ---------------- center column ---------------- */
.wb-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.wb-msg { color: #9fb8a6; font-size: 20px; min-height: 28px; padding: 4px 2px; }
.wb-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 10px 2px; }
.wb-list.rows { display: flex; flex-direction: column; gap: 10px; }
.wb-list.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
  gap: 22px; align-content: start;
}
.wb-more {
  width: 100%; padding: 16px; text-align: center; font-size: 19px;
  background: #1c2620; border: 2px solid #33463a; border-radius: 10px;
}
.wb-list.cards .wb-more { grid-column: 1 / -1; }

/* channel / mixed rows */
.wb-row {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  padding: 13px 20px; background: #141d17; border: 2px solid #26362c; border-radius: 12px;
}
.wb-row:hover { background: #18241c; }
.wb-row.wb-on { border-color: #35d461; background: rgba(53, 212, 97, 0.10); }
.wb-rnum { color: #35d461; font-weight: 700; font-size: 21px; min-width: 48px; }
.wb-rlogo { flex: none; width: 220px; height: 88px; display: flex; align-items: center; justify-content: center; }
.wb-rlogo img { max-width: 220px; max-height: 88px; object-fit: contain; }
.wb-rposter { width: 40px; height: 58px; }
.wb-rposter img { max-width: 40px; max-height: 58px; object-fit: cover; border-radius: 4px; }
.wb-rname { font-size: 23px; font-weight: 600; min-width: 180px; flex: 0 1 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-rnow { flex: 1; font-size: 19px; color: #d8e4da; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-rnext { flex: 1; font-size: 19px; color: #9fb8a6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-rmeta { flex: 1; font-size: 19px; color: #9fb8a6; }

/* poster cards (movies / series) */
.wb-card {
  padding: 12px; text-align: left;
  background: #141d17; border: 2px solid #26362c; border-radius: 12px;
}
.wb-card:hover { background: #18241c; }
.wb-card.wb-on { border-color: #35d461; background: rgba(53, 212, 97, 0.10); }
.wb-poster {
  position: relative; width: 100%; height: 264px; border-radius: 8px;
  overflow: hidden; background: #0e140f;
}
.wb-poster-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.wb-card-title { margin-top: 10px; font-size: 20px; line-height: 1.3; height: 52px; overflow: hidden; }
.wb-card-badge { color: #ffd94d; font-size: 17px; margin-top: 2px; }

/* ---------------- top pane: preview / info ---------------- */
.wb-top {
  flex: none; background: #10160f; border: 2px solid #26362c; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 14px; min-height: 150px;
}
.wb-top .wb-pv, .wb-top .wb-info, .wb-top .wb-topempty { display: none; }
.wb-top[data-state="live"] .wb-pv { display: flex; }
.wb-top[data-state="info"] .wb-info { display: flex; }
.wb-top[data-state="empty"] .wb-topempty { display: flex; }

.wb-topempty { align-items: center; gap: 20px; color: #9fb8a6; font-size: 24px; min-height: 118px; }
.wb-topempty img { width: 84px; height: 84px; }

.wb-pv { gap: 22px; }
.wb-vwrap {
  position: relative; flex: none; width: 480px; max-width: 42vw; height: 270px;
  background: #000; border-radius: 12px; overflow: hidden;
}
/* Engines with CSS aspect-ratio size the wrap from its width as
 * before; the explicit height above is the fallback for engines
 * without it (older TV webviews), where the wrap used to
 * collapse to 0px tall and NOTHING of the preview could show,
 * logo included (round-2 hardening, 2026-11-09). */
@supports (aspect-ratio: 16 / 9) {
  .wb-vwrap { height: auto; aspect-ratio: 16 / 9; }
}
.wb-vwrap video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: none; background: #000; }
/* The logo cover is a SOLID pane, not a floating image: until
 * real playback replaces it, it fully covers the video area
 * (including the AVPlay plane showing through under .pv-av), so
 * the preview is never a black void. */
.wb-vempty {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: #10160f;
}
.wb-vempty img { width: auto; height: auto; max-width: 240px; max-height: 150px; opacity: 0.9; }
.wb-vwrap.has-video .wb-vempty { display: none; }
/* Tizen plane transparency (round 2): while an AVPlay preview
 * is tuned, the browse screen carries .pv-av and the panel
 * backgrounds above the video plane go transparent over the
 * preview area; an opaque background there covers the plane
 * and the pane stays black. The logo cover keeps its own solid
 * background until real playback replaces it, and the pane's
 * border still frames the area.
 * CONTAINMENT REVERTED (2026-11-28, round 5): the diag build
 * narrowed the transparency hole to ONLY the video wrap (the
 * top pane and info column kept their solid background), and
 * on the owner's TV the preview went from a displaced sliver
 * of video to FULLY BLACK — with the plane's rect still off,
 * its only visible intersection had been inside the wider
 * hole, and narrowing the hole hid the plane entirely. The
 * hole is therefore the whole top pane again, exactly as in
 * every build before the diag one: only BACKGROUNDS go
 * transparent, the info text and buttons still paint over the
 * plane, and the wrap itself stays transparent as before. */
#scr-browse.pv-av .wb-top { background: transparent; }
#scr-browse.pv-av .wb-vwrap { background: transparent; }
/* TEMPORARY preview diagnostic line (2026-11-28; REMOVE with
 * the #wb-diag element once the guide preview is confirmed
 * good on the owner's TV): small, muted, single line inside
 * the preview info panel. */
.wb-diag {
  font-family: monospace; font-size: 13px; color: #7e9787;
  margin-top: 6px; white-space: nowrap; overflow: hidden;
}
.wb-diag:empty { display: none; }
.wb-pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wb-pname { font-size: 30px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-pnow { font-size: 21px; color: #d8e4da; margin-top: 8px; min-height: 26px; }
.wb-pbar { height: 8px; background: #26362c; border-radius: 5px; overflow: hidden; margin-top: 8px; max-width: 560px; }
#wb-pbar-fill { height: 100%; width: 0; background: #35d461; }
.wb-pnext { font-size: 19px; color: #9fb8a6; margin-top: 7px; min-height: 23px; }
.wb-pdesc {
  font-size: 18px; color: #c4d4c8; line-height: 1.4; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wb-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 12px; align-items: center; flex-wrap: wrap; }
.wb-actions .btn { padding: 11px 24px; font-size: 20px; }
.wb-vol { display: inline-flex; align-items: center; gap: 8px; }
.wb-vol-slider { width: 120px; accent-color: #2ecc71; cursor: pointer; }

.wb-info { gap: 22px; }
.wb-iposter { position: relative; flex: none; width: 118px; height: 168px; border-radius: 10px; overflow: hidden; background: #0e140f; }
.wb-iposter img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.wb-ibody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wb-ititle { font-size: 30px; font-weight: 700; }
.wb-imeta { font-size: 20px; color: #9fb8a6; margin-top: 6px; }
.wb-iplot {
  font-size: 18px; color: #d8e4da; line-height: 1.45; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* slim scrollbars where the platform shows them */
.wb-rail-body::-webkit-scrollbar, .wb-list::-webkit-scrollbar { width: 10px; }
.wb-rail-body::-webkit-scrollbar-thumb, .wb-list::-webkit-scrollbar-thumb { background: #26362c; border-radius: 6px; }

/* ---------------- cable-style EPG timeline grid (Live TV) ----------------
 * Fixed channel cell (sticky left, 300px) + programme blocks laid out
 * at 4 px/min from the loaded guide. Geometry constants mirror
 * browse-pane.js: ROWH 72, FIXEDW 300, PXMIN 4. */
.wb-guidehead {
  flex: none; display: flex; align-items: stretch; height: 36px;
  margin-bottom: 8px; background: #10160f;
  border: 2px solid #26362c; border-radius: 10px; overflow: hidden;
}
.wb-gh-fixed {
  flex: none; width: 300px; box-sizing: border-box;
  padding: 6px 16px; font-size: 17px; font-weight: 700; color: #35d461;
  border-right: 2px solid #26362c; background: #10160f;
}
.wb-gh-scroll { flex: 1; overflow: hidden; position: relative; }
.wb-gh-track { position: relative; height: 100%; will-change: transform; }
.wb-gh-mark {
  position: absolute; top: 7px; margin-left: 7px;
  font-size: 16px; color: #9fb8a6; white-space: nowrap;
}

.wb-list.grid { overflow: auto; padding: 2px 2px 8px; }
.wb-grid-inner { position: relative; }
.wb-grow { position: absolute; left: 0; width: 100%; height: 72px; }
.wb-gchan {
  position: sticky; left: 0; z-index: 3;
  width: 300px; height: 72px; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; text-align: left;
  background: #141d17; border: 2px solid #26362c; border-radius: 10px;
}
.wb-gchan:hover { background: #18241c; }
/* The channel column is sticky ABOVE the programme track (z-index
 * 3) and the track slides underneath it on horizontal scroll, so
 * its background must stay fully opaque in every state: the old
 * .wb-on tint (rgba 10%) and the global .foc.focused tint (rgba
 * 14%) let programme cells show through over the channel number,
 * logo and name (owner photo, 2026-11-09). #172f1e is the same
 * green tint composited solid over the base #141d17. */
.wb-gchan.wb-on { border-color: #35d461; background: #172f1e; }
.wb-gchan.foc.focused { background-color: #1d3324; }
.wb-gchan .wb-rname { min-width: 0; flex: 1; font-size: 21px; }
.wb-gchan { overflow: hidden; }
.wb-gchan .wb-rlogo { width: 92px; height: 44px; }
.wb-gchan .wb-rlogo img { max-width: 92px; max-height: 44px; }
/* Programme cells live in their own space right of the 300px
 * channel column (JS FIXEDW): clip the track so a cell can never
 * paint under the column at all, whatever the scroll position. */
.wb-gtrack { position: absolute; left: 0; top: 0; right: 0; bottom: 0; clip-path: inset(0 0 0 300px); }
.wb-cell {
  position: absolute; top: 6px; height: 60px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px; text-align: left; overflow: hidden;
  background: #18241c; border: 2px solid #26362c; border-radius: 9px;
}
.wb-cell:hover { background: #1d2b21; }
.wb-cell-now { border-color: #35d461; background: rgba(53, 212, 97, 0.12); }
.wb-cell.wb-cell-on { border-color: #ffd94d; }
.wb-cell-t {
  font-size: 17px; font-weight: 600; color: #e6f2e8; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-cell-time { font-size: 14px; color: #9fb8a6; margin-top: 2px; white-space: nowrap; }
.wb-cell-none {
  position: absolute; top: 6px; height: 60px; box-sizing: border-box;
  display: flex; align-items: center; padding: 0 14px;
  font-size: 16px; color: #7e9787;
  border: 2px dashed #26362c; border-radius: 9px;
}
.wb-nowline {
  position: absolute; top: 0; bottom: 0; width: 3px; z-index: 2;
  background: #ffd94d; opacity: 0.6; pointer-events: none;
}
.wb-list.grid::-webkit-scrollbar { height: 10px; }
