/* ==========================================================================
   KumaStream TV Mode - Estilos Especializados Exclusivos para TV e Controle Remoto
   Só é ativado quando o aplicativo roda em Smart TV / TV Box / WebView TV (.is-tv)
   ========================================================================== */

/* Normalização de Rolagem para TV */
html.is-tv,
body.is-tv {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scroll-behavior: auto !important;
}

/* ==========================================================================
   CORREÇÃO #2 — Desabilitar backdrop-filter (blur) e filtros pesados para GPUs de TV
   ========================================================================== */
body.is-tv *,
body.is-tv *::before,
body.is-tv *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
}

/* Remove luzes de fundo com blur(50px) que drenam GPU nas telas de Login e Perfis */
body.is-tv .glow-effect {
    display: none !important;
}

/* Otimiza renderização de fileiras fora da área visível da TV */
body.is-tv .content-row {
    content-visibility: auto;
    contain-intrinsic-size: 1px 320px;
}

/* Remove sombras pesadas em cards não focados para aliviar a GPU */
body.is-tv .media-card:not(.tv-focused),
body.is-tv .top10-poster-wrapper {
    box-shadow: none !important;
}

/* ==========================================================================
   CORREÇÃO #3 — Desabilitar transições e animações para resposta instantânea do D-Pad
   Exceto o focus ring (.tv-focused) que precisa de feedback visual mínimo.
   ========================================================================== */
body.is-tv *:not(.tv-focused):not(.tv-pressed),
body.is-tv *:not(.tv-focused):not(.tv-pressed)::before,
body.is-tv *:not(.tv-focused):not(.tv-pressed)::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* Hero slide transition fica desligada para evitar lag no slider */
body.is-tv .hero-slide {
    transition: none !important;
}
body.is-tv .hero-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
}
body.is-tv .hero-backdrop-img {
    transition: none !important;
    transform: none !important;
}

/* Carousel scroll instantâneo */
body.is-tv .carousel-track {
    scroll-behavior: auto !important;
}

/* D-PAD FOCUS RING ULTRA-VISÍVEL E LEVE PARA PROJETORES E SMART TVS */
body.is-tv .tv-focused {
    outline: 3px solid #6366f1 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #ffffff !important;
    transform: scale(1.03) !important;
    z-index: 100 !important;
}

/* Feedback de clique pressionado na Smart TV */
body.is-tv .tv-pressed {
    transform: scale(0.97) !important;
    outline-color: #a5b4fc !important;
}

/* Modal de Detalhes no modo TV */
body.is-tv #kumaDetailsModal {
    background-color: rgba(3, 7, 18, 0.96) !important;
}

body.is-tv #kumaModalContainer {
    background-color: #0c0f17 !important;
    border: 2px solid rgba(99, 102, 241, 0.7) !important;
    box-shadow: none !important;
}

/* Esconder setas de mouse dos carrosséis na TV para não atrapalhar o D-Pad */
body.is-tv .carousel-btn {
    display: none !important;
}

/* Esconder barras de rolagem nativas na TV */
body.is-tv ::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    display: none !important;
}
body.is-tv {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* ==========================================================================
   SUPRESSÃO DE CONTROLES NATIVOS DE VÍDEO (SMART TV / TIZEN / WEBOS / CHROME)
   Impede que a Smart TV mostre seu player de sistema sobreposto ao Artplayer
   ========================================================================== */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display,
video::-webkit-media-controls-mute-button,
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-fullscreen-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ==========================================================================
   KUMASTREAM TV - VIRTUAL MOUSE (SETINHA ESTILO MOUSE PARA CONTROLE REMOTO)
   Transforma os direcionais do controle (D-Pad) em uma setinha fluida a 60 FPS
   ========================================================================== */
#kuma-virtual-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 26px;
    height: 32px;
    z-index: 2147483647;
    pointer-events: none;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform;
    opacity: 0;
}

/* Suprime o retângulo azul nativo do navegador em volta de links ao navegar na TV */
body.is-tv *:focus:not(.tv-focused) {
    outline: none !important;
    box-shadow: none !important;
}

#kuma-virtual-cursor.cursor-active {
    opacity: 1 !important;
    display: block !important;
}

#kuma-virtual-cursor.cursor-idle {
    opacity: 0 !important;
    display: none !important;
}

#kuma-virtual-cursor.cursor-clicking svg {
    transform: scale(0.84);
}

#kuma-virtual-cursor.cursor-interactive {
    opacity: 1 !important;
}

/* Efeito de Hover ativado pela Setinha na TV */
.tv-cursor-hover {
    outline: 3px solid #818cf8 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #ffffff !important;
    transform: scale(1.03) !important;
    z-index: 90 !important;
}

/* Badge flutuante indicativo de modo na TV */
#kuma-tv-mode-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2147483646;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.6);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: inherit;
}

#kuma-tv-mode-badge.badge-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Garantia de Player 100% Tela Cheia Edge-to-Edge no App TV / WebView */
body.is-tv #playerContainer {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    z-index: 10 !important;
    background: #000 !important;
}

body.is-tv .artplayer-app,
body.is-tv .artplayer-app > .art-video-player,
body.is-tv .artplayer-app video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}


