/**
 * Multiplier YouTube Transcript widget styles.
 */

.mp-yt-transcript {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
}

.mp-yt-transcript__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 32px;
}

/* On mobile, Elementor's containers become a height-constrained flex column.
   The player's only in-flow child is absolutely positioned, so its automatic
   min-content height is 0 — and `aspect-ratio` does not contribute to min-content.
   Under that shrink pressure the whole widget chain collapses to 0 height and the
   video appears to vanish. A definite (viewport-based) min-height gives the player
   a real min-content height that propagates up the flex chain, keeping the 16:9
   video in place. The 40px accounts for the content container's horizontal padding. */
@media (max-width: 767px) {
	.mp-yt-transcript__player {
		min-height: calc((100vw - 13px) * 0.5625);
        border-radius: 0;
        position: sticky;
        top: 0;
	}
	.mp-yt-transcript__player-inner{
		border-radius: 0 !important;
	}
}

.mp-yt-transcript__player-inner {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: 32px;
}

.mp-yt-transcript__player-inner .custom-yt-player,
.mp-yt-transcript__player-inner iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- Poster image + custom play button (before first play) --- */
.mp-yt-transcript__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	cursor: pointer;
	display: block;
	line-height: 0;
	z-index: 2;

}

img.mp-yt-transcript__poster-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0px !important;
}

.mp-yt-transcript__poster-bulge {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	background: #000;
}

.mp-yt-transcript__poster-bulge .mp-bulge__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.mp-yt-transcript__poster-bulge.mp-bulge--fallback img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mp-yt-transcript__play {
	position: absolute;
	top: 16px;
	right:16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(64px, 12vw, 100px);
	height: clamp(64px, 12vw, 100px);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	-webkit-backdrop-filter: blur(19.73px);
	backdrop-filter: blur(19.73px);
	transition: transform 0.15s ease, background 0.15s ease;
}

.mp-yt-transcript__play svg {
	width: 28%;
	height: auto;
	margin-left: 6%;
}

.mp-yt-transcript__poster:hover .mp-yt-transcript__play,
.mp-yt-transcript__poster:focus-visible .mp-yt-transcript__play {
	background: rgba(255, 255, 255, 0.3);
}

/* Hide the poster once playback has started. */
.mp-yt-transcript__player.is-started .mp-yt-transcript__poster {
	display: none;
}

/* --- Floating mini-player (YouTube-style) --- */
.mp-yt-transcript__player.is-floating .mp-yt-transcript__player-inner {
	position: fixed;
	inset: auto 92px 16px auto;
	width: 360px;
	height: 202px;
	max-width: calc(100vw - 32px);
	z-index: 99998;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	animation: mp-yt-float-in 0.2s ease;
	border-radius: 24px;
}

/* Placeholder shown in the original spot while the video floats. */
.mp-yt-transcript__player.is-floating::after {
	content: attr(data-floating-label);
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 14px;
	background: #000;
	border-radius: 8px;
}

