/* Live fullscreen page */
.live-page {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 400;
}
.live-video {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: #000;
}
.live-osd {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 40px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 0.25s ease-out;
    z-index: 10;
    color: #fff;
}
.live-osd.live-osd-visible { opacity: 1; }
.live-osd-channel {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}
.live-osd-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px;
}
.live-osd-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.live-osd-number {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-family: 'Courier New', monospace;
}
.live-osd-program {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 8px;
}
.live-osd-hint {
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    letter-spacing: 0.3px;
}
.live-buffering {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0,0,0,0.7);
    padding: 20px 32px;
    border-radius: 12px;
    font-size: 18px;
    z-index: 20;
}

/* ============ EPG Grid Overlay (OK toggle) — pattern v1: fullscreen,
   fundo semi-transparente deixando ver vídeo por trás. Grid horizontal
   com header + timeline (6 slots × 30min) + rows canal+programas. ============ */
.lco {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    z-index: 30;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-out;
    padding: 24px 32px;
    box-sizing: border-box;
}
.lco.lco-visible { display: block; opacity: 1; }

.egr {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.egr-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 12px;
    flex-shrink: 0;
}
.egr-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    margin: 0;
}
.egr-date {
    color: rgba(255,255,255,0.65);
    font-size: 15px;
    letter-spacing: 0.04em;
}

/* Timeline: CANAL 220px + 6 slots iguais.
   Chrome 63 do Tizen NÃO tem grid — usar flex com widths fixos/percent. */
.egr-timeline {
    display: flex;
    flex-direction: row;
    padding: 0 0 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.68);
    font-size: 13px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.egr-col-channel {
    width: 220px;
    flex-shrink: 0;
    padding: 8px 10px;
    color: #fff;
    font-weight: 700;
}
.egr-timeslot {
    flex: 1;
    padding: 8px 10px;
    color: rgba(255,255,255,0.7);
    border-left: 1px solid rgba(255,255,255,0.04);
}
.egr-timeslot.egr-timeslot-now { color: #fff; font-weight: 700; }

/* Body: rows scrolláveis + linha vermelha AGORA sobreposta */
.egr-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
}
.egr-body::-webkit-scrollbar { width: 6px; }
.egr-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }

.egr-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e23434;
    box-shadow: 0 0 8px rgba(226,52,52,0.85);
    pointer-events: none;
    z-index: 5;
}

