/* General Styles */
:root {
	--timeline-height: 40px;
	--channel-sidebar-width: 100px;
	--time-cell-width: 140px;
	--program-row-height: 75px;
	--minimap-height: 20px;
}

body {
	overflow-x: hidden;
	background-color: #f8f9fa;
}

/* Header & Minimap Navigation */
header {
	background-color: #e9ecef;
	border-radius: 0.25rem;
	margin-bottom: 1rem;
	padding: 1rem;
}

.minimap-container {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.current-date-display {
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
}

.minimap {
	position: relative;
	width: 100%;
	height: var(--minimap-height);
	background-color: #fff;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	margin-bottom: 2px;
}

.minimap-timeline {
	position: relative;
	width: 100%;
	height: 100%;
}

.minimap-hour-marker {
	position: absolute;
	top: 0;
	width: 1px;
	height: 100%;
	background-color: #adb5bd;
}

.minimap-major-marker {
	height: 100%;
}

.minimap-minor-marker {
	height: 50%;
	top: 25%;
}

.viewport-indicator {
	position: absolute;
	top: 0;
	height: 100%;
	background-color: rgba(0, 123, 255, 0.3);
	border: 2px solid #007bff;
	cursor: grab;
}

.viewport-indicator:active {
	cursor: grabbing;
}

.handle {
	position: absolute;
	width: 5px;
	height: 70%;
	top: 15%;
	background-color: #007bff;
	border-radius: 1px;
	cursor: col-resize;
}

.handle-left {
	left: 0;
}

.handle-right {
	right: 0;
}

.now-indicator, 
.minimap-now-indicator {
	position: absolute;
	top: 0;
	width: 2px;
	background-color: #dc3545;
	z-index: 10;
}

.now-indicator {
	height: 100%;
}

.minimap-now-indicator {
	height: var(--minimap-height);
}

.minimap-now-indicator::after {
	content: '';
	position: absolute;
	top: -3px;
	left: -3px;
	width: 8px;
	height: 8px;
	background-color: #dc3545;
	border-radius: 50%;
}

.time-markers {
	width: 100%;
	display: flex;
	justify-content: space-between;
	font-size: 8px;
	color: #6c757d;
	margin-bottom: 8px;
}

#jump-to-now {
	font-size: 12px;
	padding: 0.2rem 0.5rem;
}

