/* ===========================================================================
   SCHEDULE GRID — tv_guide_schedule shortcode
   =========================================================================== */

.schedule-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    box-sizing: border-box;
}

.schedule-grid-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.schedule-grid-scroll::-webkit-scrollbar { height: 6px; }
.schedule-grid-scroll::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.schedule-grid-scroll::-webkit-scrollbar-thumb { background: #cfcabe; border-radius: 3px; }
.schedule-grid-scroll::-webkit-scrollbar-thumb:hover { background: #b5b0a3; }

.schedule-grid {
    position: relative;
    min-width: 100%;
}

.schedule-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f0f0;
    box-sizing: border-box;
    min-height: 42px;
}

.schedule-row.schedule-header {
    background: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-channel-label {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #111;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    z-index: 5;
}

.schedule-row.schedule-header .schedule-channel-label {
    background: #f9f9f9;
    font-weight: 400;
    color: #888;
    position: sticky;
    left: 0;
    z-index: 11;
}

.schedule-channel-label a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-channel-label a:hover {
    color: #d8613c;
}

.schedule-programs-wrap {
    flex: 1;
    position: relative;
    min-height: 42px;
    min-width: calc(14 * 260px);
}

.schedule-hour-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 260px;
    min-width: 260px;
    height: 100%;
    padding: 8px 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #f0f0f0;
    box-sizing: border-box;
}

.schedule-row.schedule-header .schedule-programs-wrap {
    display: flex;
}

.schedule-program {
    position: absolute;
    top: 4px;
    bottom: 4px;
    padding: 5px 8px;
    font-size: 0.76rem;
    font-weight: 500;
    color: #111;
    background: #f0ede6;
    border: 1px solid #d8d3c5;
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: default;
    box-sizing: border-box;
    z-index: 1;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.schedule-program:hover {
    background: #e8e4d8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 2;
}

.schedule-program--live {
    background: #d8613c;
    border-color: #c45530;
    color: #fff;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(216,97,60,0.3);
}

.schedule-program--live:hover {
    background: #c45530;
}

.schedule-program-time {
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.7;
    flex-shrink: 0;
}

.schedule-program--live .schedule-program-time {
    opacity: 1;
}

.schedule-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d8613c;
    z-index: 20;
    pointer-events: none;
}

.schedule-now-line::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #d8613c;
    border-radius: 50%;
    animation: schedule-pulse 1.5s infinite;
}

@keyframes schedule-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
    100% { opacity: 1; transform: scale(1); }
}

.schedule-grid-empty {
    padding: 40px 18px;
    text-align: center;
    color: #888;
    font-size: 0.95rem;
    font-style: italic;
}

@media (max-width: 767px) {
    .schedule-channel-label {
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        font-size: 0.7rem;
        padding: 6px 6px;
    }

    .schedule-program {
        font-size: 0.68rem;
        padding: 3px 5px;
    }

    .schedule-hour-cell {
        width: 180px;
        min-width: 180px;
        font-size: 0.65rem;
    }

    .schedule-programs-wrap {
        min-width: calc(14 * 180px);
    }
}
