/* =============================================================
   TV Display Framework — "Live"-looking UI feeds throughout the site
   Pure CSS/HTML — no images required for the UI mockups
   Mobile-performant, brand-safe, infinitely composable
   ============================================================= */

/* ---- The TV bezel ---------------------------------------------- */
.tv-display {
  --tv-bezel: 14px;
  --tv-radius: 18px;
  --tv-stand-h: 28px;
  --tv-glow: rgba(0, 180, 255, 0.18);
  display: inline-block;
  position: relative;
  max-width: 100%;
  width: 480px;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.55));
}
.tv-display__chassis {
  position: relative;
  background: linear-gradient(180deg, #1a1f2e 0%, #0a0d18 100%);
  border-radius: var(--tv-radius);
  padding: var(--tv-bezel);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tv-display__chassis::before {
  /* Subtle brushed-aluminum top hint */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.10) 50%, transparent 100%);
  border-radius: var(--tv-radius) var(--tv-radius) 0 0;
}
.tv-display__chassis::after {
  /* TV brand label dot bottom-center */
  content: '';
  position: absolute;
  bottom: 6px; left: 50%;
  width: 32px; height: 2px;
  margin-left: -16px;
  background: rgba(255,255,255,0.10);
  border-radius: 1px;
}
.tv-display__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 0 40px rgba(0,0,0,0.6),
    0 0 60px var(--tv-glow);
}
.tv-display__screen::after {
  /* Scanline + glass-glare overlay for "real TV" feel */
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.20) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  pointer-events: none;
  z-index: 10;
}

/* Optional stand */
.tv-display--stand .tv-display__chassis {
  margin-bottom: var(--tv-stand-h);
}
.tv-display--stand::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 30%; height: 4px;
  margin-left: -15%;
  background: linear-gradient(180deg, #1a1f2e 0%, #0a0d18 100%);
  border-radius: 2px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}
.tv-display--stand::before {
  content: '';
  position: absolute;
  bottom: 4px; left: 35%; right: 35%;
  height: var(--tv-stand-h);
  background: linear-gradient(180deg, #1a1f2e 0%, #0a0d18 100%);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  z-index: -1;
}

/* Size variants */
.tv-display--sm { width: 320px; }
.tv-display--md { width: 480px; }
.tv-display--lg { width: 640px; }
.tv-display--xl { width: 800px; }
.tv-display--full { width: 100%; max-width: 800px; }

/* "ON air" pulse dot — used in headers */
.tv-display__live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff5c5c;
  margin-right: 6px;
  animation: tv-live-pulse 1.6s infinite;
  vertical-align: middle;
}
@keyframes tv-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,92,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(255,92,92,0); }
}


/* =============================================================
   UI MOCKUP 1 — APPLE TV HOME
   ============================================================= */
