/* Lumora Legacy TV - Estilo Ultra-Leve para Smart TVs Antigas */
/* Compatível com webOS 1-3, Tizen 2.x, Chromium 38+ e navegadores limitados */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #09090e;
  color: #f3f4f6;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

/* Header & Menu Superior da TV */
.tv-header {
  background-color: #12121c;
  border-bottom: 2px solid #232336;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
}

.tv-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tv-logo-img {
  height: 34px;
  width: 34px;
  object-fit: contain;
  vertical-align: middle;
}

.tv-logo-badge {
  background: #e50914;
  color: #ffffff;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 4px;
}

.tv-logo-tag {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
  background: #232336;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.tv-nav {
  display: flex;
  align-items: center;
}

.tv-nav-link {
  display: inline-block;
  color: #9ca3af;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 8px 18px;
  margin: 0 4px;
  border-radius: 6px;
  border: 2px solid transparent;
  background-color: transparent;
}

.tv-nav-link.active {
  color: #ffffff;
  background-color: #232336;
}

/* Indicador de Status VIP / Conexão */
.tv-header-status {
  display: flex;
  align-items: center;
}

.tv-status-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  display: inline-block;
  border: 2px solid transparent;
}

.tv-status-badge.vip {
  background-color: #ca8a04;
  color: #000000;
  font-weight: 800;
}

.tv-status-badge.guest {
  background-color: #262638;
  color: #e5e7eb;
}

/* Conteúdo Principal */
.tv-main {
  padding: 24px 28px 60px 28px;
}

/* Fileiras de Conteúdo (Filmes / Séries / TV) */
.tv-section {
  margin-bottom: 34px;
}

.tv-section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tv-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.tv-section-link {
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 2px solid transparent;
}

/* Container de Rolagem Horizontal de Cards */
.tv-row {
  display: flex;
  overflow-x: hidden;
  padding: 10px 4px;
  margin: -10px -4px;
}

/* Cards de Filmes e Séries (Estilo Pôster Vertical) */
.tv-card-poster {
  flex: 0 0 160px;
  width: 160px;
  margin-right: 16px;
  background-color: #161622;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid transparent;
  text-decoration: none;
  color: #ffffff;
  display: block;
}

.tv-poster-thumb {
  width: 100%;
  height: 230px;
  background-color: #202030;
  display: block;
  object-fit: cover;
  border-radius: 5px 5px 0 0;
}

.tv-poster-info {
  padding: 8px 10px 10px 10px;
}

.tv-poster-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.tv-poster-meta {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  display: block;
}

/* Cards de Canais de TV Ao Vivo (Estilo Horizontal) */
.tv-card-channel {
  flex: 0 0 210px;
  width: 210px;
  margin-right: 16px;
  background-color: #161622;
  border-radius: 8px;
  padding: 12px;
  border: 3px solid transparent;
  text-decoration: none;
  color: #ffffff;
  display: block;
}

.tv-channel-badge {
  display: inline-block;
  background-color: #2a2a3e;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.tv-channel-badge.free {
  background-color: #15803d;
  color: #ffffff;
}

.tv-channel-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.tv-channel-cat {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  display: block;
}

/* Grid Completo (Para páginas "Ver Todos") */
.tv-grid {
  display: flex;
  flex-wrap: wrap;
  margin: -8px;
}

.tv-grid .tv-card-poster {
  flex: 0 0 calc(16.666% - 16px);
  margin: 8px;
}

.tv-grid .tv-card-channel {
  flex: 0 0 calc(25% - 16px);
  margin: 8px;
}

/* Paginação Simples para TV */
.tv-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.tv-btn {
  display: inline-block;
  background-color: #222234;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  border: 3px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.tv-btn-primary {
  background-color: #e50914;
  color: #ffffff;
  font-weight: 700;
}

/* =====================================================================
   SISTEMA DE FOCO VISUAL DO CONTROLE REMOTO (ALTO CONTRASTE)
   ===================================================================== */
