/* tv.css - Pixel-Perfect Android TV Reference Interface & Responsive Engine */
:root {
  --bg-main: #05080e;
  --bg-surface: #0a0f18;
  --bg-rail: #070d16;
  --bg-card: #0f172a;
  --primary-blue: #1d4ed8;
  --primary-blue-glow: rgba(29, 78, 216, 0.45);
  --accent-cyan: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --red-live: #ef4444;
  --yellow-accent: #eab308;
  --green-accent: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #030712;
  color: var(--text-primary);
  overflow-x: hidden;
  user-select: none;
}

/* Utility Bar on top */
.preview-utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  background: #020617;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  z-index: 1000;
  position: relative;
}

.utility-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-status {
  color: var(--green-accent);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.live-pulse {
  animation: pulse 1.5s infinite;
  font-size: 9px;
  margin-right: 4px;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.platform-indicator {
  color: var(--text-secondary);
}

.utility-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.mode-btn.active, .mode-btn:hover {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--accent-cyan);
}

.admin-link-btn {
  color: #fff;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.admin-link-btn:hover {
  background: rgba(56, 189, 248, 0.3);
}

.admin-link-btn.api-btn {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

/* TV Viewport Container */
.tv-viewport-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 16px;
}

/* 16:9 Android TV Screen */
.tv-screen {
  width: 100%;
  max-width: 1440px;
  min-height: 820px;
  background: radial-gradient(circle at 75% 20%, #172133 0%, var(--bg-main) 65%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

/* TOP NAVIGATION BAR */
.tv-top-bar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-logo-area {
  display: flex;
  align-items: baseline;
  gap: 4px;
  cursor: pointer;
}

.logo-num {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.logo-word {
  font-size: 19px;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 1px;
}

.tv-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab:hover, .nav-tab:focus {
  color: #fff;
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-blue-glow);
}

.tv-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: color 0.2s;
}

.icon-action-btn:hover, .icon-action-btn:focus {
  color: #fff;
}

.tv-clock {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  min-width: 75px;
  text-align: right;
}

/* MAIN CENTRAL STAGE (Rail + Preview) */
.tv-main-stage {
  display: grid;
  grid-template-columns: 310px 1fr;
  flex: 1;
  gap: 20px;
  padding: 16px 28px 12px 28px;
  overflow: hidden;
}

/* LEFT RAIL: ALL CHANNELS */
.tv-channel-rail {
  background: rgba(10, 16, 26, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 200px);
  max-height: 670px;
}

.rail-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.rail-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.8px;
}

.rail-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.rail-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-channel-list::-webkit-scrollbar {
  width: 4px;
}
.rail-channel-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Individual Channel Item */
.channel-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease-out;
  border-radius: 8px;
  margin: 0 6px;
}

.channel-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Active / Focused Channel Item in Left Rail */
.channel-row.focused {
  background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.4);
  outline: 2px solid var(--accent-cyan);
}

.ch-fav-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
}

.ch-fav-btn.is-fav {
  color: #f59e0b;
}

.ch-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 18px;
}

.channel-row.focused .ch-num {
  color: #fff;
}

