/* Esyconnect OTT — front-end styles */

:root {
	--esy-bg: #0b0b0f;
	--esy-surface: #16161d;
	--esy-surface-2: #1e1e27;
	--esy-accent: #ff3b5c;
	--esy-accent-dim: #ff3b5c33;
	--esy-text: #f5f5f7;
	--esy-text-dim: #a3a3ad;
	--esy-border: #2a2a33;
	--esy-radius: 12px;
	--esy-success: #4ade80;
}

.esy-player-page *,
.esy-video-grid *,
.esy-shorts-feed *,
.esy-submit-wrap * {
	box-sizing: border-box;
}

/* ================= Shorts feed (doom-scroll) ================= */
.esy-shorts-feed {
	position: relative;
	max-width: 480px;
	margin: 0 auto;
	height: 85vh;
	max-height: 860px;
	overflow-y: scroll;
	scroll-snap-type: y mandatory;
	background: #000;
	border-radius: 16px;
	scrollbar-width: none;
}
.esy-shorts-feed::-webkit-scrollbar { display: none; }

.esy-short-slide {
	position: relative;
	width: 100%;
	height: 85vh;
	max-height: 860px;
	scroll-snap-align: start;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.esy-short-player { width: 100%; height: 100%; }
.esy-short-player iframe {
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none; /* playback controlled by our own tap/mute button */
}

.esy-short-progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(255,255,255,.2);
	z-index: 3;
}
.esy-short-progress-bar {
	display: block;
	height: 100%;
	width: 0%;
	background: var(--esy-accent);
	transition: width .25s linear;
}

.esy-short-overlay {
	position: absolute;
	left: 16px;
	bottom: 20px;
	right: 70px;
	color: var(--esy-text);
	text-shadow: 0 1px 6px rgba(0,0,0,.8);
	pointer-events: none;
}
.esy-short-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.esy-short-author { font-size: 13px; color: var(--esy-text-dim); margin: 0; }

.esy-mute-toggle {
	position: absolute;
	right: 16px;
	bottom: 24px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,.15);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	backdrop-filter: blur(4px);
}

.esy-shorts-loading {
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--esy-text-dim);
	font-size: 13px;
}

/* ================= Long-form video grid (OTT library) ================= */
.esy-video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
	background: var(--esy-bg);
	padding: 20px;
	border-radius: var(--esy-radius);
}

.esy-video-card {
	display: block;
	text-decoration: none;
	color: var(--esy-text);
	background: var(--esy-surface);
	border-radius: 10px;
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.esy-video-card:hover {
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0 12px 28px rgba(0,0,0,.55);
}

.esy-card-thumb {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	background-size: cover;
	background-position: center;
	background-color: #000;
}
.esy-play-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 34px;
	color: #fff;
	opacity: 0;
	background: rgba(0,0,0,.35);
	transition: opacity .15s ease;
}
.esy-video-card:hover .esy-play-icon { opacity: 1; }

.esy-card-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--esy-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 5px;
}

.esy-card-body { padding: 10px 12px 14px; }
.esy-card-body h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.esy-card-body p { margin: 0; font-size: 12px; color: var(--esy-text-dim); }

/* ================= Single long-video OTT player page ================= */
.esy-player-page {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 16px 60px;
	color: var(--esy-text);
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}

.esy-player-main { min-width: 0; }

.esy-player-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	border-radius: var(--esy-radius);
	overflow: hidden;
	background: #000;
}
.esy-player-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Auto-extracted live timeline: current-time / duration progress + chapter ticks */
.esy-progress-track {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 6px;
	background: rgba(255,255,255,.18);
	cursor: pointer;
	z-index: 3;
}
.esy-progress-fill {
	position: absolute;
	inset: 0;
	width: 0%;
	background: var(--esy-accent);
	pointer-events: none;
}
.esy-progress-marker {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 3px;
	transform: translateX(-1px);
	background: #fff;
	border: 0;
	padding: 0;
	cursor: pointer;
	opacity: .85;
}
.esy-progress-marker:hover { opacity: 1; background: var(--esy-text-dim); }

/* "Up next" countdown overlay — Netflix-style autoplay, platform-only content */
.esy-upnext-overlay {
	position: absolute;
	inset: 0;
	background: rgba(6,6,10,.86);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 4;
}
.esy-upnext-card {
	display: flex;
	gap: 16px;
	max-width: 460px;
	background: var(--esy-surface);
	border-radius: var(--esy-radius);
	padding: 16px;
	align-items: center;
	box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.esy-upnext-thumb {
	flex: 0 0 120px;
	height: 68px;
	border-radius: 8px;
	background-size: cover;
	background-position: center;
	background-color: #000;
}
.esy-upnext-info { min-width: 0; }
.esy-upnext-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--esy-text-dim); margin-bottom: 4px; }
.esy-upnext-info h4 { margin: 0 0 10px; font-size: 14px; line-height: 1.3; }
.esy-upnext-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.esy-upnext-actions .esy-btn,
.esy-upnext-actions .esy-btn-outline { margin-top: 0; padding: 8px 14px; font-size: 13px; }

.esy-endoflibrary-overlay {
	position: absolute;
	inset: 0;
	background: rgba(6,6,10,.86);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: var(--esy-text-dim);
	font-size: 14px;
	z-index: 4;
}
.esy-endoflibrary-overlay span { display: block; margin-top: 4px; font-size: 12px; }

