/* EPG Styles */
.epg-container {
    background: #141414;
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-family: sans-serif;
}

#epg-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

#epg-controls button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}
#epg-controls button:hover {
    background-color: #444;
}

.epg-grid {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    height: 70vh;
}

.epg-timeline {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #141414;
    white-space: nowrap;
    padding-left: 150px; /* Space for channel list */
}

.epg-time-slot {
    display: inline-block;
    width: 200px; /* Represents 1 hour */
    text-align: center;
    padding: 10px 0;
    border-left: 1px solid #444;
    font-size: 14px;
    color: #aaa;
}

.epg-channels {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 150px;
}

.epg-channel-item {
    height: 60px;
    padding: 5px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epg-channel-item img {
    max-width: 80%;
    max-height: 40px;
    object-fit: contain;
}

.epg-programs {
    position: absolute;
    top: 41px; /* Height of timeline */
    left: 0;
}

.epg-program-row {
    position: relative;
    height: 60px;
    border-bottom: 1px solid #333;
    white-space: nowrap;
}

.epg-program-item {
    position: absolute;
    height: 50px;
    top: 5px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 5px;
    font-size: 13px;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}
.epg-program-item:hover {
    border-color: #e50914;
    z-index: 1;
}

.epg-program-item .title { font-weight: bold; }
.epg-program-item .time { font-size: 11px; color: #aaa; }

#epg-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e50914;
    z-index: 4;
}
.epg-loader { text-align: center; padding: 50px; }

/* Mobile Responsive View */
@media (max-width: 768px) {
    .epg-grid, .epg-timeline, #epg-now-line {
        display: none; /* Hide grid on mobile */
    }
    #epg-mobile-list { display: block !important; }
    .epg-mobile-channel {
        background: #2a2a2a;
        margin-bottom: 2px;
    }
    .epg-mobile-channel-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        background: #333;
        cursor: pointer;
    }
    .epg-mobile-channel-header img {
        height: 30px;
        width: auto;
        max-width: 80px;
    }
    .epg-mobile-program-list {
        display: none; /* Hidden by default */
        padding: 0 10px 10px 10px;
    }
    .epg-mobile-program-item {
        border-bottom: 1px solid #444;
        padding: 8px 5px;
    }
}