/* ===========================================
   Use Cases Section
   =========================================== */

.use-cases-grid {
	display: grid;
	grid-template-columns: 500px 1fr;
	gap: var(--space-m);
	align-items: stretch;
}

/* ===========================================
   Image Tiles - Desktop (2x2 grid)
   =========================================== */

.use-cases-tiles--desktop {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-s);
}

.use-cases-tile {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 3 / 4;
	border: none;
	background: none;
	padding: 0;
	font-family: inherit;
	text-align: left;
	transition: all 0.2s ease;
}

.use-cases-tile:hover {
	box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.4);
}

.use-cases-tile.is-active {
	box-shadow: inset 0 0 0 3px var(--wp--preset--color--primary-600, #2563eb);
}

.use-cases-tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.use-cases-tile::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.15) 100%);
	pointer-events: none;
}

/* Colored overlay - fades in on active via opacity */
.use-cases-tile::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.use-cases-tile.is-active::before {
	opacity: 1;
}

.use-cases-tile__text {
	position: absolute;
	bottom: var(--space-m);
	left: var(--space-m);
	right: var(--space-m);
	z-index: 2;
}

.use-cases-tile__title {
	font-size: var(--step-1);
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.use-cases-tile__desc {
	font-size: var(--step--1);
	color: rgba(255, 255, 255, 0.9);
	margin-top: var(--space-3xs);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Per-tile colored gradients (on ::before, transitioned via opacity) */
.use-cases-tile[data-id="onboarding"]::before {
	background: linear-gradient(to top, rgba(37, 99, 235, 0.85) 0%, rgba(37, 99, 235, 0.3) 50%, transparent 100%);
}

.use-cases-tile[data-id="sales"]::before {
	background: linear-gradient(to top, rgba(16, 185, 129, 0.85) 0%, rgba(16, 185, 129, 0.3) 50%, transparent 100%);
}

.use-cases-tile[data-id="knowledge"]::before {
	background: linear-gradient(to top, rgba(6, 182, 212, 0.85) 0%, rgba(6, 182, 212, 0.3) 50%, transparent 100%);
}

.use-cases-tile[data-id="support"]::before {
	background: linear-gradient(to top, rgba(139, 92, 246, 0.85) 0%, rgba(139, 92, 246, 0.3) 50%, transparent 100%);
}

/* ===========================================
   Image Tiles - Mobile (horizontal scroll)
   =========================================== */

.use-cases-tiles--mobile {
	display: none;
	gap: var(--space-s);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 6px var(--space-m) 6px var(--space-l);
	margin-bottom: var(--space-s);
}

.use-cases-tiles--mobile::after {
	content: '';
	flex-shrink: 0;
	width: var(--space-2xs);
}

.use-cases-tiles--mobile::-webkit-scrollbar {
	display: none;
}

.use-cases-tiles--mobile .use-cases-tile {
	flex-shrink: 0;
	width: calc((100% - var(--space-2xs) * 2) / 2.5);
	height: 112px;
	aspect-ratio: auto;
	scroll-snap-align: start;
}

.use-cases-tiles--mobile .use-cases-tile__text {
	bottom: var(--space-2xs);
	left: var(--space-2xs);
	right: var(--space-2xs);
}

.use-cases-tiles--mobile .use-cases-tile__title {
	font-size: var(--step--1);
	white-space: normal;
	line-height: 1.2;
}

.use-cases-tiles--mobile .use-cases-tile__desc {
	display: none;
}

/* ===========================================
   Static Chat Mockup
   =========================================== */

.use-cases-chat {
	background: #ffffff;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	display: flex;
	min-height: 680px;
}

/* Sidebar */
.use-cases-chat__sidebar {
	display: flex;
	flex-direction: column;
	width: 192px;
	border-right: 1px solid #e5e7eb;
	background: #f3f4f6;
	flex-shrink: 0;
}

.use-cases-chat__sidebar-header {
	padding: 12px;
	border-bottom: 1px solid #e5e7eb;
}

.use-cases-chat__new-chat {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #4b5563;
	background: none;
	border: none;
	cursor: default;
	padding: 4px 8px;
	width: 100%;
	font-family: 'Inter', system-ui, sans-serif;
}

.use-cases-chat__new-chat svg {
	width: 14px;
	height: 14px;
}

.use-cases-chat__section {
	padding: 12px;
}

.use-cases-chat__section-label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	margin-bottom: 8px;
}

.use-cases-chat__ast-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	color: #4b5563;
}

.use-cases-chat__ast-item.is-active {
	background: rgba(229, 231, 235, 0.8);
	color: #111827;
	font-weight: 500;
}

.use-cases-chat__ast-icon {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	flex-shrink: 0;
}

.use-cases-chat__hist-item {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
}

.use-cases-chat__hist-item.is-active {
	background: rgba(229, 231, 235, 0.8);
}

.use-cases-chat__hist-label {
	color: #4b5563;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.use-cases-chat__hist-item.is-active .use-cases-chat__hist-label {
	color: #111827;
	font-weight: 500;
}

.use-cases-chat__hist-time {
	font-size: 10px;
	color: #9ca3af;
}

.use-cases-chat__user {
	padding: 12px;
	border-top: 1px solid #e5e7eb;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
}

.use-cases-chat__avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #2563eb;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 500;
}

.use-cases-chat__user-name {
	font-size: 12px;
	color: #374151;
}

/* Chat Content */
.use-cases-chat__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: var(--space-s);
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.use-cases-chat__messages {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-s);
	overflow-y: auto;
	min-height: 0;
}

.use-cases-chat__messages.is-exiting {
	animation: ucFadeOut 0.3s ease-out forwards;
}

.use-cases-chat__msg {
	display: flex;
	opacity: 0;
	animation: ucFadeIn 0.4s ease-out forwards;
}

.use-cases-chat__msg--user {
	justify-content: flex-end;
}

.use-cases-chat__msg--assistant {
	justify-content: flex-start;
	animation-delay: 0.15s;
}

.use-cases-chat__bubble--user {
	max-width: 80%;
	background: #f3f4f6;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
	color: #111827;
	line-height: 1.5;
}

.use-cases-chat__bubble--assistant {
	max-width: 90%;
	font-size: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
	color: #374151;
	line-height: 1.6;
	white-space: pre-line;
}

/* Input Bar */
.use-cases-chat__input {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.use-cases-chat__input button {
	background: none;
	border: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: default;
}

.use-cases-chat__input svg {
	width: 20px;
	height: 20px;
}

.use-cases-chat__input-placeholder {
	flex: 1;
	font-size: 14px;
	color: #9ca3af;
	font-family: 'Inter', system-ui, sans-serif;
}

.use-cases-chat__input-send {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f3f4f6 !important;
	color: #fb923c;
}

.use-cases-chat__input-attach {
	color: #9ca3af;
}

.use-cases-chat__input-mic {
	color: #9ca3af;
}

/* Animations */
@keyframes ucFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes ucFadeOut {
	to { opacity: 0; transform: translateY(-8px); }
}

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

@media (max-width: 1024px) {
	.use-cases-grid {
		grid-template-columns: 1fr;
	}

	.use-cases-tiles--desktop {
		display: none;
	}

	.use-cases-tiles--mobile {
		display: flex;
	}

	.use-cases-chat__sidebar {
		display: none;
	}
}