.ch-logo-wrap {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ch-logo-wrap img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.ch-info-col {
  flex: 1;
  min-width: 0;
}

.ch-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-show {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.channel-row.focused .ch-show {
  color: #e2e8f0;
}

.ch-signal-icon {
  font-size: 11px;
  color: var(--accent-cyan);
}

/* Progress bar inside active rail row */
.ch-rail-progress-track {
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.ch-rail-progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  width: 45%;
}

.rail-expand-btn {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.rail-expand-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* RIGHT PANEL: LIVE PREVIEW & CONTENT */
.tv-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 670px;
  padding-right: 4px;
}

.tv-preview-panel::-webkit-scrollbar {
  width: 4px;
}
.tv-preview-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* 16:9 Video Player Box */
.video-stage {
  width: 100%;
  height: 310px;
  background: #000;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

#tv-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.live-pill-badge {
  background: var(--red-live);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.live-pill-badge i {
  font-size: 7px;
  animation: pulse 1.2s infinite;
}

.preview-watermark {
  max-height: 48px;
  max-width: 90px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}

.video-audio-toggle {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.video-audio-toggle:hover {
  background: var(--primary-blue);
}

/* Metadata below Video */
.preview-meta-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.meta-headline-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.preview-program-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.preview-time-range {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.preview-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 0 4px 0;
}

.preview-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-cyan));
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: width 0.3s ease;
}

.meta-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-description {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  max-width: 80%;
  line-height: 1.4;
}

.more-info-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.more-info-btn:hover, .more-info-btn:focus {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  outline: none;
}

/* HORIZONTAL SECTION ROWS (Categories & Apps) */
.tv-row-block {
  margin-top: 6px;
}

.row-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

/* Categories Row */
.categories-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.categories-scroll-row::-webkit-scrollbar {
  height: 3px;
}
.categories-scroll-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.category-tile {
  flex: 0 0 120px;
  height: 74px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, outline 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-tile:hover, .category-tile.focused {
  transform: translateY(-3px) scale(1.04);
  outline: 2px solid #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.category-tile i {
  font-size: 20px;
  color: #fff;
}

.category-tile span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
}

/* OTT Apps Row */
.apps-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.apps-scroll-row::-webkit-scrollbar {
  height: 3px;
}
.apps-scroll-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.app-tile {
  flex: 0 0 120px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, outline 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
}

.app-tile:hover, .app-tile.focused {
  transform: translateY(-3px) scale(1.04);
  outline: 2px solid #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.app-logo-text {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.2px;
}

/* BOTTOM CONTROL BAR */
.tv-bottom-bar {
  height: 48px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 8, 14, 0.85);
  font-size: 12px;
}

.remote-key-hints {
  display: flex;
  align-items: center;
  gap: 22px;
}

.key-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.key-hint:hover {
  color: #fff;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.red-dot { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.yellow-dot { background: #eab308; box-shadow: 0 0 6px rgba(234, 179, 8, 0.6); }
.green-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }

.network-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 600;
}

.network-status-indicator i {
  color: var(--accent-cyan);
}

/* D-PAD HELPER OVERLAY */
.dpad-helper-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  font-size: 12px;
  max-width: 280px;
}

.dpad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.close-helper {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.dpad-keys-guide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

kbd {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.helper-toggle-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary-blue);
  color: #fff;
  border: 1px solid var(--accent-cyan);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 9998;
}

