/**
 * TV Table Styles
 *
 * TV player-style layout with sidebar and main content
 */

.tv-table-wrapper {
	width: 100%;
	margin: 30px 0;
	display: flex;
	gap: 24px;
	flex-direction: row;
	min-height: 600px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Sidebar with countries */
.tv-table-sidebar {
	width: 280px;
	min-width: 280px;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border: 1px solid #e1e8ed;
	border-radius: 12px;
	padding: 24px;
	height: 600px;
	overflow-y: auto;
	overflow-x: hidden;
	flex-shrink: 0;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.tv-table-sidebar:hover {
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tv-table-sidebar::-webkit-scrollbar {
	width: 8px;
}

.tv-table-sidebar::-webkit-scrollbar-track {
	background: #f1f3f5;
	border-radius: 4px;
}

.tv-table-sidebar::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, #adb5bd 0%, #868e96 100%);
	border-radius: 4px;
	transition: background 0.2s ease;
}

.tv-table-sidebar::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, #868e96 0%, #495057 100%);
}

/* SEO Heading for country/category in sidebar */
.tv-table-country-heading {
	margin: 0 0 24px 0;
	font-size: 22px;
	font-weight: 700;
	color: #212529;
	padding-bottom: 16px;
	border-bottom: 3px solid #e9ecef;
	line-height: 1.4;
	letter-spacing: -0.3px;
}

.tv-country-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tv-country-item {
	margin: 0;
	padding: 0;
}

.tv-country-link {
	display: block;
	padding: 14px 18px;
	margin-bottom: 6px;
	border-radius: 8px;
	color: #495057;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	border-left: 4px solid transparent;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 500;
	position: relative;
	overflow: hidden;
}

.tv-country-link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, rgba(0, 115, 170, 0.1) 0%, rgba(0, 115, 170, 0.05) 100%);
	transition: width 0.3s ease;
}

.tv-country-link:hover {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	color: #0073aa;
	border-left-color: #0073aa;
	transform: translateX(4px);
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.tv-country-link:hover::before {
	width: 100%;
}

.tv-country-link.active {
	background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
	color: #fff;
	border-left-color: #004d6e;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3), 0 2px 4px rgba(0, 115, 170, 0.2);
	transform: translateX(2px);
}

.tv-country-link.active::before {
	display: none;
}

.tv-country-link.global {
	font-weight: 700;
	border-bottom: 2px solid #dee2e6;
	padding-bottom: 16px;
	margin-bottom: 18px;
	font-size: 15px;
	letter-spacing: 0.2px;
}

.tv-country-link.global.active {
	border-bottom-color: rgba(255, 255, 255, 0.4);
}

/* Main content area */
.tv-table-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.tv-table-controls {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
	align-items: flex-end;
}

.tv-table-search {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	min-width: 250px;
}

.tv-table-search label {
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

.tv-table-search input[type="text"] {
	padding: 12px 18px;
	border: 2px solid #dee2e6;
	border-radius: 8px;
	font-size: 14px;
	width: 100%;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	background: #ffffff;
	color: #212529;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tv-table-search input[type="text"]:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1), 0 2px 8px rgba(0, 115, 170, 0.15);
	transform: translateY(-1px);
}

.tv-table-search input[type="text"]::placeholder {
	color: #adb5bd;
}

.tv-table-container {
	width: 100%;
	overflow: hidden;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border: 1px solid #e1e8ed;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
	height: 600px;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.3s ease;
}

.tv-table-container:hover {
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tv-table-container .dataTables_wrapper {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.tv-table-container .dataTables_scroll {
	flex: 1;
	overflow: auto;
}

.tv-table-container .dataTables_scrollBody {
	max-height: calc(600px - 120px) !important;
}

#tv-channels-table {
	width: 100% !important;
	border-collapse: collapse;
	margin: 0;
}

#tv-channels-table th {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	font-weight: 600;
	padding: 16px 18px;
	text-align: left;
	border-bottom: 2px solid #dee2e6;
	color: #1f2937;
	position: sticky;
	top: 0;
	z-index: 10;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#tv-channels-table td {
	padding: 14px 18px;
	border-bottom: 1px solid #e9ecef;
	vertical-align: middle;
	font-size: 14px;
	color: #374151;
	background: #ffffff;
}

#tv-channels-table tbody tr {
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	border-left: 3px solid transparent;
}

#tv-channels-table tbody tr:hover {
	background: #f1f5f9;
	border-left-color: #2563eb;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
	transform: translateX(2px);
}