/* TV Guide Container */
.tv-guide-container {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	background-color: white;
	box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Timeline Styles */
.timeline-container {
	display: flex;
	position: sticky;
	top: 0;
	z-index: 10;
	background-color: white;
	border-bottom: 1px solid #dee2e6;
}

.channel-sidebar-header {
	flex: 0 0 var(--channel-sidebar-width);
	min-width: var(--channel-sidebar-width);
	height: var(--timeline-height);
	border-right: 1px solid #dee2e6;
	background-color: #f8f9fa;
}

.timeline {
	display: flex;
	overflow-x: auto;
	scrollbar-width: thin;
	flex: 1;
	position: relative;
	background-color: #f8f9fa;
}

.timeline::-webkit-scrollbar {
	height: 8px;
}

.timeline::-webkit-scrollbar-thumb {
	background-color: #c1c1c1;
	border-radius: 4px;
}

.timeline::-webkit-scrollbar-track {
	background-color: #f1f1f1;
}

.timeline-cell {
	flex: 0 0 var(--time-cell-width);
	min-width: var(--time-cell-width);
	height: var(--timeline-height);
	padding: 8px;
	font-size: 0.8rem;
	text-align: center;
	border-right: 1px solid #eee;
	font-weight: 500;
}

/* TV Guide Grid */
.tv-guide-grid {
	display: flex;
	overflow: hidden;
	position: relative;
}

/* Channel Sidebar */
.channel-sidebar {
	flex: 0 0 var(--channel-sidebar-width);
	min-width: var(--channel-sidebar-width);
	overflow-y: auto;
	border-right: 1px solid #dee2e6;
	background-color: #f8f9fa;
}

.channel-cell {
	display: flex;
	align-items: center;
	padding: 10px;
	height: var(--program-row-height);
	border-bottom: 1px solid #eee;
	background-color: white;
}

.channel-cell__logo {
	max-width: 100%;
	max-height: 40px;
	object-fit: contain;
}

.channel-cell__content {
	margin-left: 8px;
	text-align: center;
	flex: 1;
}

.channel-cell__label {
	font-size: 0.7rem;
	color: #6c757d;
}

/* Program Grid */
.program-grid {
	flex: 1;
	overflow: auto;
	position: relative;
}

.program-row {
	display: flex;
	height: var(--program-row-height);
	border-bottom: 1px solid #eee;
	position: relative;
}

.program-cell {
	position: absolute;
	top: 0;
	height: 100%;
	padding: 5px;
	border-radius: 4px;
	border: 1px solid #dee2e6;
	background-color: white;
	overflow: hidden;
	margin: 2px;
	cursor: pointer;
	transition: all 0.1s ease-in-out;
}

.program-cell:hover {
	background-color: #f8f9fa;
	box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
	z-index: 5;
}

.program-cell--showing {
	background-color: #e8f4fc;
	border-color: #7ebee9;
	font-weight: bold;
}

.program-cell--truncated {
	background-color: #f8f9fa;
}

.program-cell__content {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.program-cell__title {
	font-size: 0.85rem;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.program-cell__times {
	font-size: 0.7rem;
	color: #6c757d;
}

.program-cell__end-time {
	display: inline;
}

/* Hide end times in certain conditions */
.hide-end-times .program-cell__end-time,
.program-cell--truncated .program-cell__end-time {
	display: none;
}

/* Time format styling */
.tv-guide-container[data-time-format="24h"] .timeline-cell,
.tv-guide-container[data-time-format="24h"] .program-cell__times {
	font-variant-numeric: tabular-nums;
}

.tv-guide-container[data-time-format="12h"] .timeline-cell {
	font-size: 0.75rem;
}

.tv-guide-container[data-time-format="12h"] .program-cell__times {
	font-size: 0.65rem;
}
/* Add these styles to your CSS file */

/* 24-hour format styles */
.tv-guide-container[data-time-format="24h"] .timeline-cell,
.tv-guide-container[data-time-format="24h"] .program-cell__times {
	font-variant-numeric: tabular-nums; /* Better alignment of numbers */
	font-family: 'Courier New', monospace; /* Monospaced font for alignment */
}

.tv-guide-container[data-time-format="24h"] .timeline-cell {
	letter-spacing: 0.03em; /* Slight spacing for readability */
}

/* 12-hour format styles */
.tv-guide-container[data-time-format="12h"] .timeline-cell {
	font-size: 0.75rem; /* Slightly smaller to fit AM/PM */
}

.tv-guide-container[data-time-format="12h"] .program-cell__times {
	font-size: 0.65rem; /* Slightly smaller to fit AM/PM */
}

/* Add indicator of current format */
.tv-guide-container[data-time-format="24h"]::before {
	content: "24h";
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 0.7rem;
	color: #6c757d;
	background-color: #e9ecef;
	padding: 2px 5px;
	border-radius: 3px;
	z-index: 5;
}

.tv-guide-container[data-time-format="12h"]::before {
	content: "12h";
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 0.7rem;
	color: #6c757d;
	background-color: #e9ecef;
	padding: 2px 5px;
	border-radius: 3px;
	z-index: 5;
}

/* Time format toggle styles */
.time-format-toggle {
	display: inline-flex;
	align-items: center;
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 50px;
	padding: 2px;
	margin-top: 5px;
}

.time-format-option {
	padding: 5px 10px;
	font-size: 0.8rem;
	cursor: pointer;
	border-radius: 50px;
	transition: all 0.2s ease;
}

.time-format-option.active {
	background-color: #007bff;
	color: white;
}

/* Additional utility class for time display */
.time-display {
	font-variant-numeric: tabular-nums;
}

/* For time input fields */
input.time-input {
	width: 80px;
	text-align: center;
}

input.time-input-24h {
	width: 60px;
}

input.time-input-12h {
	width: 90px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
	:root {
		--channel-sidebar-width: 60px;
		--time-cell-width: 100px;
		--program-row-height: 60px;
	}

	.program-cell__title {
		font-size: 0.75rem;
	}

	.program-cell__times {
		font-size: 0.65rem;
	}
	
	.program-cell__end-time {
		display: none;
	}
	
	.minimap-container {
		margin-top: 1rem;
		align-items: flex-start;
	}
}