/**
 * live.css
 * ------------------------------------------------------------------
 * Estilo do Navegador de TV Ao Vivo (Live TV) estilo XCIPTV / TiviMate:
 * Modo 1: Guia EPG (Split View com Mini Player 16:9, progresso em tempo real)
 * Modo 2: Grade de Canais (Grid View com sidebar de categorias)
 * ------------------------------------------------------------------
 */

.live-container {
  width: 100%;
  height: calc(100vh - 64px);
  display: flex;
  overflow: hidden;
}

/* --- MODO 1: GUIA EPG / SPLIT VIEW 3 COLUNAS --- */
.live-split-view {
  width: 100%;
  height: 100%;
  display: flex;
}

/* Coluna 1: Categorias de TV Ao Vivo (270px) */
.live-categories-col {
  width: 270px;
  min-width: 270px;
  height: 100%;
  background: rgba(10, 14, 22, 0.95);
  border-right: 1px solid var(--fktv-border);
  display: flex;
  flex-direction: column;
}

.live-col-header {
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  background: rgba(16, 22, 35, 0.9);
  border-bottom: 1px solid var(--fktv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #7EC8F5;
  text-transform: uppercase;
}

.live-cat-header-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.live-count-badge {
  background: rgba(62, 143, 224, 0.2);
  color: #7EC8F5;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(62, 143, 224, 0.3);
}

.live-categories-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.live-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  margin: 2px 0;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: var(--fktv-text-dim);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.live-cat-item.focused,
.live-cat-item:focus {
  background: var(--fktv-panel-alt);
  border-left-color: var(--fktv-blue-bright);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(62, 143, 224, 0.35);
  outline: none;
}

.live-cat-item.active {
  background: rgba(62, 143, 224, 0.18);
  border-left-color: var(--fktv-blue-bright);
  color: #FFFFFF;
  font-weight: 700;
}

.live-cat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coluna 2: Lista Vertical de Canais (370px) */
.live-channels-col {
  width: 370px;
  min-width: 370px;
  height: 100%;
  background-color: var(--fktv-panel);
  border-right: 1px solid var(--fktv-border);
  display: flex;
  flex-direction: column;
}

/* Barra Superior de Categoria: [<] [CANAIS | CATEGORIA] [>] [Grade] */
.live-cat-bar {
  height: 52px;
  background: rgba(11, 15, 24, 0.9);
  border-bottom: 1px solid var(--fktv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  gap: 6px;
}

.live-nav-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.live-cat-title-wrap {
  flex: 1;
  text-align: center;
  overflow: hidden;
}

.live-cat-title {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

/* Lista de Canais */
.live-channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.channel-list-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(35, 42, 58, 0.3);
}

.channel-list-item.focused,
.channel-list-item:focus {
  background: var(--fktv-panel-alt);
  border-left-color: var(--fktv-blue-bright);
}

.channel-list-item.selected {
  background: rgba(62, 143, 224, 0.15);
  border-left-color: var(--fktv-blue-bright);
}

.channel-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--fktv-text-dim);
  width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.channel-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: rgba(5, 7, 12, 0.5);
  border-radius: 6px;
  padding: 2px;
}

.channel-text {
  flex: 1;
  overflow: hidden;
}

.channel-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-icon {
  color: var(--fktv-gold);
  font-size: 14px;
}

/* Coluna 2: Preview Mini Player + Detalhes + EPG Completo (65% da largura) */
.live-preview-col {
  width: 65%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--fktv-bg);
}

/* Painel Superior: Vídeo Preview Amplo (16:9) + Info do Canal */
.live-top-panel {
  display: flex;
  padding: 18px 24px;
  gap: 24px;
  background-color: var(--fktv-bg-elevated);
  border-bottom: 1px solid var(--fktv-border);
  align-items: stretch;
}

.live-mini-video-wrap {
  width: 540px;
  height: 304px; /* Proporção 16:9 de alto impacto visual */
  flex-shrink: 0;
  background: #000000;
  border-radius: 14px;
  border: 2px solid var(--fktv-glass-border);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.live-mini-video-wrap:focus,
.live-mini-video-wrap.focused,
.live-mini-video-wrap:hover {
  border-color: var(--fktv-blue-bright);
  box-shadow: 0 0 25px rgba(62, 143, 224, 0.45);
}

.live-mini-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #FF2E2E;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 46, 46, 0.4);
  z-index: 5;
}

.live-mini-buffering {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border: 4px solid rgba(62, 143, 224, 0.2);
  border-top-color: var(--fktv-blue-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

.live-mini-expand-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(5, 7, 12, 0.85);
  border: 1px solid var(--fktv-glass-border);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 5;
}

.live-mini-video-wrap:hover .live-mini-expand-hint,
.live-mini-video-wrap.focused .live-mini-expand-hint {
  opacity: 1;
}

.live-channel-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.live-tag-pill {
  display: inline-block;
  background: var(--fktv-blue-subtle);
  border: 1px solid var(--fktv-blue-bright);
  color: var(--fktv-blue-bright);
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  align-self: flex-start;
}

.live-channel-title {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.live-epg-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-epg-time {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fktv-blue-bright);
}

/* Barra Horizontal de Progresso EPG em Tempo Real */
.live-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0;
}

.live-progress-bar {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #3E8FE0, #7EC8F5);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.live-next-show {
  font-size: 12px;
  color: var(--fktv-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-fullscreen-btn {
  align-self: flex-start;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 22px;
  border-radius: 10px;
}

/* Painel Inferior: Guia EPG do Dia */
.live-epg-schedule-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}

.live-epg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.live-epg-header-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--fktv-blue-bright);
  letter-spacing: 0.5px;
}

.live-epg-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.epg-row {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(16, 20, 31, 0.6);
  border: 1px solid rgba(35, 42, 58, 0.4);
  border-radius: 10px;
}

.epg-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--fktv-blue-bright);
  width: 60px;
}

.epg-info {
  flex: 1;
}

.epg-prog-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.epg-prog-desc {
  font-size: 11.5px;
  color: var(--fktv-text-dim);
  line-height: 1.4;
}

.epg-empty {
  text-align: center;
  color: var(--fktv-text-dim);
  font-size: 13px;
  margin: auto;
}

/* --- MODO 2: GRADE DE CANAIS (GRID VIEW) --- */
.live-grid-view {
  width: 100%;
  height: 100%;
  display: flex;
}

.live-grid-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.live-grid-wrap {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.channel-grid-tile {
  background: rgba(16, 20, 31, 0.85);
  border: 1.5px solid var(--fktv-glass-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 140px;
}

.grid-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 10px;
}

.grid-name {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
