/* ===========================================
   How It Works - Animated Cards
   =========================================== */

.hiw-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-l);
}

/* Card illustration area */
.hiw-card__illustration {
	position: relative;
	border-radius: 12px;
	height: 288px;
	overflow: hidden;
}

.hiw-card__illustration > img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(4px);
	transform: scale(1.05);
}

.hiw-card__illustration-content {
	position: relative;
	z-index: 1;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-s);
}

/* Card text */
.hiw-card__title {
	font-size: var(--step-1);
	font-weight: 700;
	color: #111827;
	margin-top: var(--space-m);
	margin-bottom: 0;
}

.hiw-card__desc {
	font-size: var(--step-0);
	color: #4b5563;
	line-height: 1.6;
	margin-top: var(--space-2xs);
}

/* ===========================================
   Card 1: Upload Animation
   =========================================== */

.hiw-upload {
	width: 100%;
	max-width: 320px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	position: relative;
	min-height: 170px;
	transition: min-height 0.5s ease;
}

.hiw-upload.show-files {
	min-height: 270px;
}

/* Upload zone (frame 1) */
.hiw-upload__zone {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.7s ease-in-out;
	opacity: 1;
	transform: scale(1);
}

.hiw-upload.show-files .hiw-upload__zone {
	opacity: 0;
	transform: scale(0.95);
	pointer-events: none;
}

.hiw-upload__dropzone {
	border: 2px dashed #93c5fd;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: calc(100% - 24px);
	padding: 16px 0;
}

.hiw-upload__dropzone svg {
	width: 56px;
	height: 56px;
	color: #60a5fa;
	margin-bottom: 12px;
}

.hiw-upload__dropzone p {
	font-size: 14px;
	color: #6b7280;
	margin: 0;
	line-height: 1.5;
}

.hiw-upload__dropzone strong {
	color: #2563eb;
}

/* Uploaded files (frame 2) */
.hiw-upload__files {
	position: absolute;
	inset: 0;
	transition: all 0.7s ease-in-out;
	opacity: 0;
	transform: scale(0.95);
	pointer-events: none;
}

.hiw-upload.show-files .hiw-upload__files {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

.hiw-upload__files-header {
	padding: 12px;
	border-bottom: 1px solid #f3f4f6;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #374151;
}

.hiw-upload__files-header svg {
	width: 16px;
	height: 16px;
	color: #22c55e;
}

.hiw-upload__file {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid #fafafa;
	font-size: 14px;
	color: #374151;
	opacity: 0;
	transform: translateX(-16px);
	transition: all 0.5s ease;
}

.hiw-upload.show-files .hiw-upload__file {
	opacity: 1;
	transform: translateX(0);
}

.hiw-upload.show-files .hiw-upload__file:nth-child(1) { transition-delay: 0ms; }
.hiw-upload.show-files .hiw-upload__file:nth-child(2) { transition-delay: 100ms; }
.hiw-upload.show-files .hiw-upload__file:nth-child(3) { transition-delay: 200ms; }
.hiw-upload.show-files .hiw-upload__file:nth-child(4) { transition-delay: 300ms; }
.hiw-upload.show-files .hiw-upload__file:nth-child(5) { transition-delay: 400ms; }

.hiw-upload__file-icon {
	font-size: 18px;
	flex-shrink: 0;
}

.hiw-upload__file-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hiw-upload__file-check {
	width: 16px;
	height: 16px;
	color: #22c55e;
	flex-shrink: 0;
	margin-left: auto;
}

/* ===========================================
   Card 2: Assistants Scroll
   =========================================== */

.hiw-assistants {
	width: 100%;
	max-width: 320px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	height: 270px;
}

.hiw-assistants__header {
	padding: 12px;
	border-bottom: 1px solid #f3f4f6;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.hiw-assistants__header-title {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
}

.hiw-assistants__header-count {
	font-size: 12px;
	color: #9ca3af;
}

.hiw-assistants__list-wrap {
	height: 225px;
	overflow: hidden;
	position: relative;
}

.hiw-assistants__list-wrap::before,
.hiw-assistants__list-wrap::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 24px;
	z-index: 1;
	pointer-events: none;
}

.hiw-assistants__list-wrap::before {
	top: 0;
	background: linear-gradient(to bottom, #fff, transparent);
}

.hiw-assistants__list-wrap::after {
	bottom: 0;
	background: linear-gradient(to top, #fff, transparent);
}

.hiw-assistants__list {
	animation: hiwScrollUp 25s linear infinite;
}

.hiw-assistants__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-bottom: 1px solid #fafafa;
}

.hiw-assistants__icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}

.hiw-assistants__name {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
	color: #111827;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hiw-assistants__badge {
	font-size: 12px;
	color: #16a34a;
	background: #f0fdf4;
	padding: 2px 8px;
	border-radius: 9999px;
	flex-shrink: 0;
}

@keyframes hiwScrollUp {
	0% { transform: translateY(0); }
	100% { transform: translateY(-50%); }
}

/* ===========================================
   Card 3: Chat Animation
   =========================================== */

.hiw-chat {
	width: 100%;
	max-width: 320px;
	background: #fff;
	border-radius: 8px 8px 0 0;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border: 1px solid #f3f4f6;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 270px;
}

.hiw-chat__messages {
	flex: 1;
	padding: 12px 16px;
	overflow: hidden;
}

.hiw-chat__convo {
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: all 0.4s ease;
}

.hiw-chat__convo.is-exiting {
	opacity: 0;
	transform: translateX(-16px);
}

.hiw-chat__convo.is-entering {
	animation: hiwSlideIn 0.4s ease-out;
}

.hiw-chat__user-msg {
	display: flex;
	justify-content: flex-end;
}

.hiw-chat__user-bubble {
	background: #f3f4f6;
	border-radius: 8px 2px 8px 8px;
	padding: 8px 12px;
	font-size: 15px;
	color: #374151;
	max-width: 85%;
	line-height: 1.5;
}

.hiw-chat__assistant-msg {
	min-height: 60px;
}

.hiw-chat__assistant-text {
	font-size: 15px;
	color: #374151;
	line-height: 1.6;
}

.hiw-chat__assistant-text span {
	display: inline;
	transition: opacity 0.15s ease;
}

.hiw-chat__typing {
	display: flex;
	gap: 6px;
	padding: 8px 0;
}

.hiw-chat__typing-dot {
	width: 8px;
	height: 8px;
	background: var(--wp--preset--color--primary-600, #2563eb);
	border-radius: 50%;
	animation: hiwBounce 0.6s ease-in-out infinite alternate;
}

.hiw-chat__typing-dot:nth-child(2) { animation-delay: 150ms; }
.hiw-chat__typing-dot:nth-child(3) { animation-delay: 300ms; }

.hiw-chat__input {
	padding: 0 12px 20px;
}

.hiw-chat__input-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #f9fafb;
	border-radius: 8px;
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
}

.hiw-chat__input-placeholder {
	flex: 1;
	font-size: 12px;
	color: #9ca3af;
}

.hiw-chat__send-btn {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9ca3af;
}

.hiw-chat__send-btn svg {
	width: 14px;
	height: 14px;
}

@keyframes hiwBounce {
	0% { transform: translateY(0); }
	100% { transform: translateY(-6px); }
}

@keyframes hiwSlideIn {
	from { opacity: 0; transform: translateX(16px); }
	to { opacity: 1; transform: translateX(0); }
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
	.hiw-cards {
		grid-template-columns: 1fr;
		gap: var(--space-xl);
	}
}