/* MODALS */
.tv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.tv-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.tv-modal {
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  width: 90%;
  max-width: 580px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

/* Search Modal Input */
.search-input-wrapper input {
  width: 100%;
  padding: 12px 16px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  outline: none;
  margin-bottom: 14px;
}

.search-input-wrapper input:focus {
  border-color: var(--accent-cyan);
}

.search-results-area {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #1e293b;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-item-row:hover {
  background: var(--primary-blue);
}

/* PIN Keypad */
.pin-display {
  font-size: 32px;
  letter-spacing: 12px;
  text-align: center;
  margin: 16px 0;
  font-weight: 800;
  color: var(--yellow-accent);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}

.pin-key {
  height: 48px;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.pin-key:hover {
  background: var(--primary-blue);
}

.pin-key.verify {
  background: var(--green-accent);
}

.pin-status {
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
  font-weight: 600;
}

/* TV Pairing Modal */
.pairing-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.highlight-url {
  font-size: 20px;
  color: var(--accent-cyan);
  display: block;
  margin: 6px 0;
}

.pairing-code-box {
  background: #020617;
  border: 2px dashed var(--accent-cyan);
  border-radius: 12px;
  padding: 16px 36px;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #fff;
  text-shadow: 0 0 12px var(--accent-cyan);
}

.pairing-actions, .record-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.primary-btn {
  background: var(--primary-blue);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.help-item {
  background: #1e293b;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-item strong {
  color: var(--accent-cyan);
  font-size: 13px;
}

.help-item span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* MOBILE MODE RESPONSIVE ADAPTATION */
body.mobile-mode .tv-viewport-container {
  padding: 20px 0;
}

body.mobile-mode .tv-screen {
  max-width: 412px; /* Standard Pixel / Galaxy Mobile width */
  min-height: 840px;
  border-radius: 36px;
  border: 4px solid #334155;
}

body.mobile-mode .tv-main-stage {
  grid-template-columns: 1fr;
  padding: 12px;
  overflow-y: auto;
}

body.mobile-mode .tv-channel-rail {
  height: 280px;
}

body.mobile-mode .video-stage {
  height: 210px;
}

body.mobile-mode .tv-top-bar {
  padding: 0 14px;
}

body.mobile-mode .tv-nav-tabs {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   FULLSCREEN MODE — Professional Channel Player Overlay
   ═══════════════════════════════════════════════════════════════ */

/* Fullscreen expand button on video-stage */
.fs-toggle-btn {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  z-index: 10;
}
.fs-toggle-btn:hover { background: var(--primary-blue); }

/* The fullscreen overlay wrapper — hidden by default */
.fs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: transparent;   /* ← transparent so video behind shows through */
  flex-direction: column;
  cursor: default;
}
.fs-overlay.active {
  display: flex;
}

/* Video fills the entire screen in fullscreen */
.fs-overlay.active ~ * { display: none !important; }
body.fs-mode #tv-video-player {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  z-index: 8999;
  background: #000;
}

/* Controls visibility — shown on interaction, hidden by default */
.fs-overlay.fs-controls-visible .fs-top-bar,
.fs-overlay.fs-controls-visible .fs-bottom-bar,
body.fs-controls-visible .fs-top-bar,
body.fs-controls-visible .fs-bottom-bar {
  opacity: 1 !important;
  pointer-events: all !important;
  transform: translateY(0) !important;
}

/* TOP BAR */
.fs-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px 40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.fs-top-left { display: flex; align-items: center; gap: 20px; }
.fs-channel-info { display: flex; align-items: center; gap: 12px; }
.fs-logo {
  height: 44px; width: 44px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  object-fit: contain;
  padding: 4px;
}
.fs-channel-name {
  font-size: 20px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.fs-program-name {
  font-size: 13px; font-weight: 500; color: #cbd5e1;
  margin-top: 2px;
}
.fs-top-right { display: flex; align-items: center; gap: 20px; }
.fs-clock { font-size: 18px; font-weight: 700; color: #e2e8f0; }
.fs-close-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.fs-close-btn:hover { background: var(--primary-blue); }

/* CENTER ZONE */
.fs-center-zone {
  position: fixed;
  inset: 0;
  z-index: 9050;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}
.fs-play-indicator {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.fs-play-indicator.flash {
  opacity: 1;
  animation: fsFlash 0.7s forwards;
}
@keyframes fsFlash {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 0.8; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* BOTTOM BAR */
.fs-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9100;
  padding: 40px 32px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  display: flex; flex-direction: column; gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Progress row */
.fs-progress-row {
  display: flex; align-items: center; gap: 12px;
}
.fs-progress-track {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px; overflow: hidden;
  cursor: pointer;
}
.fs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-cyan));
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: width 0.5s linear;
}
.fs-time-label {
  font-size: 12px; font-weight: 600; color: #94a3b8;
  white-space: nowrap; min-width: 80px;
}
#fs-prog-title { color: #e2e8f0; font-size: 13px; font-weight: 700; }

/* Main action row */
.fs-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.fs-action-center {
  display: flex; align-items: center; gap: 16px;
}

/* Action buttons */
.fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}
.fs-btn-primary {
  background: var(--primary-blue);
  color: #fff;
  padding: 14px 28px;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(29,78,216,0.5);
}
.fs-btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 0 30px rgba(29,78,216,0.8);
  transform: scale(1.04);
}
.fs-btn-secondary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 12px 20px;
}
.fs-btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.04);
}
.fs-btn-icon {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 48px; height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  justify-content: center;
}
.fs-btn-icon:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

/* Extra action pills row */
.fs-extra-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fs-extra-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.fs-extra-btn:hover {
  background: var(--primary-blue);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29,78,216,0.4);
}
.fs-extra-btn i { font-size: 13px; }

/* Cursor auto-hide */
body.fs-mode { cursor: none; }
body.fs-mode.fs-controls-visible { cursor: default; }

/* Keyboard hint in fullscreen */
.fs-key-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  z-index: 9200;
  transition: opacity 0.3s;
  white-space: nowrap;
}
.fs-key-hint.show { opacity: 1; }