#tv-channels-table tbody tr:nth-child(even) {
	background: #f8f9fa;
}

#tv-channels-table tbody tr:nth-child(even):hover {
	background: #f1f5f9;
}

#tv-channels-table tbody tr.selected {
	background: #e5e7eb;
}

#tv-channels-table .tv-table-logo {
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

#tv-channels-table .tv-table-logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	padding: 6px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	transition: all 0.2s ease;
}

#tv-channels-table .tv-table-logo img:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

#tv-channels-table .tv-table-website a {
	color: #2563eb;
	text-decoration: none;
	font-size: 13px;
	word-break: break-all;
	font-weight: 500;
	transition: all 0.2s ease;
	padding: 4px 8px;
	border-radius: 4px;
	display: inline-block;
}

#tv-channels-table .tv-table-website a:hover {
	color: #1d4ed8;
	background: rgba(37, 99, 235, 0.1);
	text-decoration: none;
	transform: translateY(-1px);
}

/* Loading state */
.tv-table-loading {
	text-align: center;
	padding: 60px 40px;
	color: #6c757d;
	font-style: italic;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 12px;
}

.tv-table-loading::before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid #e9ecef;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin-right: 12px;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.tv-table-empty {
	text-align: center;
	padding: 60px 40px;
	color: #868e96;
	font-size: 15px;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 12px;
}

/* DataTables controls layout */
.dataTables_wrapper {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Custom containers for DataTables controls */
.tvwc-table-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: #ffffff;
	border-bottom: 1px solid #e9ecef;
	flex-wrap: wrap;
}

.tvwc-table-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: #ffffff;
	border-top: 1px solid #e9ecef;
	flex-wrap: wrap;
}

/* Top row: length selector and search filter */
.tvwc-table-top .dataTables_length,
.tvwc-table-top .dataTables_filter {
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
}

.tvwc-table-top .dataTables_length {
	order: 1;
}

.tvwc-table-top .dataTables_filter {
	order: 2;
	margin-left: auto;
}

/* Bottom row: info and pagination */
.tvwc-table-bottom .dataTables_info,
.tvwc-table-bottom .dataTables_paginate {
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
}

.tvwc-table-bottom .dataTables_info {
	order: 1;
}

.tvwc-table-bottom .dataTables_paginate {
	order: 2;
	margin-left: auto;
}

