/**
 * Solution pages: "feature console" block (template-blocks/solution/feature-console.php).
 * Feature list on the left, a console panel that shows the selected feature in action on the right.
 * Scoped under .fc; tokens come from .sol-page (solution-v2.css). Sits on the dark features section.
 */

.sol-page .fc {
	--fc-cycle: 7s;
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: clamp(20px, 3vw, 40px);
	align-items: stretch;
	max-width: 1120px;
	margin: 0 auto;
}

.sol-page .fc-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sol-page .fc-list li {
	display: flex;
	flex: 1;
	margin: 0;
}

.sol-page .fc-list li::before {
	content: none;
}

.sol-page .fc-item {
	position: relative;
	display: flex;
	flex: 1;
	gap: 14px;
	align-items: flex-start;
	width: 100%;
	padding: 16px 18px;
	overflow: hidden;
	border: 1px solid var(--sv-on-dark-line);
	border-radius: var(--sv-radius-card);
	background: rgba(255, 255, 255, 0.04);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.sol-page .fc-item:hover {
	border-color: rgba(255, 255, 255, 0.28);
}

.sol-page .fc-item:focus-visible {
	outline: 2px solid var(--sv-yellow);
	outline-offset: 2px;
}

.sol-page .fc-item.is-active {
	border-color: rgba(248, 192, 45, 0.55);
	background: rgba(255, 255, 255, 0.09);
	transform: translateX(6px);
}

.sol-page .fc-item-n {
	flex: none;
	min-width: 2ch;
	color: var(--sv-on-dark-muted);
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	transition: color 0.25s ease;
}

.sol-page .fc-item.is-active .fc-item-n {
	color: var(--sv-yellow);
}

.sol-page .fc-item-body {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.sol-page .fc-item-title {
	color: var(--sv-on-dark);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.sol-page .fc-item-desc {
	color: var(--sv-on-dark-body);
	font-size: 14px;
	line-height: 1.55;
}

.sol-page .fc-item-bar {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--sv-violet-bright), var(--sv-yellow));
	transform: scaleX(0);
	transform-origin: left;
}

.sol-page .fc.is-playing .fc-item.is-active .fc-item-bar {
	animation: fc-fill var(--fc-cycle) linear forwards;
}

.sol-page .fc:not(.is-playing) .fc-item.is-active .fc-item-bar {
	transform: scaleX(1);
}

@keyframes fc-fill {
	to {
		transform: scaleX(1);
	}
}

/* Panel */
.sol-page .fc-panel {
	position: relative;
	display: none;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #3a2d63;
	border-radius: var(--sv-radius-panel);
	background: #120926;
	box-shadow: var(--sv-shadow-hover), 0 0 60px rgba(122, 79, 224, 0.18);
}

.sol-page .fc.is-live .fc-panel {
	display: flex;
}

.sol-page .fc-panel::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--sv-grid-dark);
	background-size: 32px 32px;
	opacity: 0.5;
	pointer-events: none;
}

.sol-page .fc-bar {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px 16px;
	border-bottom: 1px solid var(--sv-on-dark-line);
	background: rgba(255, 255, 255, 0.03);
	color: var(--sv-on-dark-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
}

.sol-page .fc-dots {
	display: inline-flex;
	gap: 6px;
}

.sol-page .fc-dots i {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
}

.sol-page .fc-file {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sol-page .fc-live {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	color: #3cd3b5;
	font-family: var(--sv-font);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sol-page .fc-live i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3cd3b5;
	animation: fc-pulse 2s ease-out infinite;
}

@keyframes fc-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(60, 211, 181, 0.6);
	}

	70%,
	100% {
		box-shadow: 0 0 0 8px rgba(60, 211, 181, 0);
	}
}

.sol-page .fc-body {
	position: relative;
	flex: 1;
	min-height: 380px;
	padding: 18px 20px 22px;
	overflow: hidden;
	color: #cfc6e6;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13.5px;
	line-height: 1.7;
}

.sol-page .fc-body pre {
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: none;
	color: inherit;
	font: inherit;
	white-space: pre;
}

