/* ==========================================================================
   Saransh Dainik — Live TV public pages (Phase 2)
   Listing (grid/cards/empty) + Player page. Responsive desktop/tablet/mobile.
   ========================================================================== */
.live-tv-page,
.live-tv-player-page {
	padding-top: 24px;
	padding-bottom: 48px;
}

/* ---- Header ---- */
.live-tv-head {
	margin-bottom: 20px;
}
.live-tv-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 4px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.live-tv-sub {
	color: #666;
	margin: 0;
	font-size: 14px;
}
.live-tv-badge {
	display: inline-block;
	background: #e74c3c;
	color: #fff;
	font-size: 11px;
	letter-spacing: 1px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 3px;
	vertical-align: middle;
	animation: live-tv-pulse 1.6s infinite;
}
@keyframes live-tv-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .55; }
}

/* ---- Search ---- */
.live-tv-search {
	display: flex;
	max-width: 460px;
	margin: 0 0 16px;
	gap: 8px;
}
.live-tv-search input[type="search"] {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 9px 12px;
	font-size: 14px;
}
.live-tv-search button {
	border: 0;
	border-radius: 4px;
	background: #e74c3c;
	color: #fff;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

/* ---- Category filter ---- */
.live-tv-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}
.live-tv-cats a {
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 5px 14px;
	font-size: 13px;
	color: #444;
	text-decoration: none;
	background: #fff;
	transition: background .15s, color .15s, border-color .15s;
}
.live-tv-cats a:hover {
	border-color: #e74c3c;
	color: #e74c3c;
}
.live-tv-cats a.active {
	background: #e74c3c;
	border-color: #e74c3c;
	color: #fff;
}

/* ---- Channel grid / cards ---- */
.live-tv-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}
.live-tv-card {
	display: block;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: #222;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
	transition: transform .15s, box-shadow .15s;
}
.live-tv-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
	text-decoration: none;
	color: #222;
}
.live-tv-card-logo {
	position: relative;
	height: 110px;
	background: linear-gradient(135deg, #f5f5f5, #ececec);
	display: flex;
	align-items: center;
	justify-content: center;
}
.live-tv-card-logo img {
	max-width: 70%;
	max-height: 70%;
	object-fit: contain;
}
.live-tv-live {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #e74c3c;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .5px;
	padding: 2px 7px;
	border-radius: 3px;
}
.live-tv-card-body {
	padding: 12px;
}
.live-tv-card-name {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 4px;
	line-height: 1.3;
}
.live-tv-card-cat {
	font-size: 12px;
	color: #888;
}

/* ---- Empty state (valid when 0 channels are publishable) ---- */
.live-tv-empty {
	text-align: center;
	padding: 70px 20px;
	border: 1px dashed #ddd;
	border-radius: 8px;
	background: #fafafa;
}
.live-tv-empty-icon {
	font-size: 48px;
	margin-bottom: 12px;
}
.live-tv-empty h2 {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 8px;
	color: #333;
}
.live-tv-empty p {
	color: #777;
	margin: 0;
}

/* ---- Pagination ---- */
.live-tv-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 28px;
}
.live-tv-page-btn {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 7px 16px;
	color: #444;
	font-size: 14px;
	text-decoration: none;
}
.live-tv-page-btn:hover {
	border-color: #e74c3c;
	color: #e74c3c;
	text-decoration: none;
}
.live-tv-page-info {
	color: #888;
	font-size: 13px;
}

/* ==========================================================================
   Player page
   ========================================================================== */
.live-tv-player-head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
}
.live-tv-player-logo {
	width: 84px;
	height: 84px;
	flex: 0 0 84px;
	border: 1px solid #eee;
	border-radius: 8px;
	background: #fafafa;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.live-tv-player-logo img {
	max-width: 90%;
	max-height: 90%;
	object-fit: contain;
}
.live-tv-player-name {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 6px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.live-tv-player-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.live-tv-player-tag {
	background: #f1f1f1;
	border-radius: 4px;
	padding: 3px 10px;
	font-size: 12px;
	color: #555;
}

.live-tv-video-wrap {
	position: relative;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 28px;
}
.live-tv-video {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	display: block;
}

/* Player error overlay */
.live-tv-video-error {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: #111;
	color: #fff;
	text-align: center;
	padding: 20px;
}
.live-tv-video-error[hidden] {
	display: none;
}
.live-tv-error-msg {
	font-size: 17px;
	margin: 0;
}
.live-tv-error-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
}
.live-tv-btn {
	background: #e74c3c;
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 9px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}
.live-tv-btn:hover {
	color: #fff;
	text-decoration: none;
	opacity: .92;
}
.live-tv-btn-ghost {
	background: transparent;
	border: 1px solid #666;
	color: #ddd;
}
.live-tv-btn-ghost:hover {
	color: #fff;
	border-color: #aaa;
}