.tv-item {
  transition: transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

/* O elemento focado no controle remoto ou apontado pelo mouse */
.tv-focused,
.tv-item:hover {
  border-color: #f59e0b !important; /* Dourado/Amarelo vibrante */
  background-color: #27273d !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.7) !important;
  transform: scale(1.05);
  z-index: 50;
  position: relative;
}

/* Página de Detalhes (Filme/Série) */
.tv-details-wrap {
  display: flex;
  gap: 32px;
  background-color: #12121d;
  border-radius: 12px;
  padding: 28px;
  border: 2px solid #232338;
}

.tv-details-poster {
  width: 260px;
  height: 380px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #202030;
  flex-shrink: 0;
}

.tv-details-info {
  flex: 1;
}

.tv-details-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.tv-details-meta {
  font-size: 15px;
  color: #a1a1aa;
  margin-bottom: 16px;
}

.tv-details-synopsis {
  font-size: 16px;
  color: #d4d4d8;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Seletor de Temporadas e Episódios */
.tv-seasons-bar {
  display: flex;
  gap: 10px;
  margin: 20px 0 16px 0;
}

.tv-season-btn {
  padding: 8px 18px;
  background-color: #1e1e2d;
  border: 2px solid transparent;
  color: #d1d5db;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.tv-season-btn.active {
  background-color: #e50914;
  color: #ffffff;
}

.tv-episodes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tv-episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #161624;
  padding: 14px 20px;
  border-radius: 6px;
  border: 3px solid transparent;
  text-decoration: none;
  color: #ffffff;
}

.tv-episode-num {
  font-weight: 700;
  color: #e50914;
  margin-right: 14px;
  font-size: 16px;
}

.tv-episode-title {
  font-size: 16px;
  font-weight: 600;
}

.tv-episode-duration {
  font-size: 13px;
  color: #9ca3af;
}

/* Player VOD e TV em Tela Cheia */
.tv-player-container {
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-video-element {
  width: 100%;
  height: 100%;
  background-color: #000000;
}

.tv-player-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1010;
  transition: opacity 0.3s ease;
}

.tv-player-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.tv-player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-player-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.tv-player-time {
  font-size: 15px;
  color: #cbd5e1;
  font-family: monospace;
}

.tv-progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.tv-progress-bar-fill {
  height: 100%;
  background-color: #e50914;
  width: 0%;
}

/* Mensagem de Erro Amigável para TV */
.tv-error-box {
  background-color: #1e1e2d;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  text-align: center;
  margin: 40px auto;
}

.tv-error-title {
  font-size: 20px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 10px;
}

.tv-error-desc {
  font-size: 15px;
  color: #d1d5db;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* Tela de Ativação da TV */
.tv-activate-container {
  max-width: 650px;
  margin: 40px auto;
  background-color: #12121e;
  border: 2px solid #28283d;
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
}

.tv-activate-code-box {
  background-color: #1c1c2e;
  border: 3px dashed #f59e0b;
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
}

.tv-activate-code {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 12px;
  color: #f59e0b;
  font-family: monospace;
}

.tv-activate-steps {
  text-align: left;
  margin: 20px auto;
  max-width: 440px;
  color: #d1d5db;
  font-size: 16px;
}

.tv-activate-steps li {
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Painel de Diagnóstico */
.tv-diag-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.tv-diag-table th, .tv-diag-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #232336;
}

.tv-diag-table th {
  background-color: #181826;
  color: #9ca3af;
}

.tv-diag-status-ok {
  color: #22c55e;
  font-weight: 700;
}

.tv-diag-status-fail {
  color: #ef4444;
  font-weight: 700;
}

/* Responsividade Básica (720p vs 1080p) */
@media (max-width: 1280px) {
  body {
    font-size: 14px;
  }
  .tv-card-poster {
    flex: 0 0 130px;
    width: 130px;
  }
  .tv-poster-thumb {
    height: 190px;
  }
  .tv-card-channel {
    flex: 0 0 170px;
    width: 170px;
  }
}

/* Card Central de Sintonização de Canal (Zero tela preta) */
.tv-tuning-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(14, 14, 22, 0.94);
  border: 2px solid #2a2a40;
  border-radius: 16px;
  padding: 36px 44px;
  text-align: center;
  z-index: 1020;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.9);
  max-width: 480px;
  width: 90%;
}

