/* ==========================================================================
   Coin Episode Unlock -- visual system
   Built on Beeble's own palette (--bodybg, --heading, --body, --main).
   #71F336 (Beeble's own --btn-bgcolor) is used as this module's signature
   accent for anything currency-related (coin icon, prices, unlock CTA),
   matching the site's existing button color exactly.
   ========================================================================== */

:root {
	--ceu-accent: #71F336;
	--ceu-accent-dim: rgba(113, 243, 54, 0.13);
	--ceu-panel: #12121A;
	--ceu-panel-border: rgba(113, 243, 54, 0.16);
}

.ceu-coin-svg {
	color: var(--ceu-accent);
	flex-shrink: 0;
	vertical-align: -3px;
}

/* --------------------------------------------------------------------
   Locked episode gate (replaces the video player when coin-locked)
   -------------------------------------------------------------------- */

.ceu-locked-episode {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	min-height: 360px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bodybg, #050509);
	--ceu-poster: none;
}

.ceu-locked-backdrop {
	position: absolute;
	inset: 0;
	background-image: var(--ceu-poster);
	background-size: cover;
	background-position: center;
	filter: blur(2px) brightness(0.35) saturate(0.9);
	transform: scale(1.05);
}

.ceu-locked-backdrop::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(5, 5, 9, 0.55) 0%, rgba(5, 5, 9, 0.92) 100%);
}

.ceu-locked-panel {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 40px 32px;
	max-width: 380px;
	margin: 32px;
	border-radius: 12px;
	background: rgba(18, 18, 26, 0.72);
	border: 1px solid var(--ceu-panel-border);
	backdrop-filter: blur(6px);
}

.ceu-lock-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--ceu-accent-dim);
	color: var(--ceu-accent);
	margin-bottom: 18px;
}

.ceu-locked-message {
	font-size: 17px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--heading, #ffffff);
	margin: 0 0 22px;
}

.ceu-balance {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--body2, #a1a0a1);
	margin-bottom: 16px;
	letter-spacing: 0.2px;
}

.ceu-unlock-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 8px;
	background: var(--ceu-accent);
	color: #1a1305 !important;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.2px;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	text-decoration: none;
}

.ceu-unlock-button .ceu-coin-svg {
	color: #1a1305;
}

.ceu-unlock-button:hover,
.ceu-unlock-button:focus,
.ceu-unlock-button:active,
.ceu-unlock-button:visited {
	color: #1a1305 !important;
	box-shadow: 0 4px 18px rgba(113, 243, 54, 0.28);
	transform: translateY(-1px);
}

.ceu-unlock-button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.ceu-unlock-feedback {
	margin-top: 14px;
	font-size: 13px;
	min-height: 18px;
}

.ceu-unlock-feedback.ceu-error {
	color: #ff6b6b;
}