.sol-page .fc-body pre.fc-res {
	white-space: pre-wrap;
	word-break: break-word;
}

.sol-page .fc-cmd {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px dashed var(--sv-on-dark-line);
	color: #e9e3f7;
	white-space: pre-wrap;
	word-break: break-all;
}

.sol-page .fc-body pre.fc-cmd {
	white-space: pre-wrap;
}

.sol-page .fc-prompt {
	color: var(--sv-violet-soft);
}

.sol-page .fc-caret {
	display: inline-block;
	width: 7px;
	height: 1.1em;
	margin-left: 1px;
	vertical-align: text-bottom;
	background: var(--sv-yellow);
	animation: fc-blink 0.9s steps(1) infinite;
}

@keyframes fc-blink {
	50% {
		opacity: 0;
	}
}

.sol-page .fc-line {
	display: block;
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sol-page .fc-line.is-in {
	opacity: 1;
	transform: none;
}

.sol-page .fc-k {
	color: #b48bea;
}

.sol-page .fc-s {
	color: #3cd3b5;
}

.sol-page .fc-n {
	color: #f8c02d;
}

.sol-page .fc-dim {
	color: rgba(255, 255, 255, 0.35);
}

.sol-page .fc-mark {
	display: block;
	margin: 0 -20px;
	padding: 0 17px;
	border-left: 3px solid var(--sv-yellow);
	background: linear-gradient(90deg, rgba(248, 192, 45, 0.18), rgba(248, 192, 45, 0.02));
	color: inherit;
}

/* Tabs inside the panel */
.sol-page .fc-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
}

.sol-page .fc-tab {
	padding: 5px 12px;
	border: 1px solid var(--sv-on-dark-line);
	border-radius: 999px;
	background: none;
	color: var(--sv-on-dark-muted);
	font: inherit;
	font-size: 12.5px;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.sol-page .fc-tab:hover {
	color: var(--sv-on-dark);
}

.sol-page .fc-tab.is-active {
	border-color: var(--sv-yellow);
	background: rgba(248, 192, 45, 0.14);
	color: var(--sv-yellow);
}

.sol-page .fc-tab:focus-visible {
	outline: 2px solid var(--sv-yellow);
	outline-offset: 2px;
}

/* Latency */
.sol-page .fc-stat {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 16px;
	align-items: end;
	margin-bottom: 16px;
	font-family: var(--sv-font);
}

.sol-page .fc-stat-n {
	grid-row: span 2;
	display: flex;
	align-items: baseline;
	gap: 4px;
	color: var(--sv-yellow);
}

.sol-page .fc-stat-n b {
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.sol-page .fc-stat-n small {
	font-size: 18px;
	font-weight: 600;
}

.sol-page .fc-stat-l {
	align-self: end;
	color: var(--sv-on-dark-body);
	font-size: 13px;
}

.sol-page .fc-meter {
	display: block;
	align-self: start;
	height: 5px;
	overflow: hidden;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.1);
}

.sol-page .fc-meter i {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: linear-gradient(90deg, #3cd3b5, var(--sv-yellow));
	transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sol-page .fc-body.is-hit .fc-meter i {
	width: 41%;
}

/* Delivery flow */
.sol-page .fc-flow {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0;
	align-items: center;
	height: 100%;
	min-height: 340px;
	font-family: var(--sv-font);
}

.sol-page .fc-flow-src {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 18px 20px;
	border: 1px solid rgba(248, 192, 45, 0.5);
	border-radius: var(--sv-radius-card);
	background: rgba(248, 192, 45, 0.1);
	color: var(--sv-on-dark);
}

.sol-page .fc-flow-src b {
	color: var(--sv-yellow);
	font-size: 18px;
}

.sol-page .fc-flow-src small {
	color: var(--sv-on-dark-body);
	font-size: 12px;
}

.sol-page .fc-flow-rows {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.sol-page .fc-flow-row {
	display: grid;
	grid-template-columns: minmax(36px, 1fr) minmax(0, 240px);
	align-items: center;
}

.sol-page .fc-flow-track {
	position: relative;
	display: block;
	height: 2px;
	background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 6px, transparent 6px 12px);
}

.sol-page .fc-flow-track i {
	position: absolute;
	top: -3px;
	left: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sv-yellow);
	box-shadow: 0 0 10px var(--sv-yellow);
	animation: fc-travel 2.4s linear infinite;
	animation-delay: calc(var(--i) * 0.35s);
}

@keyframes fc-travel {
	0% {
		left: 0;
		opacity: 0;
	}

	10%,
	85% {
		opacity: 1;
	}

	100% {
		left: calc(100% - 8px);
		opacity: 0;
	}
}

.sol-page .fc-flow-dest {
	position: relative;
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px 12px;
	border: 1px solid var(--sv-on-dark-line);
	border-radius: var(--sv-radius);
	background: rgba(255, 255, 255, 0.05);
}

.sol-page .fc-flow-dest b {
	display: grid;
	flex: none;
	width: 28px;
	height: 28px;
	place-items: center;
	border-radius: 6px;
	background: rgba(122, 79, 224, 0.4);
	color: var(--sv-on-dark);
	font-size: 13px;
}

.sol-page .fc-flow-dest strong {
	display: block;
	color: var(--sv-on-dark);
	font-size: 13.5px;
	line-height: 1.2;
}

.sol-page .fc-flow-dest small {
	display: block;
	color: var(--sv-on-dark-muted);
	font-size: 11.5px;
}

.sol-page .fc-flow-dest em {
	margin-left: auto;
	color: #3cd3b5;
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	animation: fc-done 2.4s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.35s);
}

@keyframes fc-done {
	0%,
	55% {
		opacity: 0.15;
	}

	75%,
	100% {
		opacity: 1;
	}
}

/* Schema table */
.sol-page .fc-sc {
	display: flex;
	flex-direction: column;
	gap: 0;
	font-family: var(--sv-font);
}

.sol-page .fc-sc-row {
	display: grid;
	grid-template-columns: 84px repeat(var(--cols), minmax(0, 1fr));
	gap: 12px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--sv-on-dark-line);
	font-size: 13.5px;
	animation: fc-rise 0.5s ease both;
	animation-delay: calc(var(--i, 0) * 70ms + 80ms);
}