.tv-tuning-logo-wrap {
  margin: 0 auto 16px auto;
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.tv-tuning-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tv-tuning-badge {
  display: inline-block;
  background: #e50914;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.tv-tuning-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.tv-tuning-status {
  font-size: 14px;
  color: #f59e0b;
  font-weight: 600;
  margin-bottom: 18px;
  min-height: 20px;
}

.tv-tuning-progress-wrap {
  width: 100%;
  height: 6px;
  background: #1f1f30;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.tv-tuning-progress-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #e50914, #f59e0b);
  border-radius: 3px;
  animation: tvTuningAnim 1.6s infinite ease-in-out;
}

@keyframes tvTuningAnim {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(300%); }
}

.tv-tuning-tip {
  font-size: 12px;
  color: #64748b;
}

/* Guia de Canais Embutido no Player (EPG 2 Colunas + Busca) */
.tv-epg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 580px;
  max-width: 92vw;
  background: rgba(10, 10, 16, 0.98);
  border-right: 2px solid #232336;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.9);
}

.tv-epg-overlay.hidden {
  display: none !important;
}

.tv-epg-header {
  padding: 14px 18px 12px 18px;
  border-bottom: 1px solid #1f1f30;
  background: #0e0e18;
}

.tv-epg-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-epg-search-wrap {
  margin-top: 8px;
}

.tv-epg-search-input {
  width: 100%;
  background: #181826;
  border: 1.5px solid #2e2e48;
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.tv-epg-search-input:focus,
.tv-epg-search-input.tv-focused {
  border-color: #f59e0b !important;
  background: #202034 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6) !important;
}

.tv-epg-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Coluna 1: Sidebar de Categorias Verticais (Esquerda) */
.tv-epg-sidebar {
  width: 190px;
  border-right: 1.5px solid #1e1e2e;
  background: #10101a;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.tv-epg-cat-btn {
  background: #161624;
  color: #9ca3af;
  border: 1.5px solid #232338;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.tv-epg-cat-btn.active {
  background: #ca8a04;
  color: #000000;
  border-color: #ca8a04;
}

.tv-epg-cat-btn.tv-focused,
.tv-epg-cat-btn:hover {
  outline: none;
  border-color: #f59e0b !important;
  background: #f59e0b !important;
  color: #000000 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8) !important;
  transform: translateX(4px);
}

/* Coluna 2: Painel de Canais (Direita) */
.tv-epg-channels-panel {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.tv-epg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #141420;
  border: 2px solid transparent;
  margin-bottom: 8px;
  text-decoration: none;
  color: #f3f4f6;
  transition: all 0.15s ease;
}

.tv-epg-item.active-channel {
  background: #1f1a28;
  border-color: #f59e0b;
}

.tv-epg-item.tv-focused,
.tv-epg-item:hover,
.tv-epg-item:focus {
  outline: none;
  border-color: #ffffff !important;
  background: #272740 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(229, 9, 20, 0.9), inset 0 0 8px rgba(255, 255, 255, 0.2);
  transform: translateX(6px);
}

.tv-epg-item-logo {
  height: 28px;
  width: 44px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 4px;
  border-radius: 4px;
}

.tv-epg-item-num {
  font-size: 13px;
  font-weight: 800;
  color: #f59e0b;
  min-width: 26px;
}

.tv-epg-item-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Banner de Próximo Episódio com Contagem Regressiva */
.tv-next-episode-card {
  position: absolute;
  bottom: 40px;
  right: 40px;
  background: rgba(15, 23, 42, 0.96);
  border: 2px solid #f59e0b;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 158, 11, 0.35);
  padding: 22px 28px;
  border-radius: 12px;
  z-index: 1200;
  max-width: 440px;
  text-align: center;
}