.ceu-unlock-feedback.ceu-success {
	color: var(--main, #48F955);
}

.ceu-topup-link {
	color: var(--ceu-accent);
	text-decoration: underline;
	margin-left: 4px;
}

/* --------------------------------------------------------------------
   Coin Store shortcode
   -------------------------------------------------------------------- */

.ceu-coin-store {
	max-width: 980px;
	margin: 0 auto;
}

.ceu-store-balance {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 24px;
	padding: 14px 18px;
	background: var(--ceu-panel);
	border: 1px solid var(--ceu-panel-border);
	border-radius: 10px;
	width: fit-content;
}

.ceu-store-balance-amount {
	font-size: 20px;
	font-weight: 700;
	color: var(--heading, #ffffff);
}

.ceu-store-balance-label {
	font-size: 13px;
	color: var(--body2, #a1a0a1);
}

.ceu-package-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 16px;
}

.ceu-package-card {
	position: relative;
	background: var(--ceu-panel);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 12px;
	padding: 24px 18px 20px;
	text-align: center;
	color: var(--body, #ffffffcc);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.ceu-package-card:hover {
	border-color: rgba(255, 255, 255, 0.16);
	transform: translateY(-2px);
}

.ceu-package-card--best {
	border-color: var(--ceu-accent);
	background: linear-gradient(180deg, rgba(255, 207, 97, 0.08) 0%, var(--ceu-panel) 60%);
}

.ceu-package-card--best:hover {
	border-color: var(--ceu-accent);
	box-shadow: 0 6px 24px rgba(113, 243, 54, 0.14);
}

.ceu-package-best-flag,
.ceu-package-badge {
	position: absolute;
	top: -1px;
	right: 14px;
	transform: translateY(-50%);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 5px;
}

.ceu-package-best-flag {
	background: var(--ceu-accent);
	color: #1a1305;
}

.ceu-package-badge {
	background: rgba(255, 255, 255, 0.12);
	color: var(--heading, #ffffff);
}

.ceu-package-coins {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	font-size: 24px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin-bottom: 8px;
	letter-spacing: -0.2px;
}

.ceu-package-breakdown {
	font-size: 12px;
	color: var(--body2, #a1a0a1);
	margin-bottom: 16px;
	line-height: 1.6;
}

.ceu-package-bonus-line {
	display: block;
	color: var(--ceu-accent);
	font-weight: 600;
}

.ceu-package-price {
	font-size: 19px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin-bottom: 16px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ceu-package-buy {
	display: block;
	width: 100%;
	padding: 11px 0;
	border-radius: 8px;
	background: transparent;
	border: 1.5px solid var(--ceu-accent);
	color: var(--ceu-accent) !important;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-decoration: none;
	text-align: center;
	transition: background 0.15s ease, color 0.15s ease;
}

/**
 * BUG FIX: :visited was previously grouped in the same rule as
 * :hover/:focus/:active, which meant a Buy Now button you'd already
 * clicked once (a "visited" link) permanently showed the filled-green
 * hover appearance instead of returning to its normal outlined idle
 * state -- confirmed as the actual cause of the first two package
 * buttons rendering wrong in testing (both had been clicked in earlier
 * testing sessions). :visited is kept separate here, pinning only
 * color (not background/fill), since browsers restrict which CSS
 * properties can be changed on :visited links for user-privacy
 * reasons regardless -- background/fill changes are not reliably
 * honored there anyway, so this rule doesn't attempt them.
 */
.ceu-package-buy:visited {
	color: var(--ceu-accent) !important;
}

.ceu-package-buy:hover,
.ceu-package-buy:focus,
.ceu-package-buy:active {
	background: var(--ceu-accent);
	color: #1a1305 !important;
}

.ceu-package-card--best .ceu-package-buy {
	background: var(--ceu-accent);
	color: #1a1305 !important;
}

.ceu-package-card--best .ceu-package-buy:visited {
	color: #1a1305 !important;
}

.ceu-package-card--best .ceu-package-buy:hover,
.ceu-package-card--best .ceu-package-buy:focus,
.ceu-package-card--best .ceu-package-buy:active {
	color: #1a1305 !important;
	box-shadow: 0 4px 16px rgba(113, 243, 54, 0.25);
}

/* --------------------------------------------------------------------
   Episode card lock badge (carousels/listings)
   -------------------------------------------------------------------- */

.ceu-card-lock-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(5, 5, 9, 0.78);
	border: 1px solid rgba(113, 243, 54, 0.35);
	color: var(--ceu-accent);
	pointer-events: none;
}

.ceu-card-lock-badge svg {
	width: 12px;
	height: 12px;
}

/* --------------------------------------------------------------------
   Small-screen adjustments
   -------------------------------------------------------------------- */

@media (max-width: 480px) {
	.ceu-locked-panel {
		margin: 20px;
		padding: 32px 22px;
	}

	.ceu-package-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* --------------------------------------------------------------------
   Account sidebar (wraps the My History page)
   -------------------------------------------------------------------- */

.ceu-account-layout {
	display: flex;
	align-items: flex-start;
	gap: 28px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 32px 24px;
}

.ceu-account-main {
	flex: 1;
	min-width: 0;
}

.ceu-account-sidebar {
	flex: 0 0 260px;
	position: sticky;
	top: 24px;
}

.ceu-account-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--ceu-panel);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 14px;
}

.ceu-account-avatar {
	border-radius: 50%;
	flex-shrink: 0;
}

.ceu-account-avatar--guest {
	display: inline-block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Ccircle cx='12' cy='8' r='4' fill='%23555'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6' fill='%23555'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 26px;
}

.ceu-account-login-btn {
	margin-left: auto;
	flex-shrink: 0;
	padding: 6px 14px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: var(--heading, #ffffff);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.ceu-account-login-btn:hover {
	border-color: var(--ceu-accent);
	color: var(--ceu-accent);
}

.ceu-account-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--heading, #ffffff);
	word-break: break-word;
}

.ceu-account-id {
	font-size: 12px;
	color: var(--body2, #a1a0a1);
	margin-top: 2px;
}

.ceu-account-balance-card {
	background: var(--ceu-panel);
	border: 1px solid var(--ceu-panel-border);
	border-radius: 12px;
	padding: 18px 16px;
	margin-bottom: 14px;
	text-align: center;
}

.ceu-account-balance-row {
	display: flex;
	align-items: stretch;
	margin-bottom: 14px;
}

.ceu-account-balance-col {
	flex: 1;
}

.ceu-account-balance-divider {
	width: 1px;
	background: rgba(255, 255, 255, 0.08);
	margin: 2px 14px;
}

.ceu-account-balance-label {
	font-size: 12px;
	color: var(--body2, #a1a0a1);
	margin-bottom: 8px;
}

.ceu-account-balance-amount {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 19px;
	font-weight: 700;
	color: var(--heading, #ffffff);
}

.ceu-account-topup-btn {
	display: block;
	width: 100%;
	padding: 10px 0;
	border-radius: 8px;
	background: var(--ceu-accent);
	color: #1a1305 !important;
	font-size: 13.5px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: box-shadow 0.15s ease;
}

.ceu-account-topup-btn:hover,
.ceu-account-topup-btn:focus,
.ceu-account-topup-btn:active,
.ceu-account-topup-btn:visited {
	color: #1a1305 !important;
	box-shadow: 0 4px 16px rgba(113, 243, 54, 0.28);
}

.ceu-account-nav {
	background: var(--ceu-panel);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	overflow: hidden;
}

.ceu-account-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--body, #ffffffcc);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	transition: background 0.12s ease, color 0.12s ease;
}

.ceu-account-nav a:last-child {
	border-bottom: none;
}

.ceu-account-nav a svg {
	flex-shrink: 0;
	opacity: 0.8;
}

.ceu-account-nav a:hover {
	background: rgba(255, 255, 255, 0.04);
	color: var(--heading, #ffffff);
}

.ceu-account-nav a.is-active {
	color: var(--ceu-accent);
	background: rgba(255, 207, 97, 0.06);
	border-left: 2px solid var(--ceu-accent);
	padding-left: 14px;
}

.ceu-account-nav a.is-active svg {
	opacity: 1;
}

.ceu-account-nav a.ceu-account-logout:hover {
	color: #ff6b6b;
}

@media (max-width: 860px) {
	.ceu-account-layout {
		flex-direction: column;
	}

	.ceu-account-sidebar {
		flex: 1 1 auto;
		width: 100%;
		position: static;
	}
}

/* --------------------------------------------------------------------
   My History / My List page content
   -------------------------------------------------------------------- */

.ceu-page-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin: 0 0 20px;
}

.ceu-empty-message {
	color: var(--body2, #a1a0a1);
	font-size: 14px;
}

.ceu-history-grid,
.ceu-my-list-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 18px;
}

.ceu-history-card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ceu-history-thumb {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 2 / 3;
	background: var(--ceu-panel);
	margin-bottom: 8px;
}

.ceu-history-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ceu-history-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: rgba(255, 255, 255, 0.2);
}

.ceu-history-progress span {
	display: block;
	height: 100%;
	background: var(--ceu-accent);
}

.ceu-history-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--heading, #ffffff);
	line-height: 1.3;
}

.ceu-history-meta {
	font-size: 12px;
	color: var(--body2, #a1a0a1);
	margin-top: 2px;
}

/* --------------------------------------------------------------------
   Wallet page tabs (class-ceu-wallet-page.php)
   -------------------------------------------------------------------- */

.ceu-wallet-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ceu-wallet-tab {
	background: none;
	border: none;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--body2, #a1a0a1);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.ceu-wallet-tab.is-active {
	color: var(--ceu-accent);
	border-bottom-color: var(--ceu-accent);
}

/* --------------------------------------------------------------------
   Shopping/Top-Up page (class-ceu-store-shortcode.php)
   -------------------------------------------------------------------- */

.ceu-store-breadcrumb {
	font-size: 13px;
	color: var(--body2, #a1a0a1);
	margin-bottom: 18px;
}

.ceu-store-breadcrumb a {
	color: var(--body2, #a1a0a1);
	text-decoration: none;
}

.ceu-store-breadcrumb a:hover {
	color: var(--heading, #ffffff);
}

.ceu-store-breadcrumb span:last-child {
	color: var(--heading, #ffffff);
	font-weight: 600;
}

.ceu-store-breadcrumb span[aria-hidden] {
	margin: 0 6px;
}

.ceu-store-header {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	background: var(--ceu-panel);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 18px 20px;
	margin-bottom: 32px;
}

.ceu-store-balance-line {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--body, #ffffffcc);
}

.ceu-store-balance-line strong {
	color: var(--heading, #ffffff);
	font-size: 15px;
}

.ceu-store-balance-sep {
	color: rgba(255, 255, 255, 0.15);
}

.ceu-store-history-link {
	margin-left: auto;
	font-size: 13px;
	color: var(--body2, #a1a0a1);
	text-decoration: none;
}

.ceu-store-history-link:hover {
	color: var(--ceu-accent);
}

.ceu-store-section-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin: 0 0 4px;
}

.ceu-store-section-subtitle {
	font-size: 13px;
	color: var(--body2, #a1a0a1);
	margin: 0 0 16px;
}

.ceu-vip-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin-bottom: 36px;
}

.ceu-vip-card {
	position: relative;
	border-radius: 12px;
	padding: 22px 22px 20px;
	background: linear-gradient(160deg, rgba(113, 243, 54, 0.16) 0%, var(--ceu-panel) 65%);
	border: 1px solid rgba(113, 243, 54, 0.25);
}

.ceu-vip-name {
	font-size: 16px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin-bottom: 6px;
}

.ceu-vip-price {
	font-size: 26px;
	font-weight: 700;
	color: var(--heading, #ffffff);
	margin-bottom: 4px;
}

.ceu-vip-cadence {
	font-size: 12.5px;
	color: var(--body2, #a1a0a1);
	margin-bottom: 16px;
}

.ceu-vip-features {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	font-size: 12.5px;
	color: var(--body, #ffffffcc);
	margin-bottom: 18px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ceu-vip-subscribe {
	display: block;
	width: 100%;
	padding: 12px 0;
	border-radius: 8px;
	background: var(--ceu-accent);
	color: #0a1a02 !important;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: box-shadow 0.15s ease;
}

.ceu-vip-subscribe:hover,
.ceu-vip-subscribe:focus,
.ceu-vip-subscribe:active,
.ceu-vip-subscribe:visited {
	color: #0a1a02 !important;
	box-shadow: 0 4px 16px rgba(113, 243, 54, 0.3);
}

/* --------------------------------------------------------------------
   Direct Bunny Stream player (class-ceu-bunny-player.php)
   -------------------------------------------------------------------- */

.ceu-bunny-iframe-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9, per Bunny's own documented responsive embed pattern */
}

.ceu-bunny-iframe-wrap iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

/**
 * Fixes a real sizing bug: without this, the <video> element had no
 * width/height CSS constraint at all, so it rendered at its native
 * source resolution (e.g. 1920x1080 or larger) and badly overflowed
 * the page layout. Uses the same proven 16:9 padding-top wrapper
 * pattern as the iframe player above, rather than relying solely on
 * Video.js's own vjs-fluid class/JS behavior, which depends on its
 * CSS bundle being fully loaded and initialized correctly.
 */
.ceu-bunny-video-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
	background: #000;
}

.ceu-bunny-video-wrap .video-js {
	position: absolute !important;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
}

/**
 * object-fit: contain -- shows the complete video frame, letterboxed
 * (black bars) if the source's aspect ratio doesn't exactly match our
 * fixed 16:9 wrapper, rather than stretching/cropping it to fill the
 * box. Without this, the video was being cut off / zoomed in, since
 * width/height:100% alone (previous version) has the browser scale the
 * <video> element to cover the container without preserving the
 * source's actual aspect ratio.
 */
.ceu-bunny-video-wrap .video-js video,
.ceu-bunny-video-wrap video {
	position: absolute !important;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: contain;
}
