/* DABtv v0.2 style.css */

/* hide scrollbars but allow scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
}

/* thin scrollbar fallback for areas we want visible scroll */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #777;
}

/* Simplified Guide Styles */
#guideContainer {
    position: relative;
    background: #171717;
    overflow-x: auto;
    overflow-y: auto;
}

/* Date Header Row - Sticky at top */
.guide-date-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 40;
    /* Higher than time header */
    background: #0a0a0a;
    border-bottom: 1px solid #404040;
    height: 24px;
}

.guide-date-spacer {
    width: 200px;
    min-width: 200px;
    background: #0a0a0a;
    border-right: 1px solid #404040;
    position: sticky;
    left: 0;
    z-index: 41;
    /* Highest z-index to stay on top of everything */
}

.guide-date-slots {
    display: flex;
    flex: 1;
    background: #0a0a0a;
}

.guide-date-slot {
    /* 24 hours * 2 slots/hr * 80px/slot = 3840px */
    width: 3840px;
    min-width: 3840px;
    padding: 0;
    /* Remove padding to let label stick correctly */
    font-size: 11px;
    font-weight: 600;
    color: #e5e5e5;
    border-right: 1px solid #404040;
    background: #171717;
    position: relative;
    /* Context for sticky label */
}

.guide-date-label {
    position: sticky;
    left: 200px;
    /* Stick to the left edge of the view (after channel list) */
    display: inline-block;
    padding: 4px 12px;
}

/* Time Header Row - Sticky below date header */
.guide-time-header {
    display: flex;
    position: sticky;
    top: 24px;
    /* Height of date header */
    z-index: 30;
    background: #0a0a0a;
    border-bottom: 2px solid #404040;
    height: 28px;
    /* Reduced height */
}

.guide-channel-label {
    width: 200px;
    min-width: 200px;
    padding: 6px 16px;
    /* Reduced padding */
    font-size: 11px;
    font-weight: 600;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #0a0a0a;
    border-right: 1px solid #404040;
    position: sticky;
    left: 0;
    z-index: 31;
}

.guide-time-slots {
    display: flex;
    flex: 1;
    background: #0a0a0a;
}

.guide-time-slot {
    width: 160px;
    min-width: 160px;
    padding: 6px 4px;
    /* Reduced padding */
    text-align: center;
    font-size: 10px;
    color: #737373;
    border-right: 1px solid #262626;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-time-slot.hour-marker {
    border-right: 1px solid #404040;
    color: #a3a3a3;
    font-weight: 500;
}

/* Grid Header Styles with Sticky Positioning */
/* Channel Rows Container */
.guide-channel-rows {
    position: relative;
}

/* Individual Channel Row */
.guide-channel-row {
    display: flex;
    height: 60px;
    border-bottom: 1px solid #262626;
    position: relative;
}

.guide-channel-row:hover {
    background: #1a1a1a;
}

/* Channel Info Cell - Sticky left */
.guide-channel-info {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0a0a0a;
    border-right: 1px solid #404040;
    cursor: pointer;
    transition: background-color 0.15s;
    position: sticky;
    left: 0;
    z-index: 20;
    /* Ensure it stays above program blocks */
}

.guide-channel-info:hover {
    background: #1f1f1f;
}

.guide-channel-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #262626;
    border-radius: 4px;
    border: 1px solid #404040;
}

.guide-channel-details {
    flex: 1;
    min-width: 0;
}

.guide-channel-name {
    font-size: 11px;
    font-weight: 500;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-channel-number {
    font-size: 9px;
    color: #737373;
    margin-top: 2px;
}

/* Programs Timeline - needs explicit width for horizontal scrolling */
.guide-programs-timeline {
    position: relative;
    flex: 1;
    min-width: 0;
    /* Width = 7 days * 24 hours * 2 slots/hour * 80px/slot = 26,880px */
    width: 26880px;
}

.grid-channel-header-time {
    grid-column: 1;
    background: #1f2937;
    border-right: 1px solid #404040;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    color: #e5e7eb;
    position: sticky;
    top: 40px;
    left: 0;
    z-index: 40;
}

.grid-day-header {
    background: #374151;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    padding: 6px;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: #d1d5db;
    position: sticky;
    top: 0;
    z-index: 30;
}

.grid-time-slot {
    background: #1f2937;
    border-right: 1px solid #404040;
    padding: 6px 2px;
    text-align: center;
    font-size: 8px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: sticky;
    top: 40px;
    z-index: 20;
}

.grid-time-slot:hover {
    background: #374151;
}

/* Channel Row Styles with Sticky Column */
.grid-channel-cell {
    background: #1f2937;
    border-right: 1px solid #404040;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: sticky;
    left: 0;
    z-index: 10;
}

.grid-channel-cell:hover {
    background: #374151;
}

/* Program Block Styles */
.grid-program-block {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #4b5563;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    position: relative;
}

.grid-program-block:hover {
    background: rgba(55, 65, 81, 0.9);
    border-color: #6b7280;
}

.grid-program-block .program-title {
    font-size: 10px;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.grid-program-block .program-time {
    font-size: 8px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-program-block .program-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 1s;
}

/* Grid program blocks that span multiple hours */
.grid-program-span-2 {
    grid-column: span 2;
}

.grid-program-span-3 {
    grid-column: span 3;
}

.grid-program-span-4 {
    grid-column: span 4;
}

.grid-program-span-5 {
    grid-column: span 5;
}

.grid-program-span-6 {
    grid-column: span 6;
}

/* LIVE Indicator Styles */
#liveIndicator.is-live {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: live-pulse 2s ease-in-out infinite;
}

#liveIndicator.not-live {
    background: rgba(115, 115, 115, 0.2);
    color: #737373;
}

#liveIndicator.not-live:hover {
    background: rgba(115, 115, 115, 0.3);
    color: #a3a3a3;
}

@keyframes live-pulse {

    0%,
    100% {
        text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    }

    50% {
        text-shadow: 0 0 12px rgba(74, 222, 128, 0.8);
    }
}

/* ========== NEW SIMPLIFIED GUIDE STYLES ========== */

/* Programs Timeline Container */
.guide-programs-timeline {
    flex: 1;
    position: relative;
    height: 60px;
    background: #171717;
}

/* Program Block */
.guide-program-block {
    position: absolute;
    top: 4px;
    height: 52px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid #1e40af;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s;
    box-sizing: border-box;
}

.guide-program-block:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 10;
}

.guide-program-block.is-live {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #047857;
}

.guide-program-time {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
    white-space: nowrap;
}

.guide-program-title {
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-program-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 1s;
}

/* Current Time Indicator - Fixed position to follow scroll */
#currentTimeIndicator {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 25;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* In guide context */
#guideContainer #currentTimeIndicator {
    top: 40px; /* Below the sticky time header */
}