/* ── EPG Sidebar ─────────────────────────────────────────────────────────── */

.epg-sidebar {
    width: clamp(220px, 22vw, 320px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    transition: width 0.22s ease, min-width 0.22s ease, opacity 0.22s ease;
    flex-shrink: 0;
}

.epg-sidebar.epg-hidden {
    display: none;
}

.epg-sidebar.collapsed {
    width: 52px;
    min-width: 52px;
}

.epg-sidebar.collapsed .epg-list-shell,
.epg-sidebar.collapsed .sidebar-label,
.epg-sidebar.collapsed .epg-channel-badge {
    display: none;
}

.epg-sidebar.collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
}

/* Flip the collapse button direction for the right sidebar */
.epg-collapse-btn {
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.epg-collapse-btn:hover {
    background: var(--hover-bg);
    color: var(--text);
}

/* ── Channel badge under the header ─────────────────────────────────────── */

.epg-channel-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* ── Programme list ──────────────────────────────────────────────────────── */

.epg-list-shell {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.epg-list-shell::-webkit-scrollbar {
    width: 4px;
}
.epg-list-shell::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.epg-programme {
    padding: 9px 10px;
    border-radius: 8px;
    cursor: default;
    transition: background 0.1s;
    margin-bottom: 2px;
}

.epg-programme:hover {
    background: var(--hover-bg);
}

.epg-programme.epg-now {
    background: rgba(59, 125, 216, 0.15);
    border: 1px solid rgba(59, 125, 216, 0.35);
}

.epg-programme.epg-past {
    opacity: 0.45;
}

.epg-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.epg-now-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(59, 125, 216, 0.5);
    animation: epgPulse 1.6s ease-out infinite;
    flex-shrink: 0;
}

@keyframes epgPulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 125, 216, 0.5); }
    100% { box-shadow: 0 0 0 7px rgba(59, 125, 216, 0); }
}

.epg-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-programme.epg-now .epg-title {
    color: #fff;
    font-weight: 600;
}

.epg-category {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Loading / error states ──────────────────────────────────────────────── */

.epg-status {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 8px;
}

/* ── Responsive: hide EPG sidebar on narrow screens ─────────────────────── */

@media (max-width: 1200px) {
    .epg-sidebar {
        display: none;
    }
}
