/**
 * JCT Livestream — frontend styles.
 * Theme-agnostic: everything is scoped under .jct-ls and inherits the
 * theme's typography.
 */

.jct-ls {
	--jct-ls-blue: #2271b1;
	--jct-ls-red: #d63638;
	--jct-ls-green: #00a32a;
	--jct-ls-gray: #646970;
	--jct-ls-border: #e0e0e0;
	--jct-ls-radius: 8px;
}

.jct-ls *,
.jct-ls *::before,
.jct-ls *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------
 * Badges
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-badge {
	display: inline-block;
	padding: 0.15em 0.65em;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	line-height: 1.6;
	vertical-align: middle;
}

.jct-ls .jct-ls-badge--upcoming {
	background: var(--jct-ls-blue);
}

.jct-ls .jct-ls-badge--live {
	background: var(--jct-ls-red);
	animation: jct-ls-pulse 2s ease-in-out infinite;
}

.jct-ls .jct-ls-badge--replay {
	background: var(--jct-ls-green);
}

.jct-ls .jct-ls-badge--ended {
	background: var(--jct-ls-gray);
}

@keyframes jct-ls-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.65;
	}
}

.jct-ls .jct-ls-category-badge {
	display: inline-block;
	padding: 0.1em 0.6em;
	border: 1px solid var(--jct-ls-border);
	border-radius: 999px;
	font-size: 0.75em;
	color: var(--jct-ls-gray);
	line-height: 1.7;
	vertical-align: middle;
}

/* ---------------------------------------------------------------------
 * Player (responsive 16:9)
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-player {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	background: #000;
	border-radius: var(--jct-ls-radius);
	overflow: hidden;
	margin: 0 0 1rem;
}

.jct-ls .jct-ls-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.jct-ls .jct-ls-player--pending,
.jct-ls .jct-ls-player--external {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: center;
	justify-content: center;
	padding-bottom: 0;
	min-height: 200px;
	background: #1d2327;
}

.jct-ls .jct-ls-player--pending p,
.jct-ls .jct-ls-player--external p {
	color: #fff;
	margin: 0;
	padding: 0 1.5rem;
	text-align: center;
}

/* ---------------------------------------------------------------------
 * Live page: player + chat stage
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-live-main__stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

@media (min-width: 1100px) {
	.jct-ls .jct-ls-live-main__stage {
		grid-template-columns: minmax(0, 2.4fr) minmax(300px, 1fr);
		align-items: stretch;
	}
}

.jct-ls .jct-ls-live-chat {
	display: flex;
	flex-direction: column;
	min-height: 320px;
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	overflow: hidden;
}

.jct-ls .jct-ls-live-chat iframe {
	flex: 1;
	width: 100%;
	border: 0;
	min-height: 320px;
}

.jct-ls .jct-ls-live-chat__hint {
	margin: 0;
	padding: 0.5rem 0.9rem;
	font-size: 0.78em;
	color: var(--jct-ls-gray);
	border-top: 1px solid var(--jct-ls-border);
}

.jct-ls .jct-ls-live-chat--discord {
	align-items: flex-start;
	justify-content: center;
	gap: 0.5rem;
	padding: 1.25rem;
}

.jct-ls .jct-ls-live-chat--discord h3 {
	margin: 0;
}

.jct-ls .jct-ls-live-chat--discord p {
	margin: 0;
	color: var(--jct-ls-gray);
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------
 * Coach Studio
 * ------------------------------------------------------------------ */

.jct-ls-studio {
	display: grid;
	gap: 1.25rem;
}

.jct-ls-studio .jct-ls-studio-card {
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	padding: 1.4rem 1.5rem;
}

.jct-ls-studio .jct-ls-studio-card__title {
	margin: 0 0 1rem;
	font-size: 1.15em;
}

.jct-ls-studio .jct-ls-studio-live-banner {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	flex-wrap: wrap;
	padding: 1rem 1.25rem;
	border: 1px solid rgba(214, 54, 56, 0.5);
	border-radius: var(--jct-ls-radius);
	background: rgba(214, 54, 56, 0.08);
}

.jct-ls-studio .jct-ls-studio-field {
	display: grid;
	gap: 0.35rem;
	margin-bottom: 1rem;
}

.jct-ls-studio .jct-ls-studio-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0 1rem;
}

.jct-ls-studio label,
.jct-ls-studio .jct-ls-studio-label {
	font-weight: 600;
	font-size: 0.9em;
}

.jct-ls-studio input[type="text"],
.jct-ls-studio input[type="number"],
.jct-ls-studio input[type="datetime-local"],
.jct-ls-studio select {
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--jct-ls-border);
	border-radius: 8px;
	font: inherit;
	max-width: 560px;
}

