body {
    font-family: Verdana, Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

h1 {
    margin-bottom: 20px;
    text-align: center;
}

.time-selector {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.time-selector label {
    margin-right: 20px;
    font-weight: bold;
}

.time-selector input[type="radio"] {
    margin-right: 5px;
}

.legends-container {
    text-align: center;
}

.legend-section {
    display: inline-block;
    margin-bottom: 20px;
    vertical-align: top;
}

.legend-section.ratings {
    margin-right: 30px;
}

.legend-section h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.legend-table {
    width: auto;
    border: 1px solid #ccc;
}

.legend-table th {
    border: 1px solid #ccc;
    padding: 8px;
    background-color: #f2f2f2;
}

.legend-table td {
    padding: 8px;
}

.legend-table th.count-header,
.legend-table td.count-cell {
    text-align: center;
}

.legend-table td.count-cell {
    font-weight: bold;
}

.rating-cell {
    text-align: center;
    font-weight: bold;
    min-width: 80px;
    padding: 8px;
}

.rating-P { background-color: #FFD700; }
.rating-C { background-color: #FFD700; }
.rating-G { background-color: #A9A9A9; color: white; }
.rating-PG { background-color: #9B30FF; color: white; }
.rating-M { background-color: #800000; color: white; }
.rating-MA15plus { background-color: #DC143C; color: white; }
.rating-E { background-color: #0099CC; color: white; }
.rating-CTC { background-color: #00AA00; color: white; }
.rating-Unrated { background-color: #CCCCCC; }

.category-cell {
    text-align: center;
    font-weight: bold;
    padding: 8px;
    min-width: 80px;
    color: white;
}

.category-Action-and-Adventure { background-color: #FF6B35; }
.category-Comedy { background-color: #F7B801; }
.category-Drama { background-color: #4A90E2; }
.category-Kids-and-Family { background-color: #50C878; }
.category-Music { background-color: #9B59B6; }
.category-News { background-color: #E74C3C; }
.category-Similar { background-color: #95A5A6; }
.category-Special-Interest { background-color: #34495E; }
.category-Sports { background-color: #16A085; }

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 11px;
    vertical-align: top;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lcn-col {
    width: 40px;
    text-align: center;
    white-space: nowrap;
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 5;
}

.channel-col {
    width: 120px;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    left: 40px;
    z-index: 5;
    line-height: 1.2;
}

thead th.lcn-col,
thead th.channel-col {
    z-index: 15;
}

/* Mobile: Make channel column scroll with table, only LCN stays sticky */
@media (max-width: 768px) {
    body {
        font-size: 125%;
    }
    
    .channel-col {
        position: static;
        width: 120px;
    }
    thead th.channel-col {
        position: static;
    }
    
    th, td {
        font-size: 13.75px; /* 11px * 1.25 */
    }
    
    .program-title {
        font-size: 13.75px; /* 11px * 1.25 */
    }
    
    .program-category-badge {
        font-size: 12.5px; /* 10px * 1.25 */
    }
    
    .legend-section h2 {
        font-size: 22.5px; /* 18px * 1.25 */
    }
    
    .footer p {
        font-size: 16.25px; /* 13px * 1.25 */
    }
}

.program-cell {
    color: white;
    font-weight: bold;
    min-height: 40px;
}

.program-title {
    font-size: 11px;
    line-height: 1.3;
}

.program-category-badge {
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    display: inline-block;
    margin-top: 3px;
}

.time-col {
    min-width: 100px;
    text-align: center;
}

.table-container {
    overflow: auto;
    max-height: calc(100vh - 350px);
    position: relative;
    cursor: grab;
}

.table-container::-webkit-scrollbar {
    width: 20px;
    height: 20px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.legend-row {
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.legend-row:hover {
    background-color: #f0f8ff;
    border: 2px solid #4A90E2;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.legend-row.active {
    outline: 3px solid #000;
    outline-offset: -3px;
    background-color: #fffacd;
    font-weight: bold;
}

.program-cell.filtered {
    opacity: 0.1;
    pointer-events: none;
}

tr.channel-row-hidden {
    display: none;
}

.footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 2px solid #ddd;
}

.footer p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 13px;
}

.footer p:last-child {
    margin: 0;
}

.footer a {
    color: #4A90E2;
    text-decoration: none;
    font-weight: bold;
}
