/* ============================================================
   TELA DE CANAIS DE TV
   ============================================================ */
#app-container .tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 10px 20px;
    gap: 10px;
}
.tv-title {
    font-family: 'Bebas Neue', 'Impact', -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.tv-title-icon {
    width: 22px;
    height: 22px;
    color: #E50914;
    flex-shrink: 0;
}
.tv-live-badge {
    font-family: -apple-system, sans-serif;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    background: #E50914;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    position: relative;
    animation: tvLivePulse 1.8s ease-in-out infinite;
}
@keyframes tvLivePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.tv-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.tv-search-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.12); }

/* BARRA DE BUSCA */
.tv-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 12px 20px;
    animation: tvFadeDown 0.2s ease;
}
@keyframes tvFadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.tv-search-icon { color: #666; font-size: 14px; }
.tv-search-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    padding: 11px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.tv-search-input::placeholder { color: #666; }
.tv-search-input:focus { border-color: rgba(229,9,20,0.5); }
.tv-search-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 13px;
}
.tv-search-close:active { transform: scale(0.9); }

/* CATEGORIAS */
.tv-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 20px 16px 20px;
    -webkit-overflow-scrolling: touch;
}
.tv-categories::-webkit-scrollbar { display: none; }
.tv-cat-chip {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tv-cat-chip:active { transform: scale(0.95); }
.tv-cat-chip.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 4px 12px rgba(255,255,255,0.15);
}
.tv-cat-skeleton {
    flex-shrink: 0;
    width: 90px;
    height: 38px;
    border-radius: 20px;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: tvShimmer 1.5s ease-in-out infinite;
}
@keyframes tvShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* GRID DE CANAIS */
.tv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px 20px 20px;
}
@media (min-width: 600px) {
    .tv-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .tv-grid { grid-template-columns: repeat(4, 1fr); }
}

/* CARD DO CANAL */
.tv-card {
    background: #141414;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.15s ease, border-color 0.2s ease;
    content-visibility: auto;
    contain-intrinsic-size: 160px;
}
.tv-card:active {
    transform: scale(0.96);
    border-color: rgba(229,9,20,0.5);
}

.tv-card-logo {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tv-card-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.tv-card-logo img.loaded { opacity: 1; }
.tv-card-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
    font-size: 32px;
}
.tv-card-play {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.tv-card-play i {
    color: #fff;
    font-size: 26px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.9);
}
.tv-card:active .tv-card-play,
.tv-card:hover .tv-card-play {
    opacity: 1;
}

/* ⚡ Indicador "AO VIVO" no canto do card */
.tv-card-logo::after {
    content: 'AO VIVO';
    position: absolute;
    top: 8px;
    left: 8px;
    background: #E50914;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.8px;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(229,9,20,0.6);
    animation: tvLivePulse 1.8s ease-in-out infinite;
}

.tv-card-info {
    padding: 10px 12px 12px 12px;
}
.tv-card-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tv-card-cat {
    font-size: 10.5px;
    color: #888;
    margin-top: 3px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SENTINEL / LOADER */
.tv-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}
.tv-loader {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: #E50914;
    animation: tvSpin 0.9s linear infinite;
}
@keyframes tvSpin { to { transform: rotate(360deg); } }

.tv-empty,
.tv-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
    font-size: 13px;
    text-align: center;
    gap: 10px;
}
.tv-empty i,
.tv-error i {
    font-size: 42px;
    opacity: 0.35;
}
.tv-error { color: #f87171; }
.tv-error i { color: #f87171; opacity: 0.9; }

.tv-count {
    font-size: 11px;
    color: #666;
    font-weight: 700;
    margin-left: auto;
}

/* ============================================================
   BOTTOM NAV — ICONE SVG (novo botão TV)
   ============================================================ */
.nav-icon-svg {
    width: 17px;
    height: 17px;
    display: block;
    color: currentColor;
}

/* ============================================================
   AJUSTE DO BOTTOM NAV PRA 6 BOTÕES
   ============================================================ */
#bottom-nav {
    padding: 8px 8px 16px 8px !important;
}
.nav-btn {
    padding: 4px 2px !important;
}
.nav-btn span {
    font-size: 9px !important;
    font-weight: 600;
}
.nav-btn i,
.nav-btn .nav-icon-svg {
    font-size: 16px;
}