.jct-ls-studio .jct-ls-studio-hint {
	margin: 0;
	font-size: 0.82em;
	color: var(--jct-ls-gray);
}

.jct-ls-studio .jct-ls-studio-when {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	flex-wrap: wrap;
}

.jct-ls-studio .jct-ls-studio-when label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 500;
}

.jct-ls-studio .jct-ls-studio-submit {
	font-size: 1.05em;
	padding: 0.75rem 2.2rem;
	letter-spacing: 0.04em;
	font-weight: 800;
}

.jct-ls-studio .jct-ls-studio-feedback {
	margin-left: 0.9rem;
	font-size: 0.9em;
	color: var(--jct-ls-green);
	font-weight: 600;
}

.jct-ls-studio .jct-ls-studio-feedback.is-error {
	color: var(--jct-ls-red);
}

.jct-ls-studio .jct-ls-studio-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}

.jct-ls-studio .jct-ls-studio-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.9rem;
	flex-wrap: wrap;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--jct-ls-border);
	border-radius: 10px;
}

.jct-ls-studio .jct-ls-studio-item__info {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	flex-wrap: wrap;
	min-width: 0;
}

.jct-ls-studio .jct-ls-studio-item__title {
	font-weight: 600;
}

.jct-ls-studio .jct-ls-studio-item__actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.jct-ls-studio .jct-ls-studio-toggle.is-live {
	background: var(--jct-ls-red);
}

/* ---------------------------------------------------------------------
 * Live page
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-live-main__header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.jct-ls .jct-ls-live-main__title {
	margin: 0;
}

.jct-ls .jct-ls-live-main__description {
	margin-top: 1rem;
}

.jct-ls .jct-ls-section-title {
	margin: 2rem 0 1rem;
}

.jct-ls .jct-ls-meta-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin: 0.5rem 0 0;
}

.jct-ls .jct-ls-coach {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.jct-ls .jct-ls-coach__avatar {
	border-radius: 50%;
	width: 28px;
	height: 28px;
}

.jct-ls .jct-ls-coach__name {
	font-weight: 600;
}

.jct-ls .jct-ls-also-live__item {
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	margin-bottom: 0.75rem;
	overflow: hidden;
}

.jct-ls .jct-ls-also-live__summary {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
	padding: 0.75rem 1rem;
	cursor: pointer;
	list-style: none;
}

.jct-ls .jct-ls-also-live__summary::-webkit-details-marker {
	display: none;
}

.jct-ls .jct-ls-also-live__title {
	font-weight: 600;
}

.jct-ls .jct-ls-also-live__coach {
	color: var(--jct-ls-gray);
	font-size: 0.9em;
}

.jct-ls .jct-ls-also-live__body {
	padding: 0 1rem 1rem;
}

.jct-ls .jct-ls-empty {
	padding: 1rem 1.25rem;
	border: 1px dashed var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	color: var(--jct-ls-gray);
}

.jct-ls .jct-ls-replays-link {
	margin-top: 1rem;
}

/* ---------------------------------------------------------------------
 * Cards & grids
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-list {
	display: grid;
	gap: 0.9rem;
}

.jct-ls .jct-ls-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
	align-items: start;
}

.jct-ls .jct-ls-card {
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	overflow: hidden;
	background: rgba(255, 255, 255, 0.6);
}

.jct-ls .jct-ls-card__body {
	padding: 0.9rem 1.1rem;
}

.jct-ls .jct-ls-card__title {
	margin: 0.25rem 0 0.5rem;
	font-size: 1.05em;
	color: inherit;
}

.jct-ls .jct-ls-card__meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.jct-ls .jct-ls-card__when {
	margin: 0;
	font-size: 0.9em;
}

.jct-ls .jct-ls-card__duration {
	color: var(--jct-ls-gray);
}

.jct-ls .jct-ls-muted {
	color: var(--jct-ls-gray);
}

/* Replay card media & inline player */

.jct-ls .jct-ls-card__media {
	position: relative;
}

.jct-ls .jct-ls-card__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.jct-ls .jct-ls-card__thumb--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1d2327, #3c434a);
}

.jct-ls .jct-ls-card__thumb-icon {
	font-size: 2.5rem;
	color: rgba(255, 255, 255, 0.85);
}

/* Replay cards always carry a .jct-ls-play control on top of the media, so
   the placeholder's own big ▶ would double up with the button's icon. */

.jct-ls .jct-ls-card--replay .jct-ls-card__thumb-icon {
	display: none;
}

.jct-ls .jct-ls-play {
	position: absolute;
	inset: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	background: rgba(0, 0, 0, 0.28);
	color: #fff;
	border: 0;
	font-size: 0.9em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
	cursor: pointer;
	transition: background 0.15s ease;
}

