:root {
	--bg: #0f0f0f;
	--card: #1b1b1b;
	--text: #ffffff;
	--muted: #999;
	--accent: #e50914;
}

@media (hover: none) {
	.card:hover {
		transform: none;
		box-shadow: none;
	}
}

@media (max-width: 768px) {
	header {
		flex-direction: column;
		align-items: stretch;
		position: static !important;
	}

	.logo a {
		height: 4rem !important;
	}
	
	.pagination {
		bottom: 12px;
		padding: 6px 12px;
		gap: 10px;
	}

	.pagination button {
		padding: 6px 10px;
		font-size: 12px;
	}

	#pageInfo {
		font-size: 12px;
	}

	.footer-container {
		grid-template-columns: 1fr;
		text-align: center;
	}

	.footer-brand img {
		margin: 0 auto 12px;
	}

	.footer-links a {
		margin-bottom: 10px;
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: system-ui, sans-serif;
}

/* Ads */
.ad {
	background: #222;
	color: #777;
	text-align: center;
	padding: 15px;
	margin: 10px;
	border-radius: 10px;
	font-size: 14px;
}

.ad-sidebar {
	display: none;
}

/* Header */
header {
	display: flex;
	gap: 12px;
	padding: 15px;
	align-items: center;
	background: #000;
	position: sticky;
	top: 0;
	z-index: 10;
}

.logo {
	display: flex;
	align-items: center;
}

.logo a {
	display: block;
	height: 5rem;
}

.logo img {
	height: 100%;
	width: auto;
	object-fit: contain;
}

header input,
header select {
	background: #1c1c1c;
	border: none;
	color: white;
	padding: 10px;
	border-radius: 8px;
	width: 100%;
}

/* Layout */
main {
	display: flex;
	padding: 15px;
}

/* Grid */
.grid {
	display: grid;
	gap: 15px;
	width: 100%;
	grid-template-columns: repeat(2, 1fr);
}

/* Card */
.card {
	background: linear-gradient(180deg, #1b1b1b, #121212);
	border-radius: 18px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
	position: relative;
}

.card:hover {
	transform: translateY(-8px) scale(1.02);
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

.card::after {
	content: "▶";
	position: absolute;
	bottom: 12px;
	right: 14px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.15);
}

.card img {
	width: 100%;
	height: 140px;
	object-fit: contain;
	/* background: #000; */
}

.card-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.card-top {
	position: relative;
	background: #919191;
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.card-top img {
	max-width: 80%;
	max-height: 80%;
	object-fit: contain;
	transition: transform 0.3s ease;
}

.card:hover .card-top img {
	transform: scale(1.05);
}

.card-info {
	padding: 10px;
}

.card-bottom {
	padding: 12px;
}

.card-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.card-meta {
	font-size: 11px;
	color: #999;
	margin-top: 4px;
}

.fav-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	color: #aaa;
	font-size: 18px;
	padding: 6px 8px;
	border-radius: 50%;
	cursor: pointer;
	z-index: 5;
	transition: all 0.25s ease;
}

.fav-btn:hover {
	background: rgba(0, 0, 0, 0.85);
	transform: scale(1.1);
}

.fav-btn.active, .fav-btn-modal.active {
	color: yellow;
	text-shadow: 0 0 8px rgb(0 0 0 / 80%);
}

.fav-btn-modal {
	position: absolute;
	top: 8px;
	left: 8px;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	color: #aaa;
	font-size: 18px;
	padding: 6px 8px;
	border-radius: 50%;
	cursor: default;
	z-index: 5;
	transition: all 0.25s ease;
}

.badge {
	font-size: 11px;
	color: var(--muted);
}

/* Modal */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100;
}

.modal-content {
	background: #000;
	width: 90%;
	max-width: 800px;
	border-radius: 14px;
	position: relative;
}

.modal video {
	width: 100%;
	border-radius: 14px;
}

#closeModal {
	position: absolute;
	top: 10px;
	right: 12px;
	font-size: 28px;
	background: none;
	color: red;
	border: none;
	cursor: pointer;
	z-index: 1;
	font-weight: bolder;
}

/* Loading */
.loading {
	text-align: center;
	padding: 40px;
	color: var(--muted);
	font-size: 2rem;
	font-weight: bold;
}

