/* ──────────────────────────────────────────────────────────────────────────
 * League Page — AI Football Analyst Homepage ([lp_homepage])
 * Dedicated dark premium styling preserving the platform's color identity
 * and smoothly transforming the embedded AI Analyst Chat from Hero Input
 * into the full conversational workspace without page reload.
 * ────────────────────────────────────────────────────────────────────────── */

.lp-home {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	padding: 18px 30px 44px;
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #e6ebf2;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

.lp-home *,
.lp-home *::before,
.lp-home *::after {
	box-sizing: border-box;
}

/* Subtle ambient glow behind the hero (understated, dark-first) */
.lp-home-ambient {
	position: absolute;
	top: 48px;
	left: 50%;
	transform: translateX(-50%);
	width: min(760px, 92%);
	height: 320px;
	background: radial-gradient(
		ellipse at center,
		rgba(37, 99, 235, 0.16) 0%,
		rgba(34, 211, 238, 0.08) 42%,
		rgba(11, 13, 18, 0) 74%
	);
	pointer-events: none;
	z-index: 0;
	transition: opacity 0.45s ease;
}

.lp-home.is-chat-active .lp-home-ambient {
	opacity: 0.35;
}

/* ── Top Mode Switcher (identical aesthetics to lp-mode-switcher) ────────── */
.lp-home .lp-mode-switcher-wrap {
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
}

.lp-home .lp-mode-switcher {
	position: relative;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: center;
	width: 396px;
	max-width: 100%;
	padding: 4px;
	background: rgba(17, 21, 30, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
	user-select: none;
}

.lp-home .lp-mode-switcher__indicator {
	position: absolute;
	top: 4px;
	left: 4px;
	width: calc((100% - 8px) / 3);
	height: calc(100% - 8px);
	border-radius: 999px;
	background: linear-gradient(135deg, rgba(34, 211, 238, 0.28) 0%, rgba(37, 99, 235, 0.88) 100%);
	border: 1px solid rgba(34, 211, 238, 0.5);
	box-shadow: 0 0 16px rgba(37, 99, 235, 0.42);
	transform: translateX(0);
	transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
	z-index: 1;
}

.lp-home .lp-mode-switcher.is-chat .lp-mode-switcher__indicator {
	transform: translateX(0);
}

.lp-home .lp-mode-switcher.is-predictions .lp-mode-switcher__indicator {
	transform: translateX(100%);
}

.lp-home .lp-mode-switcher.is-history .lp-mode-switcher__indicator {
	transform: translateX(200%);
}

.lp-home .lp-mode-switcher__option {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.68);
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease;
}

.lp-home .lp-mode-switcher__option:hover,
.lp-home .lp-mode-switcher__option:focus {
	color: #ffffff;
	text-decoration: none;
}

.lp-home .lp-mode-switcher__option.is-active {
	color: #ffffff;
	cursor: default;
}

/* ── Main Stage ──────────────────────────────────────────────────────────── */
.lp-home-stage {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 390px;
	transition: min-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-home.is-chat-active .lp-home-stage {
	justify-content: flex-start;
	min-height: 0;
}

/* ── Hero Section (Server-Rendered SEO H1 + Description) ─────────────────── */
.lp-home-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	max-width: 780px;
	margin: 14px auto 22px;
	padding: 0 8px;
	max-height: 420px;
	opacity: 1;
	transform: translateY(0);
	transition:
		opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
		max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
		margin 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-home.is-chat-active .lp-home-hero {
	opacity: 0;
	transform: translateY(-22px);
	max-height: 0;
	margin: 0 auto;
	overflow: hidden;
	pointer-events: none;
}

.lp-home.is-instant .lp-home-hero,
.lp-home.is-instant .lp-home-chat-stage .afa-widget,
.lp-home.is-instant .lp-home-chat-stage .afa-widget__header,
.lp-home.is-instant .lp-home-chat-stage .afa-widget__body {
	transition: none !important;
}

.lp-home-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	margin: 0 0 14px;
	border-radius: 999px;
	background: rgba(17, 21, 30, 0.78);
	border: 1px solid rgba(34, 211, 238, 0.28);
	color: #93c5fd;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.lp-home-eyebrow__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 10px rgba(34, 197, 94, 0.75);
}

.lp-home-title {
	margin: 0 0 12px;
	padding: 0;
	font-size: clamp(2rem, 4.3vw, 3.1rem);
	font-weight: 800;
	line-height: 1.14;
	letter-spacing: -0.025em;
	color: #f8fafc;
	text-wrap: balance;
}

.lp-home-desc {
	margin: 0 auto;
	max-width: 640px;
	font-size: clamp(0.95rem, 1.3vw, 1.04rem);
	font-weight: 400;
	line-height: 1.56;
	color: #cbd5e1;
	text-align: center;
	text-wrap: balance;
}

/* ── Embedded Real AI Analyst Chat Stage ─────────────────────────────────── */
.lp-home-chat-stage {
	width: 100%;
	display: flex;
	justify-content: center;
}

.lp-home-chat-stage .afa-chat-shell {
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
}

/* Hide the inner switcher from AFA_Widget since [lp_homepage] renders the unified top switcher */
.lp-home-chat-stage .afa-mode-switcher-wrap {
	display: none !important;
}

.lp-home-chat-stage .afa-widget {
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
	transition:
		max-width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
		border-radius 0.35s ease,
		border-color 0.25s ease,
		box-shadow 0.3s ease,
		background 0.3s ease;
}

.lp-home-chat-stage .afa-widget__header {
	max-height: 84px;
	opacity: 1;
	overflow: hidden;
	transition:
		max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.3s ease,
		padding 0.35s ease,
		border-color 0.3s ease;
}

.lp-home-chat-stage .afa-widget__body {
	max-height: 760px;
	opacity: 1;
	transition:
		max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.35s ease;
}

/* ── HERO INPUT MODE: Real .afa-widget styled as sleek glowing central input ─ */
.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget {
	max-width: 720px;
	border-radius: 20px;
	background: linear-gradient(
		145deg,
		rgba(20, 25, 35, 0.88) 0%,
		rgba(11, 13, 18, 0.94) 100%
	);
	border: 1px solid rgba(59, 130, 246, 0.34);
	box-shadow:
		0 0 0 1px rgba(34, 211, 238, 0.14),
		0 16px 44px rgba(0, 0, 0, 0.52),
		0 0 36px rgba(37, 99, 235, 0.16);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget:hover {
	border-color: rgba(34, 211, 238, 0.48);
	box-shadow:
		0 0 0 1px rgba(34, 211, 238, 0.22),
		0 20px 50px rgba(0, 0, 0, 0.56),
		0 0 44px rgba(37, 99, 235, 0.22);
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget:focus-within {
	border-color: rgba(59, 130, 246, 0.72);
	box-shadow:
		0 0 0 3px rgba(59, 130, 246, 0.2),
		0 20px 54px rgba(0, 0, 0, 0.6),
		0 0 48px rgba(34, 211, 238, 0.2);
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__header,
.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__context,
.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__body {
	max-height: 0;
	min-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	border-width: 0;
	overflow: hidden;
	pointer-events: none;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__form {
	padding: 12px 14px;
	background: transparent;
	border-top: none;
	gap: 0;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__composer {
	padding: 6px 6px 6px 16px;
	background: rgba(7, 9, 13, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__composer:focus-within {
	border-color: rgba(59, 130, 246, 0.45);
	box-shadow: none;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__input {
	min-height: 46px;
	padding: 11px 0;
	font-size: 1rem;
	color: #f8fafc;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__input::placeholder {
	color: #94a3b8;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__submit {
	width: 44px;
	height: 44px;
	border-radius: 12px;
}

.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__hint {
	display: none;
}

/* Fallback box if AI Football Analyst plugin is deactivated */
.lp-home-fallback {
	width: 100%;
	max-width: 680px;
	padding: 20px 24px;
	border-radius: 16px;
	background: #11151e;
	border: 1px solid #1f2430;
	color: #cbd5e1;
	text-align: center;
	font-size: 0.95rem;
	line-height: 1.6;
}

.lp-home-fallback a {
	color: #93c5fd;
	font-weight: 600;
	text-decoration: underline;
}

/* ── Responsive Breakpoints ──────────────────────────────────────────────── */
@media (max-width: 768px) {
	.lp-home {
		padding: 14px 30px 32px;
	}

	.lp-home-stage {
		min-height: 400px;
	}

	.lp-home-hero {
		margin: 18px auto 26px;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget {
		max-width: 100%;
		border-radius: 18px;
	}
}

@media (max-width: 520px) {
	.lp-home {
		padding: 10px 30px 24px;
	}

	.lp-home .lp-mode-switcher-wrap {
		margin: 0 0 12px;
	}

	.lp-home .lp-mode-switcher {
		width: 344px;
	}

	.lp-home .lp-mode-switcher__option {
		padding: 7px 8px;
		gap: 5px;
		font-size: 12px;
	}

	.lp-home-stage {
		min-height: 360px;
	}

	.lp-home-hero {
		margin: 14px auto 22px;
		padding: 0 4px;
	}

	.lp-home-eyebrow {
		margin-bottom: 14px;
		padding: 5px 12px;
		font-size: 0.7rem;
	}

	.lp-home-title {
		margin-bottom: 12px;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget {
		border-radius: 16px;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__form {
		padding: 9px 10px;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__composer {
		padding: 5px 5px 5px 12px;
		border-radius: 12px;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__input {
		font-size: 16px;
		min-height: 42px;
		padding: 9px 0;
	}

	.lp-home.is-hero-mode .lp-home-chat-stage .afa-widget__submit {
		width: 40px;
		height: 40px;
		border-radius: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lp-home-hero,
	.lp-home-stage,
	.lp-home-ambient,
	.lp-home .lp-mode-switcher__indicator,
	.lp-home-chat-stage .afa-widget,
	.lp-home-chat-stage .afa-widget__header,
	.lp-home-chat-stage .afa-widget__body {
		transition: none !important;
	}
}
