/* ============================================
   EPG GRID — ONEPRIMETV Redesign 2026
   ============================================ */

.epg-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.epg-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.epg-grid-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text);
}

#close-epg-grid {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

#close-epg-grid:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

#close-epg-grid svg { width: 15px; height: 15px; }

/* ── EPG DAYS TABS ───────────────────────── */
#epg-days-container {
    display: flex;
    gap: 4px;
}

.epg-day-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.epg-day-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    border-color: var(--border-hover);
}

.epg-day-btn.active {
    background: var(--accent-dim);
    border-color: rgba(229,22,30,0.3);
    color: var(--accent);
    font-weight: 600;
}

/* ── EPG SCROLL AREA ─────────────────────── */
.epg-grid-scroll-area {
    flex: 1;
    overflow: auto;
    position: relative;
    scroll-behavior: smooth;
}

.epg-grid-scroll-area::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.epg-grid-scroll-area::-webkit-scrollbar-track { background: transparent; }
.epg-grid-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ── EPG TIME TRACK ──────────────────────── */
.epg-time-track {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(7,10,15,0.98);
    border-bottom: 1px solid var(--border);
    height: 32px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.epg-time-label {
    position: absolute;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    transform: translateX(-50%);
    white-space: nowrap;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

/* ── EPG ROWS ────────────────────────────── */
#epg-rows-container {
    position: relative;
    min-height: 100%;
}

.epg-channel-row {
    display: flex;
    align-items: stretch;
    height: 56px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    position: relative;
}

.epg-channel-row:hover {
    background: rgba(255,255,255,0.01);
}

.epg-channel-label {
    position: sticky;
    left: 0;
    width: 160px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: rgba(7,10,15,0.97);
    border-right: 1px solid var(--border);
    z-index: 5;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: background var(--transition);
}

.epg-channel-label:hover {
    background: rgba(20,28,40,0.98);
}

.epg-channel-label img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
    padding: 2px;
    flex-shrink: 0;
}

.epg-channel-label span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* ── EPG PROGRAMS ────────────────────────── */
.epg-programs-track {
    flex: 1;
    position: relative;
    height: 100%;
}

.epg-program-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0 10px;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    box-sizing: border-box;
}

.epg-program-block:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    z-index: 2;
}

.epg-program-block.is-current {
    background: rgba(229,22,30,0.1);
    border-color: rgba(229,22,30,0.25);
}

.epg-program-block.is-past {
    opacity: 0.45;
}

.epg-program-block.is-favorite {
    border-color: rgba(245,200,66,0.25);
}

.epg-prog-title {
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.epg-program-block.is-current .epg-prog-title {
    color: var(--text);
    font-weight: 600;
}

/* ── EPG NOW LINE ────────────────────────── */
#epg-grid-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    z-index: 8;
    pointer-events: none;
}

#epg-grid-now-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* ── EPG PREVIEW POPUP ───────────────────── */
.epg-preview-popup {
    position: absolute;
    top: -8px;
    left: 170px;
    right: 10px;
    background: rgba(13,17,23,0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 14px 16px;
    z-index: 100;
    max-height: 160px;
    pointer-events: none;
    display: none;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.epg-preview-popup.show {
    display: block;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

#preview-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

#preview-time {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 6px;
}

#preview-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ── EPG GRID BTN ────────────────────────── */
#epg-grid-btn svg { width: 17px; height: 17px; }