.jct-ls .jct-ls-play:hover,
.jct-ls .jct-ls-play:focus {
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
}

.jct-ls .jct-ls-play__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	border: 2px solid rgba(255, 255, 255, 0.85);
	font-size: 1.2em;
	padding-left: 4px;
	transition: background 0.15s ease, transform 0.15s ease;
}

.jct-ls .jct-ls-play:hover .jct-ls-play__icon,
.jct-ls .jct-ls-play:focus .jct-ls-play__icon {
	background: var(--jct-ls-green);
	border-color: var(--jct-ls-green);
	transform: scale(1.06);
}

/* ---------------------------------------------------------------------
 * Replay modal — full-size lightbox, appended to <body> once by JS.
 * Self-contained (dark regardless of surrounding theme) so it looks right
 * standalone or inside the JCT Dashboard shell.
 * ------------------------------------------------------------------ */

.jct-ls-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 4vw;
}

.jct-ls-modal[hidden] {
	display: none;
}

.jct-ls-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 6, 9, 0.85);
	backdrop-filter: blur(2px);
}

.jct-ls-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 1040px;
	z-index: 1;
}

.jct-ls-modal__body .jct-ls-player {
	margin: 0;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.jct-ls-modal__close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.jct-ls-modal__close:hover,
.jct-ls-modal__close:focus {
	background: rgba(255, 255, 255, 0.18);
}

body.jct-ls-modal-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.jct-ls-modal {
		padding: 0;
	}

	.jct-ls-modal__dialog {
		max-width: 100%;
	}

	.jct-ls-modal__body .jct-ls-player {
		border-radius: 0;
	}

	.jct-ls-modal__close {
		top: 10px;
		right: 10px;
		background: rgba(0, 0, 0, 0.55);
		border-color: rgba(255, 255, 255, 0.35);
	}
}

/* ---------------------------------------------------------------------
 * Times & countdown
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-time__local,
.jct-ls .jct-ls-time__countdown {
	display: inline-block;
	margin-left: 0.5rem;
	font-size: 0.85em;
	color: var(--jct-ls-gray);
}

.jct-ls .jct-ls-time__countdown {
	font-weight: 600;
	color: var(--jct-ls-blue);
}

/* ---------------------------------------------------------------------
 * Filter bar
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-filter-bar {
	display: flex;
	align-items: flex-end;
	gap: 0.9rem;
	flex-wrap: wrap;
	margin: 0 0 1.25rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
}

.jct-ls .jct-ls-filter-bar__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.9em;
}

.jct-ls .jct-ls-filter-bar__label {
	font-weight: 600;
}

.jct-ls .jct-ls-filter-bar select {
	min-width: 160px;
	max-width: 100%;
	padding: 0.35rem 0.5rem;
	border: 1px solid var(--jct-ls-border);
	border-radius: 4px;
}

/* ---------------------------------------------------------------------
 * Upgrade card
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-upgrade-card {
	max-width: 560px;
	margin: 0 auto 2rem;
	padding: 2rem 1.75rem;
	border: 1px solid var(--jct-ls-border);
	border-radius: var(--jct-ls-radius);
	text-align: center;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.jct-ls .jct-ls-upgrade-card__headline {
	margin: 0 0 0.5rem;
}

.jct-ls .jct-ls-upgrade-card__message {
	margin: 0 0 1.25rem;
	color: var(--jct-ls-gray);
}

.jct-ls .jct-ls-button {
	display: inline-block;
	padding: 0.6rem 1.5rem;
	border: 0;
	border-radius: 999px;
	background: var(--jct-ls-blue);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.jct-ls .jct-ls-button:hover,
.jct-ls .jct-ls-button:focus {
	opacity: 0.85;
	color: #fff;
	text-decoration: none;
}

.jct-ls .jct-ls-button--small {
	padding: 0.4rem 1.1rem;
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------ */

.jct-ls .jct-ls-pagination {
	margin-top: 1.5rem;
	text-align: center;
}

.jct-ls .jct-ls-pagination .page-numbers {
	display: inline-block;
	min-width: 2.1em;
	margin: 0 0.15em;
	padding: 0.35em 0.6em;
	border: 1px solid var(--jct-ls-border);
	border-radius: 4px;
	text-decoration: none;
}

.jct-ls .jct-ls-pagination .page-numbers.current {
	background: var(--jct-ls-blue);
	border-color: var(--jct-ls-blue);
	color: #fff;
}

/* ---------------------------------------------------------------------
 * Small screens
 * ------------------------------------------------------------------ */

@media (max-width: 480px) {
	.jct-ls .jct-ls-filter-bar {
		align-items: stretch;
		flex-direction: column;
	}

	.jct-ls .jct-ls-filter-bar select {
		width: 100%;
	}
}
