/* ===========================================
   Capabilities Showcase Section
   =========================================== */

.cap-grid {
	display: grid;
	grid-template-columns: 1fr 1.6fr;
	gap: var(--space-m);
	align-items: stretch;
}

/* ===========================================
   Desktop Cards (2x3 grid)
   =========================================== */

.cap-cards--desktop {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-2xs);
	align-content: start;
}

.cap-card {
	background: #1e293b;
	border-radius: 8px;
	padding: 16px;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: all 0.2s ease;
}

.cap-card:hover {
	background: #334155;
}

.cap-card.is-active {
	background: var(--wp--preset--color--primary-600, #2563eb);
	box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3), 0 0 0 2px #93c5fd;
}

.cap-card__icon {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	background: #334155;
	color: #60a5fa;
}

.cap-card.is-active .cap-card__icon {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.cap-card__icon svg {
	width: 20px;
	height: 20px;
}

.cap-card__title {
	font-size: var(--step-1);
	font-weight: 700;
	color: #fff;
	margin-bottom: var(--space-3xs);
}

.cap-card__desc {
	font-size: var(--step-0);
	color: #94a3b8;
}

.cap-card.is-active .cap-card__desc {
	color: rgba(255, 255, 255, 0.8);
}

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

.cap-tiles--mobile {
	display: none;
	gap: var(--space-2xs);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 0;
}

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

.cap-tiles--mobile .cap-tile {
	flex-shrink: 0;
	width: 120px;
	height: 104px;
	background: #1e293b;
	border-radius: 8px;
	padding: 14px;
	border: 2px solid transparent;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	scroll-snap-align: start;
}

.cap-tiles--mobile .cap-tile.is-active {
	background: var(--wp--preset--color--primary-600, #2563eb);
	border-color: #60a5fa;
}

.cap-tiles--mobile .cap-tile__icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
	background: #334155;
	color: #60a5fa;
}

.cap-tiles--mobile .cap-tile.is-active .cap-tile__icon {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.cap-tiles--mobile .cap-tile__icon svg {
	width: 20px;
	height: 20px;
}

.cap-tiles--mobile .cap-tile__title {
	font-size: var(--step-0);
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

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

.cap-chat {
	background: #fff;
	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 */
.cap-chat__sidebar {
	display: flex;
	flex-direction: column;
	width: 192px;
	border-right: 1px solid #e5e7eb;
	background: #f3f4f6;
	flex-shrink: 0;
}

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

.cap-chat__new-chat {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #4b5563;
	background: none;
	border: none;
	cursor: default;
	padding: 6px 8px;
	width: 100%;
	font-family: inherit;
}

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

.cap-chat__section {
	padding: 12px;
}

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

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

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

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

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

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

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

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

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

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

.cap-chat__avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #3b82f6;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 500;
}

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

/* Chat Content */
.cap-chat__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 16px;
	min-width: 0;
	overflow: hidden;
}

.cap-chat__messages {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-s);
}

.cap-chat__messages.is-entering {
	animation: capFadeIn 0.4s ease-out;
}

.cap-chat__msg {
	display: flex;
}

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

.cap-chat__msg--assistant {
	justify-content: flex-start;
}

.cap-chat__bubble--user {
	max-width: 80%;
	background: #f3f4f6;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: var(--step-0);
	color: #111827;
	line-height: 1.5;
}

.cap-chat__bubble--assistant {
	max-width: 90%;
	font-size: var(--step-0);
	color: #374151;
	line-height: 1.6;
	white-space: pre-line;
}

/* Chart visual */
.cap-chat__chart {
	margin-top: 16px;
	background: #f9fafb;
	border-radius: 8px;
	padding: 16px;
}

.cap-chat__chart-bars {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 8px;
	height: 96px;
}

.cap-chat__chart-bar {
	width: 32px;
	border-radius: 4px 4px 0 0;
	background: #3b82f6;
}

.cap-chat__chart-bar--low {
	background: #93c5fd;
}

.cap-chat__chart-labels {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 8px;
	font-size: 10px;
	color: #6b7280;
}

.cap-chat__chart-labels span {
	width: 32px;
	text-align: center;
}

/* Download button */
.cap-chat__download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	background: #eff6ff;
	color: #1d4ed8;
	padding: 6px 12px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	border: none;
	cursor: default;
	font-family: inherit;
}

.cap-chat__download svg {
	width: 14px;
	height: 14px;
}

/* Input Bar */
.cap-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);
}

.cap-chat__input button {
	background: none;
	border: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: default;
	color: #9ca3af;
}

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

.cap-chat__input-placeholder {
	flex: 1;
	font-size: 14px;
	color: #9ca3af;
	font-family: inherit;
}

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

/* Animation */
@keyframes capFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

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

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

	.cap-cards--desktop {
		display: none;
	}

	.cap-tiles--mobile {
		display: flex;
	}

	.cap-chat__sidebar {
		display: none;
	}

	.cap-chat {
		min-height: 400px;
	}
}
