/*───── Info Overlay──────*/

.epg-container {
    display: flex;
    flex-direction: column;
}

.epg-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(0, 0);
    width: 100vw;
    height: 30vh;
    padding: 4vh 2.5vw;
        background: linear-gradient(to right,
            rgba(0, 0, 0, 0.96) 0,
            rgba(0, 0, 0, 0.92) 55vw,
            rgba(0, 0, 0, 0.56) 65vw,
            rgba(0, 0, 0, 0) 70vw);
    color: var(--color-font-primary);
    font-size: 1.8vh;
    font-weight: 500;
    text-align: left;
    z-index: 320;

    display: none;
    align-items: end;
    pointer-events: none;
    opacity: 0;
}

.epg-info-overlay.visible {
    display: flex;
    pointer-events: auto;
    opacity: 1;
}

.epg-info-content {
    width: 55vw;
    line-height: 1.4;
    text-align: left;
}

.epg-info-channel {
    font-size: 1.8vh;
    font-weight: 700;
    color: var(--color-font-tertiary);
    margin-bottom: 0.5vh;
}

.epg-info-title {
    font-size: 3.5vh;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.8vh;
    text-align: left;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.epg-info-description {
    font-size: 2vh;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.35;
    margin-bottom: 0.7vh;
    text-align: left;    
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;

}

.epg-info-time {
    font-size: 1.8vh;
    font-weight: 600;
    color: var(--color-app-primary);
    text-align: left;
}

/* ── Overlay ───────────*/

.epg-guide-overlay {
    --epg-pixels-per-minute: 8;
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 70vh;
    z-index: 200;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
}

.epg-guide-overlay.visible {
    display: flex;
    pointer-events: auto;
    opacity: 1;
}

/* ── Header ────────── */

.epg-guide-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.epg-guide-header-categories-spacer {
    width: 10vw;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    /* height: 100%; */
}

.epg-guide-header-title {
    width: 10vw;
    flex-shrink: 0;
    /* padding: 2vh 2vh; */
    font-size: 1.5vh;
    font-weight: 700;
    color: var(--color-app-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.epg-guide-time-labels {
    position: relative;
    flex: 1;
    height: 5vh;
    overflow: hidden;
}

.epg-time-lbl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2vh;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    white-space: nowrap;
    padding-left: 1vw;
}

.epg-day-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.16);
}

.epg-day-label {
    position: absolute;
    top: 0vh;
    font-size: 1.2vh;
    color: var(--color-app-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.2vh 0.5vw;
    border-radius: 0.4vh;
}

/* ── Body (scroll de linhas) ──────────────── */

.epg-guide-main {
    flex: 1;
    min-height: 0;
    display: flex;
}

.epg-guide-categories {
    width: 10vw;
    flex-shrink: 0;
    overflow-y: hidden;
    background: rgba(0, 0, 0, 0.45);
    scrollbar-width: none;
}

.epg-guide-category-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1vh;
    margin: 1vh;
    border-radius: var(--epg-guide-category-item-radius);
    background: rgba(30, 30, 30, 0.8)
}

.epg-guide-category-item.selected {
    border: 1px solid transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

.epg-guide-category-item.focused {
    background: linear-gradient(var(--color-app-secondary), var(--color-app-primary));
    border-color: var(--color-app-primary);
}

.epg-guide-category-title {
    color: var(--color-font-primary);
    font-size: 2vh;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epg-guide-category-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5vh;
    font-weight: 700;
}

.epg-guide-category-item.focused .epg-guide-category-title,
.epg-guide-category-item.focused .epg-guide-category-count {
    color: var(--color-font-selected);
}

.epg-guide-content {
    flex: 1;
    min-width: 0;
    display: flex;
    position: relative;
    overflow: hidden;
}

.epg-guide-focus-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0.35vh;
    background: var(--color-app-primary);
    box-shadow: 0 0 1.2vh rgba(0, 0, 0, 0.35);
    z-index: 6;
    pointer-events: none;
}

.epg-guide-focus-line::before {
    content: '';
    position: absolute;
    top: 1.2vh;
    left: 50%;
    width: 1.4vh;
    height: 1.4vh;
    border-radius: 50%;
    background: var(--color-app-primary);
    transform: translateX(-50%);
}

.epg-guide-body {
    position: relative;
    flex: 1;
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-app-primary) rgba(255, 255, 255, 0.05);
}

.epg-guide-body::-webkit-scrollbar {
    width: 0.4vw;
}

.epg-guide-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.epg-guide-body::-webkit-scrollbar-thumb {
    background: var(--color-app-primary);
    border-radius: 2px;
}

.epg-guide-empty-category {
    padding: 3vh 2vw;
    color: rgba(255, 255, 255, 0.55);
    font-size: 2vh;
}

/* ── Linha de canal ──────────────── */

.epg-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 13vh;
    transition: none;
}

.epg-row-current {
    background: rgba(255, 255, 255, 0.04);
}

.epg-row-focused {
    /* background: rgba(255, 255, 255, 0.08); */
    outline: none;
    /* border-left: 1vh solid var(--color-app-primary); */
}

/* Coluna de info do canal (fixa à esquerda) */
.epg-row-channel {
    /* width: 8vw; */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5vh 0.5vh;
}

.epg-row-focused .epg-row-channel {
    background: linear-gradient(var(--color-app-secondary), var(--color-app-primary));
    border-radius: var(--epg-row-channel-radius);
}

.epg-row-logo {
    max-width: 10vw;
    max-height: 11vh;
    object-fit: contain;
    background: rgba(30, 30, 30, 0.8);
    border-radius: var(--epg-row-logo-radius);
}

.epg-row-name {
    color: var(--color-font-primary);
    font-size: 1.8vh;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Timeline de programas */
.epg-row-timeline {
    position: relative;
    height: 12vh;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.epg-time-track,
.epg-row-timeline-track {
    position: relative;
    height: 100%;
    will-change: transform;
}

.epg-row-timeline-track {
    min-width: 100%;
}

.epg-day-boundary {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 1;
    pointer-events: none;
}

/* ── Bloco de programa ─── */

.epg-prog {
    position: absolute;
    top: 0.5vh;
    bottom: 0.5vh;
    padding: 1vh 1vh 1vh 2vh;
    box-sizing: border-box;
    background: rgb(19 19 21 / 85%);
    border: 2px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--epg-row-logo-radius);
    text-align: start;
}

.epg-prog-focused {
    border-color: var(--color-app-primary);
    z-index: 2;
}

.epg-prog-now {
    margin-right: 2px;
}

.epg-prog-past {
    display: none;
}

.epg-prog-empty {
    background: transparent;
    border: none;
    color: var(--color-font-primary);
    font-size: 1.6vh;
    display: flex;
    align-items: start;
    justify-content: center;
    padding-left: 2vw;
    opacity: 0.3;
}

.epg-prog-time {
    font-size: 1.7vh;
    color: var(--color-app-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-prog-title {
    font-size: 2.2vh;
    color: var(--color-font-primary);
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 0.5vh
}

.epg-prog-desc {
    font-size: 2vh;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(0);
    margin-bottom: 0.5vh
}

/* ── Dica de navegação (rodapé) ─────── */

.epg-guide-hint {
    flex-shrink: 0;
    padding: 1vh 3vh;
    font-size: 2vh;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 1000px) {
    .epg-guide-overlay {
        --epg-pixels-per-minute: 4.5;
    }
}