/* Responsive */
@media (min-width: 768px) {
	.grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.grid {
		grid-template-columns: repeat(5, 1fr);
	}

	.ad-sidebar {
		display: block;
		width: 260px;
		margin-right: 15px;
	}
}

/* Toast Styles */
#toastContainer {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 9999;
}

.toast {
	padding: 12px 20px;
	margin-top: 10px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	font-size: 14px;
	color: #fff;
}

/* Colors based on type */
.toast.success {
	background: #28a745;
}

/* green */
.toast.error {
	background: #dc3545;
}

/* red */
.toast.warning {
	background: #ffc107;
	color: #000;
}

/* yellow */
.toast.info {
	background: #007bff;
}

/* blue */

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

.video-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: var(--accent);
	font-size: 18px;
	font-weight: bold;
	background: rgba(0, 0, 0, 0.7);
	padding: 12px 20px;
	border-radius: 10px;
	text-align: center;
	z-index: 50;
}

.video-error1 {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #fff;
	background: rgba(0, 0, 0, 0.75);
	z-index: 5;
}

.nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.6);
	color: var(--accent);
	border: none;
	padding: 10px 14px;
	font-size: 16px;
	border-radius: 8px;
	cursor: pointer;
	z-index: 60;
	transition: background 0.2s;
}

.nav-btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

#prevChannel {
	left: 10px;
}

#nextChannel {
	right: 10px;
}

.channel-name {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.7);
	color: var(--accent);
	font-size: 18px;
	font-weight: bold;
	padding: 6px 14px;
	border-radius: 8px;
	z-index: 30;
	opacity: 1;
	transition: opacity 0.5s ease;
}

.channel-name.hide {
	opacity: 0;
}

#videoPlayer {
	height: 450px;
}

.fullscreen-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
}

.overlay-name {
	color: var(--accent);
	font-size: 20px;
	font-weight: bold;
	background: rgba(0, 0, 0, 0.6);
	padding: 6px 12px;
	border-radius: 8px;
	opacity: 1;
	transition: opacity 0.5s;
}

.overlay-name.hide {
	opacity: 0;
}

.overlay-name.left {
	text-align: left;
}

.overlay-name.center {
	text-align: center;
}

.overlay-name.right {
	text-align: right;
}

/* ===== Pagination Fixed at Bottom ===== */
.pagination {
	position: fixed;
	/* fixed at viewport bottom */
	bottom: 20px;
	/* distance from bottom */
	left: 50%;
	/* center horizontally */
	transform: translateX(-50%);

	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	padding: 8px 16px;

	background: rgba(0, 0, 0, 0.6);
	/* semi-transparent background */
	border-radius: 12px;
	z-index: 1000;
	/* above everything */
	backdrop-filter: blur(6px);
	/* nice glassy effect */
	transition: opacity 0.3s ease;
}

.pagination.hidden {
	opacity: 0;
	pointer-events: none;
}

.pagination button {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.25s ease;
}

.pagination button:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.2);
	transform: translateY(-1px);
}

.pagination button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

#pageInfo {
	font-size: 14px;
	color: #fff;
	opacity: 0.9;
}

#firstPage:disabled,
#lastPage:disabled {
	opacity: 0.4;
}

#firstPage:hover:not(:disabled),
#lastPage:hover:not(:disabled) {
	opacity: 1;
}

.content-wrapper {
	padding: 0 2rem;
}

/* ===== FOOTER ===== */
.site-footer {
	background: #000;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.75);
	font-size: 14px;
	margin-top: 60px;
}

.footer-container {
	max-width: 1300px;
	margin: auto;
	padding: 40px 20px;
	display: grid;
	grid-template-columns: 2fr 1fr 2fr;
	gap: 30px;
}

.footer-brand img {
	height: 65px;
}

.footer-brand p {
	line-height: 1.6;
	max-width: 420px;
	margin: 0;
}

.footer-links h4,
.footer-disclaimer h4 {
	margin-bottom: 10px;
	font-size: 15px;
	color: #fff;
}

.footer-links a {
	display: block;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	margin-bottom: 6px;
	transition: color 0.2s ease;
}

.footer-links a:hover {
	color: #e50914;
}

.footer-disclaimer p {
	line-height: 1.6;
}

.footer-bottom {
	text-align: center;
	padding: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.5);
}