.esy-player-meta { margin-top: 18px; }
.esy-player-meta h1 { font-size: 24px; margin: 0 0 8px; line-height: 1.3; }
.esy-player-submeta { color: var(--esy-text-dim); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.esy-dot { opacity: .5; }

/* Chapters list under the player */
.esy-chapters-list { margin-top: 22px; }
.esy-chapters-list h3 { font-size: 15px; margin: 0 0 10px; }
.esy-chapters-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.esy-chapter-item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s ease;
}
.esy-chapter-item:hover { background: var(--esy-surface); }
.esy-chapter-item.is-active { background: var(--esy-accent-dim); }
.esy-chapter-time {
	font-variant-numeric: tabular-nums;
	font-size: 12px;
	color: var(--esy-text-dim);
	min-width: 42px;
}
.esy-chapter-item.is-active .esy-chapter-time { color: var(--esy-accent); font-weight: 700; }
.esy-chapter-label { font-size: 14px; }

/* Episode sidebar — Season/Episode grouping ("season chapters") */
.esy-episode-sidebar {
	background: var(--esy-surface);
	border-radius: var(--esy-radius);
	padding: 16px;
	align-self: start;
}
.esy-episode-sidebar h3 { font-size: 15px; margin: 0 0 14px; }
.esy-episode-count { color: var(--esy-text-dim); font-weight: 400; font-size: 13px; }
.esy-episode-list { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; }
.esy-episode-row {
	display: flex;
	gap: 10px;
	text-decoration: none;
	color: var(--esy-text);
	border-radius: 8px;
	padding: 6px;
	transition: background .15s ease;
}
.esy-episode-row:hover { background: var(--esy-surface-2); }
.esy-episode-row.is-current { background: var(--esy-accent-dim); }
.esy-episode-thumb {
	position: relative;
	flex: 0 0 110px;
	height: 62px;
	border-radius: 6px;
	background-size: cover;
	background-position: center;
	background-color: #000;
}
.esy-episode-playing {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,.5);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 6px;
}
.esy-episode-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.esy-episode-num { font-size: 11px; color: var(--esy-text-dim); }
.esy-episode-title { font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.esy-related-heading { max-width: 1280px; margin: 36px auto 12px; padding: 0 16px; font-size: 18px; color: var(--esy-text); }

/* ================= Submission form ================= */
.esy-submit-wrap {
	max-width: 480px;
	margin: 0 auto;
	background: var(--esy-surface);
	color: var(--esy-text);
	padding: 24px;
	border-radius: var(--esy-radius);
}
.esy-form { display: flex; flex-direction: column; gap: 6px; }
.esy-form label { font-size: 13px; color: var(--esy-text-dim); margin-top: 10px; }
.esy-optional { color: var(--esy-text-dim); font-weight: 400; }
.esy-form input[type="url"],
.esy-form input[type="text"],
.esy-form input[type="number"] {
	background: #0e0e13;
	border: 1px solid var(--esy-border);
	color: var(--esy-text);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	width: 100%;
}
.esy-type-toggle { display: flex; gap: 20px; font-size: 14px; }
.esy-series-fields {
	margin-top: 12px;
	padding: 12px;
	background: #0e0e13;
	border: 1px dashed var(--esy-border);
	border-radius: 8px;
}
.esy-season-ep-row { display: flex; gap: 16px; margin-top: 8px; }
.esy-season-ep-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-top: 0; }
.esy-season-ep-row input { width: 90px; }
.esy-form-message { font-size: 13px; min-height: 18px; }

.esy-channel-notice {
	background: var(--esy-accent-dim);
	border: 1px solid var(--esy-accent);
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 13px;
}
.esy-channel-notice strong { display: block; margin-bottom: 4px; }
.esy-channel-notice p { margin: 0; color: var(--esy-text-dim); }

.esy-channel-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--esy-text-dim);
	background: #0e0e13;
	border-radius: 8px;
	padding: 8px 12px;
	margin-bottom: 16px;
}
.esy-channel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--esy-success); flex: none; }

.esy-btn {
	margin-top: 14px;
	display: inline-block;
	text-align: center;
	background: var(--esy-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 11px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}
.esy-btn-outline {
	background: transparent;
	border: 1px solid var(--esy-accent);
	color: var(--esy-accent);
	margin-left: 8px;
}

.esy-login-prompt { text-align: center; }

/* ================= Responsive: tablet & laptop ================= */
@media (min-width: 900px) {
	.esy-player-page {
		grid-template-columns: minmax(0, 1fr) 340px;
		align-items: start;
	}
	.esy-episode-sidebar { position: sticky; top: 24px; }
}

@media (min-width: 1400px) {
	.esy-video-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ================= Responsive: mobile ================= */
@media (max-width: 600px) {
	.esy-shorts-feed { border-radius: 0; height: 100vh; max-height: none; }
	.esy-short-slide { height: 100vh; max-height: none; }

	.esy-player-page { padding: 0 0 40px; gap: 20px; }
	.esy-player-wrap { border-radius: 0; }
	.esy-player-meta,
	.esy-chapters-list,
	.esy-episode-sidebar { margin-left: 12px; margin-right: 12px; }
	.esy-player-meta h1 { font-size: 19px; }

	.esy-upnext-card { flex-direction: column; text-align: center; }
	.esy-upnext-thumb { width: 100%; flex-basis: auto; }
	.esy-upnext-actions { justify-content: center; }

	.esy-video-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
	.esy-card-body h4 { font-size: 12.5px; }
	.esy-card-body p { font-size: 11px; }

	.esy-submit-wrap { border-radius: 0; margin: 0; max-width: none; }
}