.sol-page .fc-sc-row > span:not(:first-child) {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #e9e3f7;
}

.sol-page .fc-sc-row .fc-k {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
}

.sol-page .fc-sc-head {
	padding-top: 2px;
	color: var(--sv-yellow);
	font-weight: 700;
	animation: none;
}

.sol-page .fc-sc-head span {
	display: inline-flex;
	gap: 8px;
	align-items: center;
}

.sol-page .fc-sc-head img {
	width: 22px;
	height: 16px;
	border-radius: 3px;
}

@keyframes fc-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

/* Footnote */
.sol-page .fc-note {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--sv-on-dark-muted);
	font-size: 13px;
	text-align: center;
}

/* Tablet / phone: console first, then the list; only the active feature shows its description. */
@media (max-width: 900px) {
	.sol-page .fc {
		grid-template-columns: minmax(0, 1fr);
	}

	.sol-page .fc-panel {
		order: -1;
	}

	.sol-page .fc-item.is-active {
		transform: none;
	}

	.sol-page .fc.is-live .fc-item:not(.is-active) .fc-item-desc {
		display: none;
	}

	.sol-page .fc-list li {
		flex: none;
	}

	.sol-page .fc-body {
		min-height: 340px;
		font-size: 12.5px;
	}

	.sol-page .fc-stat-n b {
		font-size: 44px;
	}

	.sol-page .fc-flow-row {
		grid-template-columns: 20px minmax(0, 1fr);
	}

	.sol-page .fc-flow-dest em {
		display: none;
	}

	.sol-page .fc-sc-row {
		grid-template-columns: 60px repeat(var(--cols), minmax(0, 1fr));
		gap: 8px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sol-page .fc-item,
	.sol-page .fc-line {
		transition: none;
	}

	.sol-page .fc-live i,
	.sol-page .fc-caret,
	.sol-page .fc-flow-track i,
	.sol-page .fc-flow-dest em,
	.sol-page .fc-sc-row {
		animation: none;
	}
}
