/* ============================================================
   Aayush TV — Upgrade Pack v1 (27 Nov 2026)
   Shared polish + easier-watching layer for all section pages.
   Loaded AFTER each page's own styles, so it only refines —
   it never replaces a page's layout. Companion: upgrade.js
   ============================================================ */

/* ---------- global feel ---------- */
html { scroll-behavior: smooth; }
::selection { background: #ff3b3b; color: #fff; }
body { -webkit-tap-highlight-color: transparent; }
main { animation: atvFade .35s ease both; }
@keyframes atvFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main { animation: none; }
  * { transition: none !important; }
}

/* slim dark scrollbar with a red thumb */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0e14; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 6px; border: 2px solid #0b0e14; }
::-webkit-scrollbar-thumb:hover { background: #ff3b3b; }
html { scrollbar-width: thin; scrollbar-color: #2a3040 #0b0e14; }

/* clear keyboard focus everywhere */
:focus-visible { outline: 2px solid #ff5252; outline-offset: 2px; border-radius: 6px; }

/* header gets a stronger shadow once the page scrolls */
header { transition: box-shadow .25s ease; }
header.atv-scrolled { box-shadow: 0 12px 34px rgba(0,0,0,.55); }

/* search boxes glow red when focused */
#search:focus, input.search:focus {
  border-color: #ff5252 !important;
  box-shadow: 0 0 0 3px rgba(255,59,59,.22);
  outline: none;
}
#search, input.search { transition: border-color .15s ease, box-shadow .15s ease; }

/* ---------- cards & buttons feel ---------- */
.card, .showcard, .tile { will-change: transform; }
.card img, .showcard img { transition: transform .35s ease; }
.card:hover img, .showcard:hover img { transform: scale(1.05); }
button, .chip, nav.main-nav a, .switcher a { transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; }
button:active, .chip:active { transform: scale(.97); }

/* mobile: nav becomes one swipeable row instead of wrapping */
@media (max-width: 640px) {
  nav.main-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  nav.main-nav::-webkit-scrollbar { display: none; }
  nav.main-nav a { white-space: nowrap; padding: 9px 13px; }
  .head-inner { gap: 10px; padding: 12px 14px; }
}

/* ---------- player polish ---------- */
#player-wrap, #playerWrap, #watch-wrap, #bb-player {
  border-radius: 16px;
}
#player-wrap video, #playerWrap video, #watch-wrap video, #watch-wrap iframe,
#bb-screen video, #bb-screen iframe, #frame-player {
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}

/* ---------- player toolbar (buttons added by upgrade.js) ---------- */
.atv-toolbar {
  display: none; /* upgrade.js shows it while the player is open */
  gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 10px 0 4px;
}
.atv-toolbar .atv-tlabel { font-size: 12px; font-weight: 800; letter-spacing: .6px; color: #9aa1b2; margin-right: 2px; }
.atv-tbtn {
  appearance: none; border: 1px solid #2a3040; background: #141a29; color: #e8eaf0;
  font: 600 13px 'Inter', system-ui, sans-serif;
  padding: 8px 13px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.atv-tbtn:hover { border-color: #ff3b3b; background: #1c2338; transform: translateY(-1px); }
.atv-tbtn.on { background: linear-gradient(135deg, #ff3b3b, #ff5c5c); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(255,59,59,.4); }

/* ---------- theater mode ---------- */
body.atv-theater main { max-width: min(1560px, 97vw) !important; }
body.atv-theater #player-wrap, body.atv-theater #playerWrap,
body.atv-theater #watch-wrap, body.atv-theater #bb-player { width: 100%; }

/* ---------- floating mini-player ---------- */
.atv-mini {
  position: fixed !important;
  right: 12px; bottom: 12px;
  width: min(360px, 74vw);
  z-index: 9990;
  background: #0d1119;
  border: 1px solid rgba(255,59,59,.55);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.65), 0 0 24px rgba(255,59,59,.15);
  padding: 6px;
  margin: 0 !important;
  cursor: pointer;
  animation: atvMiniIn .25s ease both;
}
@keyframes atvMiniIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.atv-mini > *:not(.atv-keep):not(video):not(iframe):not(.atv-mini-bar) { display: none !important; }
.atv-mini video, .atv-mini iframe { width: 100% !important; border-radius: 9px; display: block; }
.atv-mini-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 4px 6px; font-size: 12px; font-weight: 700; color: #cfd3dd;
}
.atv-mini-bar .atv-mini-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atv-mini-bar button {
  appearance: none; border: 1px solid #2a3040; background: #182134; color: #fff;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.atv-mini-bar button:hover { border-color: #ff3b3b; background: #ff3b3b; }
@media (max-width: 640px) {
  .atv-mini { width: min(270px, 62vw); right: 8px; bottom: 8px; }
}

/* ---------- toast (seek / volume feedback) ---------- */
.atv-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px);
  background: rgba(13,17,25,.92); color: #fff; border: 1px solid #2a3040;
  font: 700 14px 'Inter', system-ui, sans-serif;
  padding: 9px 16px; border-radius: 999px; z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.atv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* double-tap seek flash on the video itself */
.atv-seekflash {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.55); color: #fff; border-radius: 999px;
  font: 800 15px 'Inter', system-ui, sans-serif; padding: 10px 14px;
  pointer-events: none; z-index: 5; opacity: 0; transition: opacity .25s ease;
}
.atv-seekflash.show { opacity: 1; }

/* ---------- back-to-top ---------- */
.atv-top {
  position: fixed; right: 14px; bottom: 14px; z-index: 9980;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #2a3040; background: rgba(20,26,41,.92); color: #fff;
  font-size: 18px; cursor: pointer; display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.5); backdrop-filter: blur(8px);
}
.atv-top:hover { border-color: #ff3b3b; background: #ff3b3b; }
.atv-top.show { display: inline-flex; }
/* keep clear of the mini-player when both are on screen */
body.atv-mini-on .atv-top { bottom: auto; top: 76px; }
