/* ── Entrance animations ── */

@keyframes fadeSlideDown {
	from {
		opacity: 0;
		transform: translateY(-12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeSlideUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes sparkleFloat {
	0%,
	100% {
		opacity: 0;
		transform: scale(0.6) translateY(0);
	}

	20% {
		opacity: 0.7;
		transform: scale(1) translateY(-6px);
	}

	50% {
		opacity: 0.4;
		transform: scale(0.8) translateY(-12px);
	}

	80% {
		opacity: 0.6;
		transform: scale(1) translateY(-4px);
	}
}

/* ── Root ── */

.root {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
	min-height: 0;
}

/* ── Sparkle particles ── */

.sparkles {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 0;
}

.sparkle {
	position: absolute;
	border-radius: 50%;
	animation: sparkleFloat 3.5s ease-in-out infinite;
}

.sparkleGreen {
	background: color-mix(in srgb, variables.$color-success 60%, transparent);
}

.sparklePurple {
	background: color-mix(in srgb, variables.$purple-400 55%, transparent);
}

/* ── Content area (scrollable) ── */

.content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	flex: 1;
	padding: 32px 24px 24px;
	overflow-y: auto;
	min-height: 0;
}

/* ── Success header ── */

.header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	animation: fadeSlideDown 0.6s variables.$ease-out both;
}

.title {
	@include typography.font-header-l;

	color: variables.$text-primary;
	margin: 0;
}

.subtitle {
	@include typography.font-body-14(400);

	color: variables.$text-tertiary;
	margin: 0;
}

/* ── Video player ── */

.playerContainer {
	width: 100%;
	max-width: 780px;
	animation: fadeSlideUp 0.7s variables.$ease-out 0.15s both;
}

.playerWrapper {
	position: relative;
	border-radius: variables.$radius-md;
	overflow: hidden;
	background: #000;
	box-shadow: variables.$shadow-lg;
	aspect-ratio: 16 / 9;

	:global([data-media-player]) {
		width: 100% !important;
		height: 100% !important;
	}

	:global(.vds-video-layout) {
		width: 100%;
		height: 100%;
	}

	video {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
	}
}

.player {
	width: 100%;
	height: 100%;
}

.placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	color: variables.$text-tertiary;
	@include typography.font-body-14(400);
}

/* ── File info bar ── */

.fileInfoContainer {
	width: 100%;
	max-width: 780px;
	animation: fadeSlideUp 0.6s variables.$ease-out 0.35s both;
}

.fileInfoBar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: variables.$bg-default;
	border: 1px solid variables.$border-subtle;
	border-radius: variables.$radius-sm;
	box-shadow: variables.$shadow-sm;
}

.fileIcon {
	color: variables.$text-tertiary;
	flex-shrink: 0;
}

.fileName {
	@include typography.font-body-14(500);

	color: variables.$text-primary;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fileSize {
	@include typography.font-caption-m;

	color: variables.$text-tertiary;
	flex-shrink: 0;
}

/* ── Loading state ── */

.loading {
	padding: 48px;
	text-align: center;
	color: variables.$text-tertiary;
	@include typography.font-body-14(400);
}

/* ── Footer ── */

.footer {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 24px;
	border-top: 1px solid variables.$border-subtle;
	background: variables.$bg-surface;
	animation: fadeIn 0.5s variables.$ease-out 0.5s both;
}

.rightActions {
	display: flex;
	gap: 8px;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
	.header,
	.playerContainer,
	.fileInfoContainer,
	.footer {
		animation: none;
	}

	.sparkle {
		animation: none;
		display: none;
	}
}
