/* ===== TalaFlix — OTT streaming UI ===== */
:root {
  --bg:        #0a0a0b;
  --bg-2:      #121214;
  --panel:     #17171a;
  --rail:      #0e0e10;
  --text:      #f4f4f5;
  --muted:     #9b9ba3;
  --line:      #232327;
  --red:       #e50914;
  --red-2:     #ff2d3a;
  --red-glow:  rgba(229,9,20,.45);
  --radius:    14px;
  --rail-w:    76px;
  --ease:      cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #38383f; }

/* ===== Left rail ===== */
.rail {
  position: fixed; inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 18px;
  z-index: 40;
}
.rail-logo {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; position: relative;
  background: #17171a; border: 1px solid var(--line);
  margin-bottom: 26px;
}
.rail-logo img { height: 30px; width: auto; display: block; filter: drop-shadow(0 2px 8px var(--red-glow)); }
.rail-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.rail-bottom { margin-top: auto; }
.rail-item {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--muted); position: relative;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.rail-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rail-item:hover { color: #fff; background: #1b1b1f; }
.rail-item.active { color: #fff; }
.rail-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 3px; background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}

/* ===== Stage ===== */
.stage {
  margin-left: var(--rail-w);
  height: 100vh; overflow-y: auto; position: relative;
  scroll-behavior: smooth;
}

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 16px 40px;
  background: linear-gradient(180deg, rgba(10,10,11,.96), rgba(10,10,11,.4) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; user-select: none; }
.brand .brand-logo { height: 34px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.search-wrap { flex: 0 1 360px; }
#search {
  width: 100%; padding: 11px 16px; border-radius: 999px;
  background: #1a1a1e; border: 1px solid var(--line); color: var(--text);
  font-size: 14px; outline: none; transition: border .2s, box-shadow .2s;
}
#search:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
#search::placeholder { color: #6a6a72; }

/* ===== Subscribe button + view ===== */
.subscribe-btn { flex: 0 0 auto; background: linear-gradient(160deg, var(--red-2), var(--red)); color: #fff;
  border: none; font-family: inherit; font-weight: 800; font-size: 14px; padding: 11px 20px; border-radius: 999px;
  cursor: pointer; box-shadow: 0 6px 18px var(--red-glow); transition: transform .12s var(--ease), filter .2s; white-space: nowrap; }
.subscribe-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.subscribe-btn:active { transform: scale(.97); }

.sub-view { display: grid; place-items: center; padding: 60px 22px; min-height: 70vh; }
.sub-card { width: min(440px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  padding: 36px 32px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.sub-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: #fff;
  background: var(--red); padding: 5px 14px; border-radius: 6px; margin-bottom: 18px; }
.sub-price { font-size: 44px; font-weight: 900; letter-spacing: -1.5px; margin: 0 0 4px; }
.sub-price span { font-size: 17px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sub-feats { list-style: none; margin: 22px 0; padding: 0; text-align: left; display: grid; gap: 11px; }
.sub-feats li { color: #d6d6db; font-size: 15px; }
.pay-email { width: 100%; background: #101013; border: 1px solid var(--line); color: var(--text);
  border-radius: 11px; padding: 14px 16px; font-size: 15px; font-family: inherit; outline: none; margin-bottom: 14px; }
.pay-email:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.pay-btns { display: grid; gap: 11px; }
.pay-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 15px; padding: 15px; border-radius: 12px; transition: filter .2s, transform .1s; }
.pay-btn:hover { filter: brightness(1.08); } .pay-btn:active { transform: scale(.98); }
.pay-btn:disabled { opacity: .6; cursor: default; }
.pay-card { background: var(--red); color: #fff; }
.pay-africa { background: #0aa06e; color: #fff; }
.pay-none { color: var(--muted); font-size: 13px; line-height: 1.6; background: #101013; border: 1px solid var(--line);
  border-radius: 11px; padding: 14px; }
.pay-none code { color: var(--red-2); font-size: 12px; }
.pay-msg { margin-top: 12px; font-size: 14px; min-height: 18px; }
.pay-msg .err { color: var(--red-2); }
.pay-secure { color: var(--muted); font-size: 12px; margin: 16px 0 0; }

/* ===== Hero ===== */
.hero { position: relative; min-height: 62vh; display: flex; align-items: flex-end; padding: 0 40px 8px; margin-top: -76px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(1.1); transform-origin: center; }
.hero-bg.zoom { animation: heroZoom 45s both; }
@keyframes heroZoom {
  0%   { transform: scale(1.16); animation-timing-function: cubic-bezier(.16,.7,.2,1); } /* quick eased zoom-out */
  7%   { transform: scale(1);    animation-timing-function: linear; }                     /* ~3s: settled */
  100% { transform: scale(1.08); }                                                        /* very slow linear zoom-in */
}
.hero-bg::after { content:''; position:absolute; inset:0; background:
  radial-gradient(120% 90% at 80% 10%, transparent, rgba(10,10,11,.2)),
  linear-gradient(90deg, var(--bg) 8%, rgba(10,10,11,.55) 45%, rgba(10,10,11,.15));
}
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 2%, rgba(10,10,11,.65) 30%, transparent 70%); }
.hero-inner { position: relative; z-index: 2; max-width: 560px; padding-bottom: 24px; }
/* selected channel logo, small, on the right of the hero */
.hero-selected { position: absolute; right: 56px; top: 120px; z-index: 3;
  flex-direction: column; align-items: center; gap: 8px;
  width: 118px; padding: 16px; border-radius: 16px;
  background: rgba(12,12,16,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 12px 34px rgba(0,0,0,.45); }
.hero-selected img { width: 100%; height: 78px; object-fit: contain; }
.hero-selected-tag { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px){ .hero-selected { display: none !important; } }
.hero-logo { max-height: 84px; max-width: 300px; object-fit: contain; margin-bottom: 18px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.6)); display:none; }
.hero-title { font-size: clamp(34px, 5vw, 60px); font-weight: 900; letter-spacing: -1.5px; line-height: 1; margin: 0 0 16px; }
.hero-chan-logo { max-height: 108px; max-width: 360px; object-fit: contain; margin: 0 0 18px;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,.6)); }
.hero-live { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .6px;
  padding: 5px 12px; border-radius: 6px; margin-bottom: 16px; }
.hero-live .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.hero-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid #3a3a40; color: #d6d6db; }
.chip-live { border-color: transparent; background: var(--red); color: #fff; letter-spacing: .5px; }
.chip-live::first-letter { color: #fff; }
.hero-desc { color: #d3d3d8; font-size: 16px; line-height: 1.55; margin: 0 0 24px; max-width: 500px; }
.hero-actions { display: flex; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 15px; padding: 13px 26px; border-radius: 8px;
  transition: transform .12s var(--ease), background .2s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-play { background: var(--red); color: #fff; box-shadow: 0 8px 24px var(--red-glow); }
.btn-play:hover { background: var(--red-2); }
.btn-ghost { background: rgba(120,120,130,.35); color: #fff; backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(120,120,130,.5); }
.btn-info { background: rgba(130,130,140,.45); color: #fff; backdrop-filter: blur(4px); }
.btn-info:hover { background: rgba(130,130,140,.62); }

/* ===== Genre pills ===== */
.genre-sec { margin: 6px 0 30px; }
.genre-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; padding: 0 40px; margin: 0 0 14px; }
.genre-track { display: flex; gap: 12px; overflow-x: auto; padding: 2px 40px 8px; scroll-snap-type: x proximity; }
.genre-track::-webkit-scrollbar { height: 0; }
.genre-pill { flex: 0 0 auto; border: none; color: #fff; font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 14px 28px; border-radius: 12px; cursor: pointer; white-space: nowrap; scroll-snap-align: start;
  transition: transform .12s var(--ease), filter .2s, box-shadow .2s; }
.genre-pill:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.4); }

/* ===== Rows ===== */
.rows { padding: 8px 0 60px; position: relative; z-index: 3; }
.row { margin-bottom: 34px; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 40px; margin-bottom: 14px; }
.row-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.row-count { font-size: 13px; color: var(--muted); }
.row-track { display: flex; gap: 14px; overflow-x: auto; padding: 4px 40px 8px; scroll-snap-type: x proximity; }
.row-track::-webkit-scrollbar { height: 0; }
.row:hover .row-track::-webkit-scrollbar { height: 8px; }

.card {
  flex: 0 0 auto; width: 208px; scroll-snap-align: start; cursor: pointer;
  border-radius: var(--radius); overflow: hidden; position: relative;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-4px) scale(1.03); border-color: var(--red); box-shadow: 0 14px 34px rgba(0,0,0,.55), 0 0 0 1px var(--red-glow); z-index: 5; }
.card-art { aspect-ratio: 16/9; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 120% at 50% 0%, #232329, #101013); }
.card-art img { max-width: 82%; max-height: 66px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.card-live { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  background: var(--red); color: #fff; padding: 3px 7px; border-radius: 5px; display: flex; align-items: center; gap: 4px; }
.card-live .d { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.card-foot { padding: 11px 13px 13px; }
.card-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-group { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.card-play svg { width: 46px; height: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.card:hover .card-play { opacity: 1; }
.card:hover .card-art img { opacity: .35; }

/* ===== Player modal ===== */
.player { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.player[hidden] { display: none; }
.player-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); }
.player-box { position: relative; width: min(1040px, 94vw); max-height: calc(100vh - 44px);
  display: flex; flex-direction: column; background: #000; border-radius: 16px; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.7); border: 1px solid #26262b; animation: pop .28s var(--ease); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.player-x { position: absolute; top: 12px; right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 16px; cursor: pointer; transition: background .2s; }
.player-x:hover { background: var(--red); }
.pl-stage { position: relative; background: #000; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#video { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; background: #000; display: block; object-fit: contain; }

/* custom control bar — solid black, always visible */
.pl-controls {
  position: static; z-index: 4;
  padding: 18px 22px 16px;
  display: flex; flex-direction: column; gap: 14px;
  background: #000;
  border-top: 1px solid #161619;
}

.pl-scrub { display: flex; align-items: center; gap: 14px; }
.pl-t { font-size: 13px; font-variant-numeric: tabular-nums; color: #d0d0d6; min-width: 48px; }
.pl-dur { text-align: right; }
.pl-dur.live { color: var(--red-2); font-weight: 700; letter-spacing: .3px; }
.pl-bar {
  position: relative; flex: 1; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.18); cursor: pointer;
}
.pl-bar:hover { height: 8px; }
.pl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, var(--red), var(--red-2)); border-radius: 999px; }
.pl-handle {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 50%; background: var(--red-2);
  box-shadow: 0 0 0 4px rgba(229,9,20,.28), 0 2px 6px rgba(0,0,0,.6);
  transition: transform .1s; pointer-events: none;
}
.pl-bar:hover .pl-handle { transform: translate(-50%, -50%) scale(1.15); }

/* transport */
.pl-transport { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pl-btn {
  background: none; border: none; cursor: pointer; color: var(--red);
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  transition: transform .12s var(--ease), background .2s, color .2s;
}
.pl-btn svg { width: 24px; height: 24px; fill: currentColor; }
.pl-btn:hover { color: var(--red-2); background: rgba(229,9,20,.16); transform: scale(1.08); }
.pl-btn:active { transform: scale(.92); }
/* main play/pause — clean red disc, single icon */
.pl-btn-main { width: 54px; height: 54px; background: var(--red); color: #fff; box-shadow: 0 6px 18px var(--red-glow); margin: 0 6px; }
.pl-btn-main svg { width: 26px; height: 26px; }
.pl-btn-main:hover { background: var(--red-2); color: #fff; transform: scale(1.06); }
/* icon toggles (only one shows at a time) */
.pl-btn .i-pause, .pl-btn.playing .i-play { display: none; }
.pl-btn.playing .i-pause { display: block; }
.pl-btn .i-mute, .pl-btn.muted .i-vol { display: none; }
.pl-btn.muted .i-mute { display: block; }
/* side buttons */
.pl-btn-sm { width: 40px; height: 40px; color: #b6b6bd; }
.pl-btn-sm svg { width: 22px; height: 22px; }
.pl-btn-sm:hover { color: #fff; background: rgba(255,255,255,.12); }
.pl-spacer { flex: 1; }
.player-info { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--panel); }
.player-info img { width: 52px; height: 52px; object-fit: contain; background: #0d0d10; border-radius: 10px; padding: 6px; }
.pi-meta { margin-right: auto; min-width: 0; }
.player-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
.player-status { font-size: 13px; color: var(--muted); }

/* add-to-list button in player */
.pl-fav {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; font-family: inherit; font-weight: 600; font-size: 14px;
  background: rgba(255,255,255,.08); color: #e8e8ec; border: 1px solid var(--line);
  transition: background .2s, border-color .2s, color .2s, transform .12s var(--ease); white-space: nowrap;
}
.pl-fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.pl-fav:hover { background: rgba(255,255,255,.14); border-color: #3a3a40; }
.pl-fav:active { transform: scale(.96); }
.pl-fav.active { background: rgba(229,9,20,.16); border-color: var(--red); color: #fff; }
.pl-fav.active svg { fill: var(--red); stroke: var(--red); }
/* remove-channel button in player (admin) */
.pl-remove { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; font-family: inherit; font-weight: 700; font-size: 14px;
  background: rgba(229,9,20,.14); color: var(--red-2); border: 1px solid rgba(229,9,20,.5); transition: background .2s, color .2s; }
.pl-remove:hover { background: var(--red); color: #fff; border-color: var(--red); }
.pl-remove[hidden] { display: none; }
.player-status.err { color: var(--red-2); }
.player-status.ok { color: #35d07f; }

/* ===== Search section ===== */
.search-view { padding: 30px 40px 60px; }
.sv-title { font-size: 30px; font-weight: 800; margin: 0 0 20px; letter-spacing: -.5px; }
.sv-box { position: relative; max-width: 620px; margin-bottom: 18px; }
.sv-box .sv-ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.sv-box input { width: 100%; padding: 16px 18px 16px 52px; border-radius: 14px; font-size: 17px;
  background: #17171a; border: 1px solid var(--line); color: var(--text); outline: none; transition: border .2s, box-shadow .2s; }
.sv-box input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.sv-box input::placeholder { color: #6a6a72; }
.sv-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.sv-tab { background: #17171a; border: 1px solid var(--line); color: #c8c8ce; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; font-family: inherit; font-size: 14px; font-weight: 600; transition: all .18s var(--ease); }
.sv-tab:hover { background: #1f1f24; color: #fff; }
.sv-tab.active { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 14px var(--red-glow); }
.sv-hint { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.search-view .row { margin-bottom: 30px; }
.search-view .row-head, .search-view .row-track { padding-left: 0; padding-right: 0; }

/* ===== TalaFlix TV — navy/purple hero with orange accents ===== */
.tv-view { --tv-orange: #f0913f; --tv-orange-2: #ff9d42;
  margin-top: -76px; min-height: 100vh;
  background: radial-gradient(135% 115% at 88% -8%, #4a3a8a 0%, #272160 34%, #14153c 62%, #0c0d26 100%); }
.tv-hero { position: relative; overflow: hidden; min-height: 66vh; display: flex; justify-content: space-between; align-items: center; gap: 40px; padding: 130px 48px 64px; }
/* auto-transitioning image carousel behind the hero */
.tv-carousel { position: absolute; inset: 0; z-index: 0; }
.tv-slide { position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform-origin: center; animation: tvSlide 18s infinite; }
@keyframes tvSlide {
  0%   { opacity: 0; transform: scale(1.09); }
  4%   { opacity: 1; }
  30%  { opacity: 1; }
  34%  { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}
.tv-carousel-scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(20,21,60,.94), rgba(20,21,60,.55) 52%, rgba(20,21,60,.28)),
              linear-gradient(0deg, #0c0d26 2%, transparent 55%); }
.tv-hero-left { position: relative; z-index: 2; max-width: 620px; }
.tv-eyebrow { display: flex; align-items: center; gap: 14px; color: var(--tv-orange);
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 24px; }
.tv-dash { width: 34px; height: 2px; background: var(--tv-orange); display: inline-block; border-radius: 2px; }
.tv-h1 { font-size: clamp(44px, 6vw, 78px); font-weight: 900; line-height: .96; margin: 0 0 24px;
  color: #fff; letter-spacing: -2px; }
.tv-accent { color: var(--tv-orange); }
.tv-lead { color: #b9bccf; font-size: 16px; line-height: 1.65; max-width: 520px; margin: 0; }
.tv-hero-right { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding-right: 12px; }
.tv-set { width: 172px; height: auto; filter: drop-shadow(0 12px 34px rgba(0,0,0,.4)); }
.tv-rows { padding-top: 8px; padding-bottom: 40px; }
.tv-rows .row-head, .tv-rows .row-track { padding-left: 48px; padding-right: 48px; }
.tv-rows .row-title { color: #fff; }
@media (max-width: 760px){ .tv-hero { padding: 100px 22px 40px; } .tv-hero-right { display: none; } .tv-rows .row-head, .tv-rows .row-track { padding-left: 22px; padding-right: 22px; } }

/* ===== VOD (Films / Séries) ===== */
.vod-view { padding: 30px 40px 60px; }
.vod-banner { height: 240px; border-radius: 18px; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; padding: 26px 30px; margin-bottom: 28px; border: 1px solid var(--line); }
.vod-banner-title { font-size: 40px; font-weight: 900; letter-spacing: -1px; margin: 0; color: #fff;
  text-shadow: 0 3px 20px rgba(0,0,0,.7); }
/* selected movie/series featured at top */
.vod-feature { position: relative; min-height: 44vh; border-radius: 18px; overflow: hidden;
  margin-bottom: 30px; display: flex; align-items: flex-end; border: 1px solid var(--line); }
.vodf-bg { position: absolute; inset: 0; background-size: cover; background-position: center;
  transform-origin: center; animation: heroZoom 45s both; }
.vod-feature::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,10,11,.96), rgba(10,10,11,.5) 55%, rgba(10,10,11,.15)),
              linear-gradient(0deg, var(--bg), transparent 60%); }
.vodf-inner { position: relative; z-index: 2; padding: 34px; max-width: 580px; }
.vodf-inner h1 { font-size: clamp(30px, 4vw, 54px); font-weight: 900; letter-spacing: -1.2px; margin: 0 0 12px; }
.vodf-meta { color: #d3d3d8; font-size: 14px; margin-bottom: 14px; }
.vodf-inner p { color: #c8c8ce; line-height: 1.55; margin: 0 0 20px; }
.vod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.vod-card { cursor: pointer; }
.vod-poster { position: relative; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #232329, #101013); border: 1px solid var(--line);
  transition: transform .22s var(--ease), box-shadow .22s, border-color .22s; }
.vod-poster img { width: 100%; height: 100%; object-fit: cover; }
.vod-card:hover .vod-poster { transform: translateY(-5px) scale(1.03); border-color: var(--red);
  box-shadow: 0 16px 36px rgba(0,0,0,.6), 0 0 0 1px var(--red-glow); }
.vod-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.vod-play svg { width: 52px; height: 52px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.vod-card:hover .vod-play { opacity: 1; }
.vod-name { font-size: 14px; font-weight: 600; margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== Admin tabs + VOD manager ===== */
.admin-tabs { display: flex; gap: 8px; margin: 14px 0 18px; }
.admin-tab { background: #17171a; border: 1px solid var(--line); color: #c8c8ce; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 600; transition: all .18s var(--ease); }
.admin-tab:hover { background: #1f1f24; color: #fff; }
.admin-tab.active { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 14px var(--red-glow); }
.vod-form { align-items: flex-end; }
.vod-form input { min-width: 0; }
.vod-art { aspect-ratio: 2/3 !important; }
.vod-noimg { font-size: 34px; opacity: .5; }
.vod-del { margin-top: 10px; width: 100%; background: rgba(229,9,20,.12); border: 1px solid rgba(229,9,20,.4);
  color: var(--red-2); border-radius: 8px; padding: 7px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .2s; }
.vod-del:hover { background: rgba(229,9,20,.25); }

.tmdb-attr { color: #55555c; font-size: 12px; margin: 40px 0 0; line-height: 1.5; }

/* ===== Metadata auto-fill (admin) ===== */
.meta-search { position: relative; margin-bottom: 18px; max-width: 620px; }
.meta-search label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.meta-search input { width: 100%; background: #101013; border: 1px solid var(--line); color: var(--text);
  border-radius: 11px; padding: 13px 16px; font-size: 15px; font-family: inherit; outline: none; }
.meta-search input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.meta-results { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; z-index: 20;
  background: #17171a; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 340px; overflow-y: auto; }
.meta-results:empty { display: none; }
.meta-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; transition: background .15s; }
.meta-item:hover { background: rgba(229,9,20,.14); }
.meta-thumb { width: 40px; height: 58px; border-radius: 6px; background: #0d0d10; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; font-size: 18px; }
.meta-thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta-t { font-size: 14px; font-weight: 600; }
.meta-y { font-size: 12px; color: var(--muted); }

/* ===== Banner manager ===== */
.banner-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.banner-slot { display: flex; gap: 18px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.banner-preview { flex: 0 0 260px; height: 120px; border-radius: 10px; background: #101013;
  background-size: cover; background-position: center; display: grid; place-items: center; border: 1px solid var(--line); overflow: hidden; }
.banner-preview span { color: #55555c; font-size: 13px; }
.banner-fields { flex: 1; min-width: 0; }
.banner-fields label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.banner-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.banner-url { width: 100%; background: #101013; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 11px 14px; font-family: inherit; font-size: 14px; outline: none; }
.banner-url:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
@media (max-width: 700px){ .banner-slot { flex-direction: column; align-items: stretch; } .banner-preview { flex: none; width: 100%; } }

/* loading + empty */
.loading { padding: 80px 40px; color: var(--muted); font-size: 15px; }
.empty { padding: 40px; color: var(--muted); line-height: 1.6; }

/* ===== Admin console ===== */
.admin { padding: 32px 40px 60px; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.admin-head h2 { font-size: 26px; font-weight: 800; margin: 0; }
.admin-badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #fff; background: var(--red); padding: 3px 9px; border-radius: 6px; }
.admin-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 20px;
}
.admin-field { display: flex; flex-direction: column; gap: 6px; }
.admin-field label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.admin-field select, .admin-field input {
  background: #101013; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 10px 12px; font-family: inherit; font-size: 14px; outline: none; min-width: 190px;
}
.admin-field select:focus, .admin-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.admin-reset {
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #d6d6db;
  border-radius: 9px; padding: 10px 16px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 14px; height: 40px;
}
.admin-reset:hover { background: rgba(255,255,255,.1); }
.admin-count { margin-left: auto; align-self: center; font-size: 14px; color: var(--muted); }
.admin-count b { color: var(--text); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.admin-grid .card { width: auto; }
.card-flag { position: absolute; top: 10px; right: 10px; font-size: 15px; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 6px; backdrop-filter: blur(3px); }

/* geo-checker bar */
.admin-geo { align-items: flex-start; }
.vantage-hint { font-size: 12px; margin-top: 2px; max-width: 320px; line-height: 1.3; }
.vantage-hint.local { color: var(--red-2); }
.vantage-hint.real { color: #35d07f; }
.btn-check { height: 40px; padding: 0 20px; font-size: 14px; border-radius: 9px; }
.admin-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #d6d6db; cursor: pointer; user-select: none; }
.admin-toggle input { width: 16px; height: 16px; accent-color: var(--red); cursor: pointer; }

/* health badges on admin cards */
.card-health { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 7px; border-radius: 5px; color: #fff; }
.card-health.ok   { background: #1f9d55; }
.card-health.geo  { background: #d98a00; }
.card-health.dead { background: #8a3030; }
.card.h-dead { opacity: .5; }
.card.h-ok { border-color: rgba(31,157,85,.5); }

/* per-card remove button (admin) */
.card-remove { position: absolute; top: 8px; right: 8px; z-index: 6; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 13px; cursor: pointer; line-height: 1;
  opacity: 0; transition: opacity .2s, background .2s; }
.admin-grid .card:hover .card-remove { opacity: 1; }
.card-remove:hover { background: var(--red); }

/* ===== Review / curation mode ===== */
.review { max-width: 560px; margin: 0 auto; padding: 40px 24px 60px; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 15px; }
.review-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; gap: 22px; align-items: center; }
.review-card.is-removed { opacity: .45; }
.review-art { flex: 0 0 130px; height: 100px; border-radius: 12px; background: radial-gradient(120% 120% at 50% 0%, #232329, #101013); display: grid; place-items: center; padding: 14px; }
.review-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.review-name { font-size: 20px; font-weight: 700; }
.review-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.review-badges { margin-top: 10px; display: flex; gap: 8px; }
.rv-b { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; color: #fff; }
.rv-b.ok { background: #1f9d55; } .rv-b.geo { background: #d98a00; } .rv-b.dead { background: #8a3030; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.rv-btn { padding: 15px; border-radius: 12px; border: 1px solid var(--line); background: #1a1a1e; color: #e8e8ec;
  font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: background .2s, transform .1s; }
.rv-btn:hover { background: #24242a; } .rv-btn:active { transform: scale(.98); }
.rv-btn:disabled { opacity: .5; cursor: default; }
.rv-play { background: rgba(229,9,20,.14); border-color: var(--red); color: #fff; }
.rv-remove { background: rgba(229,9,20,.9); border-color: transparent; color: #fff; }
.rv-remove:hover { background: var(--red-2); }
.rv-next { background: rgba(255,255,255,.1); }
.review-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }
.review-hint b { color: #d6d6db; background: #1a1a1e; padding: 1px 6px; border-radius: 4px; }

/* admin unlock in settings */
.admin-unlock { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-unlock h3 { font-size: 16px; margin: 0 0 10px; }
.admin-unlock form { display: flex; gap: 10px; }
.admin-unlock input { background: #101013; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 10px 14px; font-family: inherit; font-size: 14px; outline: none; }
.admin-unlock input:focus { border-color: var(--red); }
.admin-unlock button { background: var(--red); color: #fff; border: none; border-radius: 9px; padding: 10px 18px; font-weight: 700; cursor: pointer; font-family: inherit; }
.admin-msg { font-size: 13px; margin-top: 8px; }
.admin-msg.ok { color: #35d07f; } .admin-msg.err { color: var(--red-2); }

/* ===== Phone layout ===== */
@media (max-width: 720px){
  /* left rail becomes a bottom tab bar */
  .rail { inset: auto 0 0 0; width: 100%; height: 64px; flex-direction: row; align-items: center;
    justify-content: space-around; padding: 0 6px; border-right: none; border-top: 1px solid var(--line);
    background: rgba(14,14,16,.97); backdrop-filter: blur(12px); z-index: 60; }
  .rail-logo, .rail-bottom { display: none; }
  .rail-nav { flex-direction: row; gap: 0; width: 100%; justify-content: space-around; }
  .rail-item { width: 54px; height: 48px; }
  .rail-item.active::before { display: none; }
  .rail-item.active { color: var(--red); }
  .rail-item[data-view="series"] { display: none; }   /* keep 5 core tabs */

  .stage { margin-left: 0; padding-bottom: 72px; }
  .topbar { padding: 12px 18px; }
  .brand .brand-logo { height: 28px; }
  .search-wrap { display: none; }          /* search lives in the bottom nav */

  .hero { min-height: 42vh; padding: 0 18px 14px; }
  .hero-title { font-size: clamp(24px, 6vw, 32px); }
  .hero-chan-logo { max-height: 64px; max-width: 200px; margin-bottom: 12px; }
  .hero-live { font-size: 10px; padding: 4px 9px; margin-bottom: 12px; }
  .hero-desc { font-size: 13px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-selected { display: none !important; }

  .genre-title { padding: 0 18px; }
  .genre-track { padding-left: 18px; padding-right: 18px; }
  .genre-pill { font-size: 14px; padding: 12px 22px; }
  .row-head, .row-track { padding-left: 18px; padding-right: 18px; }
  .card { width: 158px; }

  .tv-hero { padding: 92px 18px 30px; }
  .tv-hero-right { display: none; }
  .tv-rows .row-head, .tv-rows .row-track { padding-left: 18px; padding-right: 18px; }

  .vod-view, .search-view, .admin { padding-left: 18px; padding-right: 18px; }
  .admin-bar { flex-direction: column; align-items: stretch; }
  .admin-field select, .admin-field input { min-width: 0; width: 100%; }
  .player-box { width: 96vw; }
}