/* Related rail */
.live-tv-related-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px;
}
.live-tv-grid-related .live-tv-card-logo {
	height: 88px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
	.live-tv-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (max-width: 767px) {
	.live-tv-title { font-size: 22px; }
	.live-tv-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.live-tv-card-logo { height: 92px; }
	.live-tv-search { max-width: 100%; }
	.live-tv-player-name { font-size: 20px; }
	.live-tv-player-logo { width: 64px; height: 64px; flex-basis: 64px; }
}
@media (max-width: 420px) {
	.live-tv-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
	.live-tv-card-logo { height: 80px; }
}

/* ==========================================================================
   Phase 3 — SIMPLE single-page player (one player + working channel grid)
   ========================================================================== */
.live-tv-simple { padding-top: 20px; }

/* ---- Player section ---- */
.ltv-player-section {
	margin-bottom: 26px;
	background: #111;
	border-radius: 12px;
	padding: 10px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.live-tv-simple .live-tv-video-wrap {
	margin-bottom: 0;
	border-radius: 8px;
}

/* Center overlay (spinner) */
.ltv-big-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: rgba(0, 0, 0, .35);
	color: #fff;
	font-size: 14px;
	pointer-events: none;
}
.ltv-big-center[hidden] { display: none; }
.ltv-spinner {
	width: 42px;
	height: 42px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #e74c3c;
	border-radius: 50%;
	animation: ltv-rotate .8s linear infinite;
}

/* Tap to Play overlay (shown only when autoplay is blocked — NOT a failure) */
.ltv-tap-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
	cursor: pointer;
	z-index: 5;
}
.ltv-tap-play[hidden] {
	display: none;
}
.ltv-tap-play-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	padding: 24px;
}
.ltv-tap-play-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 74px;
	height: 74px;
	border-radius: 50%;
	background: rgba(231, 76, 60, .92);
	font-size: 30px;
	padding-left: 7px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
.ltv-tap-play-label {
	font-size: 16px;
	font-weight: 600;
	text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}
@keyframes ltv-rotate { to { transform: rotate(360deg); } }

