/**
 * MindX Graph - Frontend Styles
 *
 * Horizontal flow graph with animated arrows.
 * Responsive: vertical stacking + arrow rotation on mobile.
 */

/* ===========================
   CSS Custom Properties
   =========================== */
:root {
	--mxg-card-bg: #1a1a1e;
	--mxg-card-radius: 22px;
	--mxg-icon-size: 68px;
	--mxg-icon-radius: 16px;
	--mxg-icon-gray: #3a3a40;
	--mxg-icon-purple: #7732FF;
	--mxg-text-white: #ffffff;
	--mxg-text-light: rgba(255, 255, 255, 0.78);
	--mxg-text-muted: rgba(255, 255, 255, 0.55);
	--mxg-arrow-color: #7732FF;
	--mxg-tag-border: rgba(255, 255, 255, 0.35);
	/* Connector text sits on the PAGE background (light), so it must be dark */
	--mxg-conn-text: #1a1a1e;
	--mxg-conn-text-light: #555555;
}

/* ===========================
   Graph Container (horizontal)
   =========================== */
.mxg-graph {
	max-width: 1400px;
	margin: 0 auto;
	padding: 40px 20px;
	display: flex;
	align-items: stretch;
	gap: 0;
}

/* ===========================
   Card
   =========================== */
.mxg-card {
	flex: 1 1 0;
	min-width: 0;
	background: var(--mxg-card-bg);
	border-radius: var(--mxg-card-radius);
	padding: 40px 32px 36px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Icon rounded square */
.mxg-card__icon-wrap {
	width: var(--mxg-icon-size);
	height: var(--mxg-icon-size);
	border-radius: var(--mxg-icon-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	margin-bottom: 22px;
	flex-shrink: 0;
}

.mxg-card__icon-wrap--gray {
	background: var(--mxg-icon-gray);
}

.mxg-card__icon-wrap--purple {
	background: var(--mxg-icon-purple);
}

.mxg-card__icon-wrap svg {
	width: 55%;
	height: 55%;
}

/* Title */
.mxg-card__title {
	font-size: 24px;
	font-weight: 800;
	color: var(--mxg-text-white);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 18px;
	line-height: 1.25;
}

.mxg-card__title-prefix {
	display: block;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 2px;
	color: var(--mxg-text-light);
	margin-bottom: 3px;
}

/* Description */
.mxg-card__desc {
	font-size: 13px;
	font-weight: 400;
	color: var(--mxg-text-light);
	line-height: 1.55;
	margin: 0;
	max-width: 300px;
}

/* Tags */
.mxg-card__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 20px;
}

.mxg-card__tag {
	display: inline-block;
	border: 1px solid var(--mxg-tag-border);
	border-radius: 20px;
	padding: 4px 13px;
	font-size: 11px;
	font-weight: 400;
	color: var(--mxg-text-light);
	white-space: nowrap;
}

/* ===========================
   Connector
   =========================== */
.mxg-connector {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	min-width: 150px;
	flex: 0 0 auto;
	text-align: center;
}

/* Connector label: prefix + name */
.mxg-connector__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 10px;
}

.mxg-connector__prefix {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 2px;
	color: var(--mxg-conn-text);
	text-transform: uppercase;
	line-height: 1.3;
}

.mxg-connector__name {
	font-size: 22px;
	font-weight: 800;
	color: var(--mxg-conn-text);
	text-transform: uppercase;
	letter-spacing: 1px;
	line-height: 1.2;
}

/* Connector description */
.mxg-connector__desc {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--mxg-conn-text-light);
	margin-top: 12px;
	line-height: 1.5;
}

/* ===========================
   Animated Arrow
   =========================== */
.mxg-connector__arrow {
	width: 100%;
	max-width: 120px;
}

.mxg-arrow {
	width: 100%;
	height: auto;
	color: var(--mxg-arrow-color);
	display: block;
}

/* Arrow head animations: "breathe" apart */
.mxg-arrow__head--left {
	animation: mxg-head-left 2.5s ease-in-out infinite;
	transform-origin: center;
}

.mxg-arrow__head--right {
	animation: mxg-head-right 2.5s ease-in-out infinite;
	transform-origin: center;
}

.mxg-arrow__shaft {
	animation: mxg-shaft-pulse 2.5s ease-in-out infinite;
}

@keyframes mxg-head-left {
	0%, 100% {
		transform: translateX(0);
		opacity: 0.65;
	}
	50% {
		transform: translateX(-3px);
		opacity: 1;
	}
}

@keyframes mxg-head-right {
	0%, 100% {
		transform: translateX(0);
		opacity: 0.65;
	}
	50% {
		transform: translateX(3px);
		opacity: 1;
	}
}

@keyframes mxg-shaft-pulse {
	0%, 100% {
		opacity: 0.45;
	}
	50% {
		opacity: 1;
	}
}

/* ===========================
   Responsive: Tablet
   =========================== */
@media (max-width: 1100px) {
	.mxg-card {
		padding: 30px 22px 26px;
	}

	.mxg-card__title {
		font-size: 20px;
	}

	.mxg-card__desc {
		font-size: 14px;
	}

	.mxg-connector {
		min-width: 110px;
		padding: 0 8px;
	}

	.mxg-connector__name {
		font-size: 18px;
	}

	.mxg-connector__desc {
		font-size: 11px;
	}
}

/* ===========================
   Responsive: Mobile → vertical
   =========================== */
@media (max-width: 768px) {
	.mxg-graph {
		flex-direction: column;
		align-items: center;
		gap: 0;
		padding: 24px 16px;
	}

	.mxg-card {
		width: 100%;
		max-width: 420px;
		padding: 28px 24px 24px;
	}

	.mxg-card__desc {
		max-width: none;
	}

	/* Connector: rotate arrow 90° to point vertically */
	.mxg-connector {
		min-width: auto;
		width: 100%;
		max-width: 420px;
		padding: 20px 0;
		flex-direction: column;
	}

	.mxg-connector__arrow {
		max-width: 80px;
	}

	/* Rotate the arrow SVG 90 degrees */
	.mxg-connector__arrow .mxg-arrow {
		transform: rotate(90deg);
	}

	/* On mobile, the arrowhead animations adapt automatically:
	   translateX becomes visual translateY due to the 90° rotation,
	   so the heads "breathe" up and down. */
}

@media (max-width: 480px) {
	.mxg-card {
		padding: 22px 18px 20px;
		border-radius: 16px;
	}

	:root {
		--mxg-icon-size: 52px;
		--mxg-icon-radius: 14px;
	}

	.mxg-card__title {
		font-size: 17px;
	}

	.mxg-card__tag {
		font-size: 12px;
		padding: 4px 12px;
	}
}
