
.root {
	@include mixins.flex-column;
	width: 100%;
	height: 100%;
	position: relative;
	border: 1px solid variables.$border-subtle;
	border-radius: variables.$radius-md	;
	box-shadow: var(--shadow-sm);
	transition:
		transform variables.$duration-normal variables.$ease-out,
		box-shadow variables.$duration-normal variables.$ease-out,
		border-color variables.$duration-normal variables.$ease-out;
	cursor: pointer;
	background: variables.$bg-default;
	overflow: hidden;
}

.hero {
	height: 180px;
	background-color: variables.$bg-surface;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-left: -24px;
	margin-top: -24px;
	width: calc(100% + 48px);
	overflow: hidden;

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		transition: transform variables.$duration-slow variables.$ease-out;
	}

	.placeholder {
		width: 100%;
		height: 100%;
		@include mixins.flex-center;
		background: linear-gradient(135deg, variables.$bg-surface 0%, variables.$bg-default 100%);
		transition: scale variables.$duration-normal variables.$ease-out;

		&[data-color-index="0"] {
			background: linear-gradient(135deg, variables.$purple-100 0%, variables.$purple-300 100%);
			svg { color: variables.$purple-600; opacity: 0.6; }
		}
		&[data-color-index="1"] {
			background: linear-gradient(135deg, variables.$green-100 0%, variables.$green-300 100%);
			svg { color: variables.$green-700; opacity: 0.6; }
		}
		&[data-color-index="2"] {
			background: radial-gradient(circle at top left, variables.$purple-200 0%, variables.$purple-50 100%);
			svg { color: variables.$purple-500; opacity: 0.5; }
		}
		&[data-color-index="3"] {
			background: radial-gradient(circle at bottom right, variables.$green-200 0%, variables.$green-50 100%);
			svg { color: variables.$green-600; opacity: 0.5; }
		}

		svg {
			width: 48px;
			height: 48px;
			color: variables.$text-tertiary;
			opacity: 0.35;
			transition: transform variables.$duration-normal variables.$ease-out;
		}
	}
}

.root:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
	border-color: variables.$purple-200;

	.placeholder {
		scale: 1.2;
	}
}

.root:active {
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.content {
	display: flex;
	flex-direction: column;
	padding: 14px 16px;
	gap: 6px;
	flex: 1;
}

.progressCircle {
	position: relative;
	width: 48px;
	height: 48px;
	border-radius: 50%;

	&::before {
		content: "";
		position: absolute;
		inset: -6px;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.25);
		z-index: 0;
	}

	svg {
		transform: rotate(-90deg);
		width: 100%;
		height: 100%;
		position: relative;
		z-index: 1;
	}

	circle {
		transition: stroke-dashoffset 0.35s;
		transform-origin: 50% 50%;
	}

	.progressBg {
		stroke: variables.$purple-100;
	}

	.progressValue {
		stroke: variables.$purple-400;

		&.completed {
			stroke: variables.$color-success;
		}
	}

	.percentage {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		@include typography.font-caption-m;
		font-weight: 700;
		color: variables.$color-white;
		text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
		z-index: 2;
	}
}

.progressOverlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.16) 100%);
	z-index: 1;
}

.actionName {
	@include typography.font-caption-m;
	font-size: 10px;
	color: variables.$color-white;
	text-align: center;
	white-space: nowrap;
	max-width: 80px;
	@include mixins.text-ellipsis;
}

.info {
	@include mixins.flex-column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.infoHeader {
	display: flex;
	align-items: center;
	gap: 8px;
}

.title {
	@include typography.font-body-16(600);
	color: variables.$text-primary;
	@include mixins.text-ellipsis;
	margin: 0;
}

.date {
	@include typography.font-caption-m;
	color: variables.$text-tertiary;
}

.status {
	margin-top: auto;

	display: flex;
	align-items: center;
	gap: 6px;
	@include typography.font-caption-m;
	font-weight: 600;

	&.statusGenerated {
		color: variables.$color-success;
	}

	&.statusProcessing, &.statusRendering, &.statusUploading {
		color: variables.$purple-400;
	}

	&.statusDraft {
		color: variables.$text-secondary;
	}

	&.statusFailed {
		color: variables.$color-danger;
	}
}

.statusDot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: currentColor;
}

.menuTrigger {
	margin-left: auto;
	background-color: transparent;
	border-radius: variables.$radius-sm;
	width: 28px;
	height: 28px;
	@include mixins.flex-center;
	color: variables.$text-secondary;
	cursor: pointer;
	transition: background-color variables.$duration-normal variables.$ease-out, color variables.$duration-normal variables.$ease-out;

	&:hover,
	&[data-state="open"] {
		background-color: variables.$bg-surface;
		color: variables.$text-primary;
	}

	button {
		@include mixins.flex-center;
		width: 100%;
		height: 100%;
		background: none;
		border: none;
		cursor: pointer;
		color: inherit;
		padding: 0;
	}
}

.statusBadge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 10px;
	border-radius: 20px;
	background: color-mix(in srgb, variables.$bg-default 88%, transparent);
	border: 1px solid color-mix(in srgb, variables.$border-default 72%, transparent);
	@include typography.font-caption-m;
	font-weight: 600;
	color: variables.$text-primary;
	box-shadow: var(--shadow-sm);
	z-index: 2;
}
