/* ==========================================================================
   TeachCPA Premium — cinematic video modal
   ========================================================================== */

.tcp-video-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: clamp(12px, 3vw, 40px);
}

.tcp-video-modal[hidden] {
	display: none;
}

.tcp-video-backdrop {
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 100% at 50% 0%, rgba(12, 20, 60, 0.82), rgba(2, 4, 14, 0.94));
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.tcp-video-dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(1120px, 100%);
	max-height: calc(100vh - 40px);
	background: linear-gradient(165deg, #0d1440 0%, #080d2c 46%, #04061a 100%);
	border: 1px solid rgba(143, 247, 255, 0.18);
	border-radius: 22px;
	box-shadow: 0 80px 160px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	overflow: hidden;
	animation: tcp-pop-in 0.4s var(--ease-spring) both;
}

.tcp-video-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 15px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.02);
}

.tcp-video-heading {
	min-width: 0;
}

.tcp-video-kicker {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 3px;
	color: rgba(143, 247, 255, 0.62);
	font-family: var(--font-display);
	font-size: 8.5px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.tcp-video-kicker .tcp-pulse {
	width: 6px;
	height: 6px;
}

.tcp-video-heading h2 {
	overflow: hidden;
	margin: 0;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tcp-video-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
}

.tcp-icon-btn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 9px;
	color: rgba(233, 243, 255, 0.75);
	transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.tcp-icon-btn:hover {
	background: rgba(255, 255, 255, 0.13);
	border-color: rgba(143, 247, 255, 0.3);
	color: #fff;
}

.tcp-icon-btn--close:hover {
	background: rgba(244, 63, 94, 0.2);
	border-color: rgba(244, 114, 182, 0.4);
}

.tcp-icon-btn svg {
	width: 15px;
	height: 15px;
}

.tcp-video-stage {
	position: relative;
	background: #02030c;
}

.tcp-video-content {
	position: relative;
	z-index: 1;
}

.tcp-video-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.tcp-video-iframe,
.tcp-video-file {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

.tcp-video-file {
	object-fit: contain;
}

.tcp-video-embed-help {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 8px;
	margin: 0;
	padding: 18px 16px 10px;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
	color: rgba(255, 255, 255, 0.5);
	font-size: 9.5px;
	line-height: 1.5;
	text-align: center;
	pointer-events: none;
}

.tcp-video-embed-help a {
	color: var(--cyan-soft);
	text-decoration: underline;
	pointer-events: auto;
}

.tcp-video-embed--fallback {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
	background:
		radial-gradient(100% 100% at 50% 0%, #14205c 0%, #080d2c 60%, #04061a 100%);
	color: #fff;
	text-align: center;
}

.tcp-video-fallback-icon {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: 16px;
	border-radius: 16px;
	background: rgba(47, 107, 255, 0.18);
	border: 1px solid rgba(143, 247, 255, 0.22);
	color: var(--cyan-soft);
}

.tcp-video-fallback-icon svg {
	width: 26px;
	height: 26px;
}

.tcp-video-embed--fallback h3 {
	margin-bottom: 8px;
	color: #fff;
	font-size: 20px;
}

.tcp-video-embed--fallback p {
	max-width: 500px;
	margin: 0 0 20px;
	color: rgba(219, 228, 255, 0.6);
	font-size: 12.5px;
	line-height: 1.7;
}

.tcp-video-embed--fallback .btn {
	font-size: 12px;
	padding: 11px 20px;
	min-height: 42px;
}

.tcp-video-loader {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: #02030c;
	color: rgba(219, 228, 255, 0.5);
	font-family: var(--font-display);
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tcp-video-loader[hidden] {
	display: none;
}

.tcp-video-loader span {
	width: 40px;
	height: 40px;
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-top-color: var(--cyan);
	border-radius: 50%;
	animation: tcp-spin 0.8s linear infinite;
}

.tcp-video-loader small {
	font-size: 9px;
	letter-spacing: 0.1em;
}

.tcp-video-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	background: rgba(255, 255, 255, 0.015);
}

.tcp-video-original {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: rgba(143, 247, 255, 0.66);
	font-size: 10.5px;
	font-weight: 500;
	transition: color 0.25s var(--ease);
}

.tcp-video-original:hover {
	color: #fff;
}

.tcp-video-original svg {
	width: 13px;
	height: 13px;
}

.tcp-video-note {
	color: rgba(219, 228, 255, 0.3);
	font-size: 9.5px;
	letter-spacing: 0.01em;
}

/* Minimized player */
.tcp-video-modal.is-minimized {
	display: block;
	padding: 0;
	pointer-events: none;
}

.tcp-video-modal.is-minimized .tcp-video-backdrop {
	display: none;
}

.tcp-video-modal.is-minimized .tcp-video-dialog {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: min(380px, calc(100vw - 32px));
	max-height: none;
	pointer-events: auto;
	border-radius: 14px;
	box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9);
	animation: tcp-fade-in 0.25s var(--ease) both;
}

.tcp-video-modal.is-minimized .tcp-video-head {
	padding: 9px 11px;
}

.tcp-video-modal.is-minimized .tcp-video-kicker {
	display: none;
}

.tcp-video-modal.is-minimized .tcp-video-heading h2 {
	font-size: 11.5px;
}

.tcp-video-modal.is-minimized .tcp-icon-btn {
	width: 28px;
	height: 28px;
	border-radius: 7px;
}

.tcp-video-modal.is-minimized .tcp-video-foot,
.tcp-video-modal.is-minimized .tcp-video-embed-help {
	display: none;
}

.tcp-video-modal.is-minimized .tcp-video-dialog [data-video-minimize] {
	transform: rotate(180deg);
}

/* Native fullscreen adjustments */
.tcp-video-dialog:fullscreen {
	width: 100vw;
	height: 100vh;
	max-height: none;
	border-radius: 0;
	border: 0;
	background: #000;
}

.tcp-video-dialog:fullscreen .tcp-video-head,
.tcp-video-dialog:fullscreen .tcp-video-foot {
	display: none;
}

.tcp-video-dialog:fullscreen .tcp-video-stage,
.tcp-video-dialog:fullscreen .tcp-video-content,
.tcp-video-dialog:fullscreen .tcp-video-embed {
	height: 100vh;
	aspect-ratio: auto;
}

/* The modal never causes horizontal scroll on very small screens. */
@media (max-width: 480px) {
	.tcp-video-modal {
		padding: 8px;
	}

	.tcp-video-dialog {
		border-radius: 16px;
		max-height: calc(100vh - 16px);
	}

	.tcp-video-head {
		padding: 11px 12px;
	}

	.tcp-video-heading h2 {
		font-size: 12px;
		max-width: 52vw;
	}

	.tcp-video-note {
		display: none;
	}

	.tcp-video-foot {
		padding: 9px 12px;
	}

	.tcp-video-modal.is-minimized .tcp-video-dialog {
		right: 10px;
		bottom: 10px;
		width: calc(100vw - 20px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tcp-video-dialog {
		animation: none;
	}
}