.egr-row {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 72px;
    position: relative;
    outline: none;
    cursor: pointer;
    background: transparent;
    border-left: none; border-right: none; border-top: none;
    color: #fff;
    text-align: left;
    width: 100%;
    padding: 0;
    transition: background 120ms ease;
}
.egr-row.tv-focused,
.egr-row:focus {
    background: rgba(255,255,255,0.06);
}
.egr-row.tv-focused .egr-channel-cell {
    background: linear-gradient(90deg, rgba(0,183,235,0.35) 0%, rgba(0,183,235,0.10) 100%);
    border-right-color: rgba(180, 230, 255, 0.5);
}
.egr-row.tv-focused .egr-channel-name { color: #fff; }
.egr-row.tv-focused .egr-channel-num { color: #00B7EB; }
.egr-row.egr-row-current .egr-channel-name { color: #00B7EB; }
.egr-row.egr-row-current .egr-channel-num  { color: #00B7EB; }

.egr-channel-cell {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0,0,0,0.55);
    border-right: 1px solid rgba(255,255,255,0.12);
    transition: background 120ms ease, border-color 120ms ease;
    width: 220px;
    flex-shrink: 0;
    box-sizing: border-box;
}
.egr-channel-logo {
    width: 40px; height: 40px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(255,255,255,0.08);
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 12px;
}
.egr-channel-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.egr-channel-num {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    line-height: 1;
    margin-bottom: 4px;
}
.egr-channel-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.egr-programs-col {
    position: relative;
    flex: 1;
    padding: 6px 4px;
    overflow: hidden;
    background: rgba(0,0,0,0.30);
    box-sizing: border-box;
}
.egr-program {
    position: absolute;
    top: 6px;
    bottom: 6px;
    margin: 0 2px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid rgba(0, 183, 235, 0.32);
    background: rgba(10, 30, 45, 0.55);
    box-sizing: border-box;
    overflow: hidden;
    color: #fff;
}
.egr-program.egr-program-current {
    background: linear-gradient(135deg, rgba(0,183,235,0.32) 0%, rgba(0,120,200,0.28) 100%);
    border-color: rgba(0, 183, 235, 0.65);
}
.egr-prog-time {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    line-height: 1;
    margin-bottom: 4px;
}
.egr-prog-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.egr-program-empty {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-style: italic;
    padding: 20px 12px;
}
.egr-loading, .egr-empty {
    padding: 60px 20px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

/* ============ EPG Info Panel (RIGHT) — Android TV parity, 1.7× scale ============ */
.lei {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 680px;
    background: linear-gradient(270deg, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.90) 65%, rgba(0,0,0,0) 100%);
    color: #fff;
    z-index: 32;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-out;
    box-sizing: border-box;
}
.lei.lei-visible { display: block; opacity: 1; }
.lei-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 40px 68px 54px;
    scrollbar-width: thin;
    box-sizing: border-box;
}
.lei-scroll::-webkit-scrollbar { width: 10px; }
.lei-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 5px; }

/* Header: logo + nome/CH à esquerda, badge qualidade à direita */
.lei-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.lei-header-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.lei-header-logo {
    width: 75px;
    height: 75px;
    background-color: rgba(255,255,255,0.06);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    flex-shrink: 0;
    margin-right: 20px;
}
.lei-header-info {
    min-width: 0;
    flex: 1;
}
.lei-ch-name {
    font-size: 29px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lei-ch-num {
    font-size: 20px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.7px;
}
.lei-quality {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    font-size: 19px;
    font-weight: 600;
    padding: 7px 17px;
    border-radius: 7px;
    letter-spacing: 0.7px;
    flex-shrink: 0;
    margin-left: 17px;
}

.lei-poster {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;  /* 16:9 */
    background-color: rgba(255,255,255,0.05);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    margin-bottom: 24px;
    display: none;
}
.lei-poster.lei-poster-visible { display: block; }

/* Row AO VIVO + horário */
.lei-live-row {
    display: flex;
    align-items: center;
    margin-bottom: 17px;
}
.lei-live-badge {
    background: #2E7D32;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1.4px;
    padding: 5px 14px;
    border-radius: 5px;
    margin-right: 17px;
    text-transform: uppercase;
}
.lei-time {
    color: rgba(255,255,255,0.75);
    font-size: 22px;
    letter-spacing: 0.5px;
}

.lei-title {
    font-size: 37px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 14px;
}

/* Row rating + ano */
.lei-meta-row {
    display: flex;
    align-items: center;
    margin-bottom: 17px;
}
.lei-rating {
    display: inline-block;
    background: #2E7D32;  /* default (Livre) — verde */
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 5px;
    margin-right: 17px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}
.lei-rating:empty { display: none; }
/* Cores oficiais ClassInd Brasil */
.lei-rating.lei-rating-L  { background: #2E7D32; }  /* Livre — verde */
.lei-rating.lei-rating-10 { background: #1976D2; }  /* 10 anos — azul */
.lei-rating.lei-rating-12 { background: #F9A825; color: #000; }  /* 12 anos — amarelo */
.lei-rating.lei-rating-14 { background: #E67E22; }  /* 14 anos — laranja */
.lei-rating.lei-rating-16 { background: #C62828; }  /* 16 anos — vermelho */
.lei-rating.lei-rating-18 { background: #212121; }  /* 18 anos — preto */

/* Também no EPG grid (badge inline nas rows), se quisermos usar depois */
.egr-rating {
    display: inline-block;
    background: #2E7D32;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    line-height: 1;
}
.egr-rating.egr-rating-L  { background: #2E7D32; }
.egr-rating.egr-rating-10 { background: #1976D2; }
.egr-rating.egr-rating-12 { background: #F9A825; color: #000; }
.egr-rating.egr-rating-14 { background: #E67E22; }
.egr-rating.egr-rating-16 { background: #C62828; }
.egr-rating.egr-rating-18 { background: #212121; }
.lei-year {
    color: rgba(255,255,255,0.55);
    font-size: 22px;
}

.lei-genres {
    color: #F5A54B;
    font-size: 22px;
    font-style: italic;
    margin-bottom: 17px;
}
.lei-genres:empty { display: none; }

.lei-desc {
    color: rgba(255,255,255,0.88);
    font-size: 22px;
    line-height: 1.5;
    margin-bottom: 24px;
    /* Limita em 7 linhas — sinopses muito longas empurravam elenco/diretor
       pra fora da tela. `-webkit-line-clamp` funciona em Chrome 63 do Tizen. */
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lei-cast, .lei-crew {
    color: rgba(255,255,255,0.65);
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 10px;
    display: none;
}
.lei-cast.lei-cast-visible,
.lei-crew.lei-crew-visible { display: block; }
.lei-cast strong,
.lei-crew strong {
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    margin-right: 7px;
}