@keyframes mp-yt-float-in {
	from { transform: translateY(12px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

.mp-yt-float-close {
	display: none;
}

.mp-yt-transcript__player.is-floating .mp-yt-float-close {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 10px;
	right: 10px;
	width: 26px;
	height: 26px;
	z-index: 2;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.mp-yt-transcript__player.is-floating .mp-yt-float-close:hover {
	background: rgba(0, 0, 0, 0.9);
}

/* Floating is desktop-only. On tablet and mobile keep the video docked in
   place even if the is-floating class lingers across a fast resize. */
@media (max-width: 1024px) {
	.mp-yt-transcript__player.is-floating .mp-yt-transcript__player-inner {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		box-shadow: none;
		animation: none;
	}

	.mp-yt-transcript__player.is-floating::after {
		content: none;
	}

	.mp-yt-transcript__player.is-floating .mp-yt-float-close {
		display: none;
	}
}

/* --- Show / hide transcript toggle --- */
.mp-yt-transcript__panel {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
}

.mp-yt-transcript__toggle {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 12px !important;
	align-self: flex-start !important;
	min-width: 203px !important;
	padding: 10px 16px !important;
	border: 1.3px solid #cfcdcc !important;
	border-radius: 8px !important;
	background: transparent !important;
	-webkit-backdrop-filter: blur(13.15px) !important;
	backdrop-filter: blur(13.15px) !important;
	color: #0e0500 !important;
	font-size: 16px !important;
	line-height: 1.25 !important;
	cursor: pointer !important;
	outline: none !important;
}

.mp-yt-transcript__toggle:focus-visible {
	outline: 2px solid rgba(14, 5, 0, 0.4);
	outline-offset: 2px;
}

.mp-yt-transcript__toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.mp-yt-transcript__toggle[aria-expanded="true"] .mp-yt-transcript__toggle-icon {
	transform: rotate(180deg);
}

.yt-transcript-container[hidden] {
	display: none;
}

.yt-transcript-container {
	position: relative;
	/* height: 600px; */
	max-height: 300px;
	overflow-y: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	/* Sleek, thin scrollbar that stays invisible until the container is hovered
	   or focused. Firefox uses scrollbar-color; the thumb is transparent by
	   default and only gets a color on hover/focus. */
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

.yt-transcript-container::-webkit-scrollbar {
	width: 6px;
}

.yt-transcript-container::-webkit-scrollbar-track {
	background: transparent;
}

.yt-transcript-container::-webkit-scrollbar-thumb {
	background-color: transparent;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

/* Reveal the thumb on hover / keyboard focus. */
.yt-transcript-container:hover,
.yt-transcript-container:focus-within {
	scrollbar-color: rgba(14, 5, 0, 0.28) transparent;
}

.yt-transcript-container:hover::-webkit-scrollbar-thumb,
.yt-transcript-container:focus-within::-webkit-scrollbar-thumb {
	background-color: rgba(14, 5, 0, 0.28);
}

.yt-transcript-container::-webkit-scrollbar-thumb:hover {
	background-color: rgba(14, 5, 0, 0.45);
}

/* Top / bottom white fade. Sticky pseudo-elements stay pinned to the visible
   edges while scrolling; negative margins let them overlap the lines without
   consuming scroll height. They sit below the active line (see z-index rules
   below) so the currently-playing line is never washed out. */
.yt-transcript-container::before,
.yt-transcript-container::after {
	content: "";
	position: sticky;
	display: block;
	height: 48px;
	z-index: 2;
	pointer-events: none;
}

.yt-transcript-container::before {
	top: 0;
	margin-bottom: -48px;
	background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.yt-transcript-container::after {
	bottom: 0;
	margin-top: -48px;
	background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

/* "Remove height limit & fades" option: let the transcript grow to its full
   height and drop the top/bottom gradient fades. */
.yt-transcript-container--unbounded {
	max-height: none;
	height: auto;
	overflow-y: visible;
}

.yt-transcript-container--unbounded::before,
.yt-transcript-container--unbounded::after {
	content: none;
	display: none;
}

.yt-transcript-container:focus {
	outline: none;
}

.transcript-line {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 8px;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: color 0.15s ease;
}

.transcript-line:hover .text {
	text-decoration: underline;
	text-underline-position: from-font;
}

.transcript-line:focus-visible {
	outline: 2px solid rgba(14, 5, 0, 0.4);
	outline-offset: 2px;
}

.transcript-line .timestamp {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	font-size: 14px;
	font-weight: 400;
	color: #696563;
	line-height: 1.25;
	user-select: none;
}

.transcript-line .text {
	flex: 1 1 auto;
	font-size: 14px;
	color: #0E0500;
	line-height: 1.25;
}

/* Active (currently-playing) line — subtle, on-brand emphasis.
   Raised above the fade overlay so it stays fully legible at the edges. */
.transcript-line.is-active {
	z-index: 3;
}

.transcript-line.is-active .timestamp,
.transcript-line.is-active .text {
	color: #0E0500;
	font-weight: 600;
}

.mp-yt-transcript__notice {
	margin: 8px 0 0;
	padding: 12px;
	font-size: 0.9em;
	color: #6b6b6b;
	background: #f6f6f6;
	border-radius: 6px;
}

.mp-yt-transcript__notice--error {
	color: #8a1f11;
	background: #fdecea;
	border: 1px solid #f5c6cb;
}

.mp-yt-transcript__notice--error strong {
	display: block;
	margin-bottom: 2px;
}