.ui-appletv {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 30%, #1a2a4a 0%, #050810 70%);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', system-ui, sans-serif;
}
.ui-appletv__topbar {
  display: flex; align-items: center; gap: 14px;
  font-size: 9px; color: rgba(255,255,255,0.55);
  font-weight: 600;
}
.ui-appletv__topbar-item.active { color: #fff; border-bottom: 2px solid #fff; padding-bottom: 2px; }
.ui-appletv__feature {
  flex: 1.4;
  background: linear-gradient(135deg, #2b4ca8 0%, #6028a8 100%);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; overflow: hidden;
  animation: appletv-feature-glow 4s ease-in-out infinite;
}
@keyframes appletv-feature-glow {
  0%, 100% { background: linear-gradient(135deg, #2b4ca8 0%, #6028a8 100%); }
  50% { background: linear-gradient(135deg, #6028a8 0%, #2b4ca8 100%); }
}
.ui-appletv__feature-title { color: #fff; font-size: 14px; font-weight: 800; }
.ui-appletv__feature-sub { color: rgba(255,255,255,0.75); font-size: 9px; margin-top: 2px; }
.ui-appletv__row {
  display: flex; gap: 6px;
  flex: 1;
}
.ui-appletv__tile {
  flex: 1;
  background: linear-gradient(135deg, var(--c1, #444) 0%, var(--c2, #222) 100%);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.ui-appletv__tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.6) 100%);
}
.ui-appletv__tile:nth-child(1) { --c1: #e50914; --c2: #831010; }   /* Netflix red */
.ui-appletv__tile:nth-child(2) { --c1: #0a3e9e; --c2: #051a4a; }   /* Disney blue */
.ui-appletv__tile:nth-child(3) { --c1: #6c2bd9; --c2: #2d0e6b; }   /* Max purple */
.ui-appletv__tile:nth-child(4) { --c1: #00a8e1; --c2: #00567a; }   /* Prime blue */
.ui-appletv__tile:nth-child(5) { --c1: #1ce783; --c2: #0c7a40; }   /* Hulu green */
.ui-appletv__tile.is-hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px #fff, 0 6px 20px rgba(255,255,255,0.18);
  z-index: 2;
  animation: appletv-hover-cycle 5s infinite;
}
@keyframes appletv-hover-cycle {
  0% { transform: scale(1.06); }
  18%, 22% { transform: scale(1); }
  /* hand-off back to default scale + slide focus visually */
}


/* =============================================================
   UI MOCKUP 2 — ROKU HOME
   ============================================================= */
.ui-roku {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #6a2cc9 0%, #4a1d8f 100%);
  padding: 14px;
  display: flex;
  gap: 10px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ui-roku__sidebar {
  flex: 0 0 60px;
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 18px;
}
.ui-roku__nav-item {
  width: 100%; padding: 4px 6px;
  color: rgba(255,255,255,0.6);
  font-size: 8px;
  font-weight: 700;
  border-radius: 3px;
}
.ui-roku__nav-item.active { color: #fff; background: rgba(255,255,255,0.15); }
.ui-roku__grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding-top: 8px;
}
.ui-roku__app {
  aspect-ratio: 16/10;
  background: var(--app-color, #2a2a2a);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 9px;
  position: relative;
}
.ui-roku__app:nth-child(1)  { background: #e50914; }   /* Netflix */
.ui-roku__app:nth-child(2)  { background: #0a3e9e; }   /* Disney+ */
.ui-roku__app:nth-child(3)  { background: #6c2bd9; }   /* Max */
.ui-roku__app:nth-child(4)  { background: #00a8e1; }   /* Prime */
.ui-roku__app:nth-child(5)  { background: #1ce783; }   /* Hulu */
.ui-roku__app:nth-child(6)  { background: #ff0033; }   /* Peacock */
.ui-roku__app:nth-child(7)  { background: #ff0030; }   /* YouTube */
.ui-roku__app:nth-child(8)  { background: #783cdb; }   /* Roku Channel */
.ui-roku__app.is-focus {
  box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(255,255,255,0.30);
  transform: scale(1.04);
  z-index: 2;
  animation: roku-focus-pulse 2s ease-in-out infinite;
}
@keyframes roku-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(255,255,255,0.30); }
  50% { box-shadow: 0 0 0 3px #ffe138, 0 6px 18px rgba(255,225,56,0.45); }
}


/* =============================================================
   UI MOCKUP 3 — TUBI BROWSE (free movies horizontal scroll)
   ============================================================= */
.ui-tubi {
  position: absolute; inset: 0;
  background: #0c001a;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}
.ui-tubi__header {
  display: flex; justify-content: space-between; align-items: center;
}
.ui-tubi__logo {
  font-size: 16px; font-weight: 900;
  background: linear-gradient(135deg, #fa6400 0%, #ff0084 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}
.ui-tubi__free-pill {
  font-size: 8px; font-weight: 800;
  color: #fa6400; background: rgba(250,100,0,0.15);
  padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(250,100,0,0.35);
}
.ui-tubi__row-label {
  font-size: 10px; font-weight: 800; color: #fff;
  letter-spacing: 0.04em;
}
.ui-tubi__carousel {
  display: flex; gap: 6px;
  animation: tubi-scroll 16s linear infinite;
  width: max-content;
}
.ui-tubi__poster {
  flex: 0 0 70px;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, var(--p1, #6a2cc9) 0%, var(--p2, #1a0040) 100%);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.ui-tubi__poster:nth-child(odd)  { --p1: #fa6400; --p2: #5a0a3d; }
.ui-tubi__poster:nth-child(3n)   { --p1: #ff0084; --p2: #2a002a; }
.ui-tubi__poster:nth-child(4n)   { --p1: #0aa3e1; --p2: #002a4a; }
.ui-tubi__poster:nth-child(5n)   { --p1: #1ce783; --p2: #0c4d2a; }
@keyframes tubi-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}


/* =============================================================
   UI MOCKUP 4 — YOUTUBE TV CHANNEL GUIDE
   ============================================================= */
.ui-ytv {
  position: absolute; inset: 0;
  background: #0c0c0c;
  padding: 12px;
  display: flex; flex-direction: column;
  font-family: 'Roboto', system-ui, sans-serif;
}
.ui-ytv__topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.ui-ytv__logo {
  color: #fff; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; gap: 4px;
}
.ui-ytv__logo-mark {
  display: inline-block;
  background: #ff0000; color: #fff;
  font-weight: 900;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
}
.ui-ytv__now-pill {
  font-size: 9px; color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08);
  padding: 3px 8px; border-radius: 999px;
}
.ui-ytv__channel-list {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  overflow: hidden;
}
.ui-ytv__channel {
  display: grid;
  grid-template-columns: 56px 1fr 40px;
  gap: 8px; align-items: center;
  background: rgba(255,255,255,0.04);
  padding: 6px 8px;
  border-radius: 4px;
}
.ui-ytv__channel.is-live { background: rgba(255,0,0,0.10); border: 1px solid rgba(255,0,0,0.30); }
.ui-ytv__channel-logo {
  background: var(--ch-c, #444);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 4px 0;
  border-radius: 3px;
}
.ui-ytv__channel-title { color: #fff; font-size: 10px; font-weight: 700; }
.ui-ytv__channel-show { color: rgba(255,255,255,0.55); font-size: 8px; margin-top: 1px; }
.ui-ytv__channel-time { color: rgba(255,255,255,0.65); font-size: 8px; text-align: right; font-weight: 600; }
.ui-ytv__channel:nth-child(1) .ui-ytv__channel-logo { background: #c00; }
.ui-ytv__channel:nth-child(2) .ui-ytv__channel-logo { background: #ff0033; }
.ui-ytv__channel:nth-child(3) .ui-ytv__channel-logo { background: #0a3e9e; }
.ui-ytv__channel:nth-child(4) .ui-ytv__channel-logo { background: #1ce783; }
.ui-ytv__channel:nth-child(5) .ui-ytv__channel-logo { background: #f6a800; }


/* =============================================================
   UI MOCKUP 5 — PLEX FAST CHANNELS
   ============================================================= */
.ui-plex {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #1f1f1f 0%, #0a0a0a 100%);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ui-plex__header {
  display: flex; align-items: center; gap: 8px;
}
.ui-plex__logo {
  color: #e5a00d; font-weight: 900; font-size: 14px;
  letter-spacing: -0.02em;
}
.ui-plex__tagline { color: rgba(255,255,255,0.55); font-size: 9px; font-weight: 600; }
.ui-plex__category {
  display: flex; gap: 6px;
  font-size: 8px;
  flex-wrap: wrap;
}
.ui-plex__category-chip {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.ui-plex__category-chip.active {
  background: #e5a00d;
  color: #0a0a0a;
}
.ui-plex__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
}
.ui-plex__channel-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.ui-plex__channel-name {
  color: #fff; font-size: 9px; font-weight: 800; line-height: 1.2;
}
.ui-plex__channel-now {
  color: rgba(255,255,255,0.6); font-size: 7px; margin-top: 4px;
}
.ui-plex__channel-card.is-live { border-color: #e5a00d; box-shadow: 0 0 8px rgba(229,160,13,0.30); }
.ui-plex__channel-card.is-live::before {
  content: 'LIVE'; color: #e5a00d; font-size: 7px; font-weight: 900;
  letter-spacing: 0.08em; margin-bottom: 4px;
}


/* =============================================================
   UI MOCKUP 6 — CABLE STREAMING BOX GUIDE (Xumo / Fios Stream 2 generic)
   ============================================================= */
.ui-cable {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #0a0c14 0%, #050810 100%);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ui-cable__topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; color: rgba(255,255,255,0.55);
}
.ui-cable__time { color: #fff; font-weight: 800; }
.ui-cable__featured {
  background: linear-gradient(135deg, #003ea1 0%, #001a5a 100%);
  border-radius: 6px; padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
}
.ui-cable__featured-thumb {
  width: 60px; height: 38px;
  background: linear-gradient(135deg, #2bbef9 0%, #003a85 100%);
  border-radius: 3px;
  flex-shrink: 0;
}
.ui-cable__featured-text { flex: 1; min-width: 0; }
.ui-cable__featured-label {
  color: #2bbef9; font-size: 8px; font-weight: 800; letter-spacing: 0.08em;
}
.ui-cable__featured-title {
  color: #fff; font-size: 11px; font-weight: 700; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ui-cable__featured-meta {
  color: rgba(255,255,255,0.55); font-size: 8px; margin-top: 1px;
}
.ui-cable__guide {
  flex: 1;
  display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
}
.ui-cable__row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 6px; align-items: stretch;
  font-size: 8px;
}
.ui-cable__ch {
  background: rgba(255,255,255,0.05);
  color: #fff; font-weight: 800;
  text-align: center;
  padding: 4px 0;
  border-radius: 3px;
  display: flex; flex-direction: column; justify-content: center;
}
.ui-cable__ch-num { font-size: 10px; }
.ui-cable__ch-call { font-size: 6px; opacity: 0.7; }
.ui-cable__slot {
  background: rgba(255,255,255,0.04);
  padding: 4px 8px;
  border-radius: 3px;
  display: flex; align-items: center;
  color: #fff;
  position: relative;
}
.ui-cable__slot.is-now {
  background: linear-gradient(90deg, rgba(0,180,255,0.20) 0%, rgba(0,180,255,0.04) 60%, rgba(0,180,255,0.04) 100%);
  border-left: 2px solid #00b4ff;
}
.ui-cable__slot.is-now::before {
  content: '●'; color: #00b4ff; margin-right: 4px;
  animation: cable-now-pulse 1.4s infinite;
}
@keyframes cable-now-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


/* =============================================================
   Display row layout (when you put multiple TVs side-by-side)
   ============================================================= */
.tv-display-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 16px;
}
.tv-display-cell {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
}
.tv-display-caption {
  text-align: center;
}
.tv-display-caption .label {
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 800;
}
.tv-display-caption .name {
  color: #e8edf7;
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}
.tv-display-caption .sub {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.5;
  max-width: 280px;
}
.tv-display-caption .disclaimer,
.sc-tv-demo-disclaimer,
.tv-display__disclaimer {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  border-radius: 999px;
  white-space: nowrap;
}
/* "LAYOUT PREVIEW" badge — ONLY on demos using CSS mockups, not real video/image */
.tv-display[data-mode="cartoon"] .tv-display__screen::before {
  content: '🎨 Layout preview · real recording coming';
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 12;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.45);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ====================================================================
   REAL VIDEO MODE — wraps an autoplay/muted/loop MP4 in the TV bezel
   Usage:
   <div class="tv-display" data-mode="video">
     <div class="tv-display__chassis">
       <div class="tv-display__screen">
         <video class="tv-display__video" src="/assets/videos/ui-loops/roku-home.mp4" autoplay muted loop playsinline></video>
       </div>
     </div>
   </div>
   ==================================================================== */
.tv-display__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}
/* "ACTUAL UI" badge on real recordings — green, confidence-builder */
.tv-display[data-mode="video"] .tv-display__screen::before,
.tv-display[data-mode="photo"] .tv-display__screen::before {
  content: '● ACTUAL UI';
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 12;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 800;
  color: #38d399;
  background: rgba(0,0,0,0.55);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* REAL PHOTO MODE — high-res screenshot in the TV bezel */
.tv-display__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Mobile — scale gracefully */
@media (max-width: 600px) {
  .tv-display { width: 100%; max-width: 360px; }
}