/* ---- Now Playing bar ---- */
.ltv-now-playing {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 8px 4px;
	flex-wrap: wrap;
}
.ltv-now-logo {
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
	border-radius: 8px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.ltv-now-logo img { max-width: 92%; max-height: 92%; object-fit: contain; }
.ltv-now-meta { min-width: 0; flex: 1 1 auto; }
.ltv-now-name {
	font-size: 20px;
	font-weight: 700;
	color: #fff;
	line-height: 1.25;
	margin: 0 0 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ltv-now-status {
	display: flex;
	align-items: center;
	gap: 8px;
}
.ltv-now-status-text { color: #ccc; font-size: 13px; }
.ltv-now-count {
	text-align: right;
	color: #fff;
	background: rgba(255, 255, 255, .08);
	border-radius: 8px;
	padding: 8px 14px;
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}
.ltv-now-count strong { font-size: 22px; }
.ltv-now-count span { font-size: 11px; color: #bbb; text-transform: uppercase; letter-spacing: .5px; }

/* ---- Search + category chips (JS-driven) ---- */
.ltv-controls {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}
.ltv-search {
	width: 100%;
	max-width: 460px;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 11px 14px;
	font-size: 15px;
}
.ltv-search:focus { outline: none; border-color: #e74c3c; }
.live-tv-cat {
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 6px 14px;
	font-size: 13px;
	color: #444;
	background: #fff;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
	font-family: inherit;
}
.live-tv-cat:hover { border-color: #e74c3c; color: #e74c3c; }
.live-tv-cat.active { background: #e74c3c; border-color: #e74c3c; color: #fff; }

/* ---- Compact cards (buttons) ---- */
.live-tv-simple .live-tv-grid { gap: 14px; }
.live-tv-simple .live-tv-card {
	width: 100%;
	text-align: left;
	font: inherit;
	color: #222;
	border: 2px solid transparent;
	border-radius: 10px;
	cursor: pointer;
}
.live-tv-simple .live-tv-card:hover { border-color: #f1b8b2; }
.live-tv-simple .live-tv-card.selected {
	border-color: #e74c3c;
	box-shadow: 0 0 0 3px rgba(231, 76, 60, .18), 0 6px 16px rgba(0, 0, 0, .1);
	transform: translateY(-2px);
}
.live-tv-simple .live-tv-card-logo { height: 96px; }
.live-tv-card-name { display: block; }

/* ---- Load More ---- */
.ltv-loadmore-wrap {
	display: flex;
	justify-content: center;
	margin-top: 26px;
}
.ltv-loadmore {
	min-width: 180px;
	padding: 11px 24px;
}
.ltv-loadmore[hidden] { display: none; }

/* ---- Responsive for the simple player ---- */
@media (max-width: 767px) {
	.ltv-now-name { font-size: 17px; }
	.ltv-now-count { padding: 6px 10px; }
	.ltv-now-count strong { font-size: 18px; }
	.ltv-now-logo { width: 44px; height: 44px; flex-basis: 44px; }
	.live-tv-simple .live-tv-card-logo { height: 86px; }
}
@media (max-width: 420px) {
	.live-tv-simple .live-tv-card-logo { height: 76px; }
	.ltv-now-count { flex: 1 1 100%; text-align: left; flex-direction: row; align-items: baseline; gap: 6px; }
}

/* ==========================================================================
   Phase 4 — COMPACT /live-tv + HOMEPAGE Live TV
   ========================================================================== */

/* ---- Compact /live-tv ---- */
.live-tv-simple { padding-top: 14px; }
.live-tv-head { margin-bottom: 14px; }
.live-tv-title { font-size: 24px; }

/* Player wrap: sensible max-width, centered; height comes from aspect-ratio */
.ltv-player-wrap { width: 100%; max-width: 960px; margin: 0 auto; }
.live-tv-simple .ltv-player-section {
	background: transparent;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
	margin-bottom: 18px;
}
.live-tv-simple .live-tv-video-wrap {
	margin-bottom: 12px;
	border-radius: 10px;
	aspect-ratio: 16 / 9;
}
.live-tv-simple .live-tv-video {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

/* Now playing: constrained + compact */
.live-tv-simple .ltv-now-playing {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 0 6px;
	gap: 12px;
}
.live-tv-simple .ltv-now-logo { width: 44px; height: 44px; flex-basis: 44px; }
.live-tv-simple .ltv-now-name { font-size: 17px; }
.live-tv-simple .ltv-now-count { padding: 6px 12px; }
.live-tv-simple .ltv-now-count strong { font-size: 18px; }

/* ---- Horizontal quick channel strip ---- */
.ltv-strip-wrap { max-width: 960px; margin: 10px auto 0; }
.ltv-strip-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	margin: 0 0 8px;
	color: #555;
}
.ltv-strip {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 2px 2px 10px;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.ltv-strip::-webkit-scrollbar { height: 6px; }
.ltv-strip::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.ltv-strip-item {
	flex: 0 0 auto;
	width: 96px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	border: 1px solid #ececec;
	border-radius: 10px;
	padding: 10px 8px 8px;
	background: #fff;
	cursor: pointer;
	font: inherit;
	color: #222;
	text-align: center;
}
.ltv-strip-item:hover { border-color: #e74c3c; }
.ltv-strip-item.selected { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231, 76, 60, .18); }
.ltv-strip-item img { width: 52px; height: 52px; object-fit: contain; }
.ltv-strip-name {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- Compact grid: 6 wide / 4 medium / 2 mobile ---- */
.live-tv-simple .live-tv-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; }
.live-tv-simple .live-tv-card-logo { height: 72px; }
.live-tv-simple .live-tv-card-body { padding: 8px 8px 9px; }
.live-tv-simple .live-tv-card-name { font-size: 13px; margin: 0 0 2px; }
.live-tv-simple .live-tv-card-cat { font-size: 11px; }
.live-tv-simple .live-tv-live { top: 5px; right: 5px; font-size: 9px; }

/* Viewport-reveal hidden state (toggled by the player JS) */
.ltv-hidden { display: none !important; }

/* ---- Load More compact ---- */
.ltv-loadmore-wrap { margin-top: 18px; }
.ltv-loadmore { min-width: 170px; padding: 10px 20px; }

/* ---- Search / category compact + scrollable chips ---- */
.ltv-controls { margin-bottom: 16px; }
.live-tv-cats {
	flex-wrap: nowrap;
	overflow-x: auto;
	padding-bottom: 4px;
	margin-bottom: 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.live-tv-cat { flex: 0 0 auto; }

/* ---- Responsive ---- */
@media (max-width: 1199px) {
	.live-tv-simple .live-tv-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
	.live-tv-simple .live-tv-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.live-tv-simple .live-tv-card-logo { height: 64px; }
	.ltv-strip-item { width: 84px; }
	.ltv-strip-item img { width: 46px; height: 46px; }
	.ltv-player-wrap { max-width: 100%; }
}

/* ==========================================================================
   HOMEPAGE LIVE TV section
   ========================================================================== */
.home-live-tv { margin: 28px 0 6px; }
.home-live-tv .home-ltv-head { margin-bottom: 14px; }
.home-ltv-head .np-section-sub {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	color: #777;
}
.home-live-tv .live-tv-video-wrap { margin-bottom: 12px; aspect-ratio: 16 / 9; }
.home-live-tv .live-tv-video { width: 100%; height: 100%; aspect-ratio: auto; }
.home-ltv-now { max-width: 960px; margin: 0 auto; padding: 12px 0 4px; }
.home-ltv-footer {
	max-width: 960px;
	margin: 8px auto 0;
	display: flex;
	justify-content: center;
}
.ltv-btn-view-all {
	display: inline-block;
	background: #e74c3c;
	color: #fff;
	border-radius: 6px;
	padding: 10px 22px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .5px;
	text-decoration: none;
}
.ltv-btn-view-all:hover { color: #fff; opacity: .92; text-decoration: none; }
@media (max-width: 767px) {
	.home-live-tv { margin: 20px 0 4px; }
}
.home-live-tv-empty {
	border: 1px dashed #ddd;
	border-radius: 10px;
	background: #fafafa;
	padding: 24px 16px;
	text-align: center;
	color: #777;
	font-size: 14px;
}