/* DataTables pagination styling */
.dataTables_wrapper .dataTables_paginate {
	margin-top: 0;
	padding: 10px 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
	padding: 10px 16px;
	margin: 0 4px;
	border: 2px solid #dee2e6;
	border-radius: 8px;
	background: #ffffff;
	color: #374151;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
	background: #f1f5f9;
	border-color: #2563eb;
	color: #2563eb;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
	background: #2563eb;
	border-color: #2563eb;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
	transform: translateY(-2px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
	color: #9ca3af;
	cursor: not-allowed;
	opacity: 0.5;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
	background: #ffffff;
	border-color: #dee2e6;
	color: #9ca3af;
	transform: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dataTables_wrapper .dataTables_info {
	margin: 0;
	padding: 0;
	color: #374151;
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
}

.dataTables_wrapper .dataTables_length {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dataTables_wrapper .dataTables_length label {
	margin: 0;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

.dataTables_wrapper .dataTables_length select {
	padding: 8px 12px;
	border: 2px solid #dee2e6;
	border-radius: 6px;
	background: #ffffff;
	color: #374151;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	margin: 0;
}

.dataTables_wrapper .dataTables_length select:hover {
	border-color: #2563eb;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.dataTables_wrapper .dataTables_length select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dataTables_wrapper .dataTables_filter {
	display: flex;
	align-items: center;
}

.dataTables_wrapper .dataTables_filter label {
	margin: 0;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

.dataTables_wrapper .dataTables_filter input {
	padding: 8px 12px;
	border: 2px solid #dee2e6;
	border-radius: 6px;
	background: #ffffff;
	color: #374151;
	font-size: 13px;
	transition: all 0.2s ease;
	margin: 0;
}

.dataTables_wrapper .dataTables_filter input:hover {
	border-color: #2563eb;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.dataTables_wrapper .dataTables_filter input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Responsive adjustments */
@media (max-width: 992px) {
	.tv-table-wrapper {
		flex-direction: column;
		min-height: auto;
	}
	
	.tv-table-sidebar {
		width: 100%;
		min-width: auto;
		height: 300px;
		max-height: 300px;
		order: 1;
	}
	
	.tv-table-main {
		width: 100%;
		order: 2;
	}
	
	.tv-table-container {
		height: 500px;
	}
	
	.tv-table-container .dataTables_scrollBody {
		max-height: calc(500px - 120px) !important;
	}
	
	.tvwc-table-top,
	.tvwc-table-bottom {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
	
	.tvwc-table-top .dataTables_filter,
	.tvwc-table-bottom .dataTables_paginate {
		margin-left: 0;
		width: 100%;
	}
	
	.tvwc-table-top .dataTables_filter input {
		width: 100%;
	}
}

@media (max-width: 768px) {
	.tv-table-wrapper {
		margin: 15px 0;
		gap: 15px;
	}
	
	.tv-table-sidebar {
		height: 250px;
		max-height: 250px;
		padding: 15px;
	}
	
	.tv-table-sidebar h3 {
		font-size: 16px;
		margin-bottom: 15px;
	}
	
	.tv-country-link {
		padding: 10px 12px;
		font-size: 13px;
	}
	
	.tv-table-container {
		height: 450px;
	}
	
	.tv-table-container .dataTables_scrollBody {
		max-height: calc(450px - 120px) !important;
	}
	
	#tv-channels-table th,
	#tv-channels-table td {
		padding: 10px 12px;
		font-size: 12px;
	}
	
	#tv-channels-table th {
		font-size: 11px;
		padding: 12px;
	}
	
	#tv-channels-table .tv-table-logo {
		width: 40px;
		height: 40px;
	}
	
	.tvwc-table-top,
	.tvwc-table-bottom {
		padding: 12px;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
	
	.tvwc-table-top .dataTables_length,
	.tvwc-table-top .dataTables_filter,
	.tvwc-table-bottom .dataTables_info,
	.tvwc-table-bottom .dataTables_paginate {
		width: 100%;
		margin: 0;
	}
	
	.tvwc-table-top .dataTables_filter input {
		width: 100%;
	}
	
	.dataTables_wrapper .dataTables_paginate {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px;
	}
	
	.dataTables_wrapper .dataTables_paginate .paginate_button {
		padding: 6px 10px;
		font-size: 12px;
		margin: 0;
	}
}

@media (max-width: 480px) {
	.tv-table-sidebar {
		height: 200px;
		max-height: 200px;
		padding: 12px;
	}
	
	.tv-table-container {
		height: 400px;
	}
	
	.tv-table-container .dataTables_scrollBody {
		max-height: calc(400px - 120px) !important;
	}
	
	#tv-channels-table th,
	#tv-channels-table td {
		padding: 8px 10px;
		font-size: 11px;
	}
	
	.tvwc-table-top,
	.tvwc-table-bottom {
		padding: 10px;
	}
	
	.dataTables_wrapper .dataTables_length label,
	.dataTables_wrapper .dataTables_filter label,
	.dataTables_wrapper .dataTables_info {
		font-size: 12px;
	}
	
	.dataTables_wrapper .dataTables_length select,
	.dataTables_wrapper .dataTables_filter input {
		padding: 6px 10px;
		font-size: 12px;
	}
	
	.dataTables_wrapper .dataTables_paginate .paginate_button {
		padding: 5px 8px;
		font-size: 11px;
	}
}
