/* ──────────────────────────────────────────────────────────────────────────
 * League Page — Football Predictions History Directory ([lp_history_leagues])
 * Dark premium league showcase with 30px horizontal spacing, Over/Under 2.5
 * links, AI League Analysis button, and modal report panel.
 * ────────────────────────────────────────────────────────────────────────── */

.lp-wrap.lp-history-dir {
	width: 100%;
	max-width: 1220px;
	margin: 0 auto;
	padding: 18px 30px 48px;
	box-sizing: border-box;
}

.lp-history-dir .lp-hl-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin: 18px 0 24px;
	padding: 26px 28px;
	background: linear-gradient(145deg, rgba(22, 36, 71, 0.72) 0%, rgba(11, 23, 57, 0.9) 100%);
	border: 1px solid rgba(255, 255, 255, 0.11);
	border-radius: 16px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.lp-history-dir .lp-hl-hero__text {
	flex: 1 1 420px;
	min-width: 0;
}

.lp-history-dir .lp-hl-title {
	margin: 0 0 10px;
	padding: 0;
	font-size: clamp(1.75rem, 3vw, 2.35rem);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -0.02em;
	color: #f8fafc;
}

.lp-history-dir .lp-hl-desc {
	margin: 0;
	max-width: 660px;
	font-size: 0.97rem;
	line-height: 1.6;
	color: #cbd5e1;
}

.lp-history-dir .lp-hl-summary {
	display: inline-flex;
	align-items: center;
	gap: 20px;
	padding: 14px 22px;
	background: rgba(7, 9, 13, 0.56);
	border: 1px solid rgba(34, 211, 238, 0.24);
	border-radius: 12px;
	flex-shrink: 0;
}

.lp-history-dir .lp-hl-summary__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 3px;
}

.lp-history-dir .lp-hl-summary__val {
	font-size: 1.45rem;
	font-weight: 800;
	line-height: 1.1;
	color: #f8fafc;
	font-variant-numeric: tabular-nums;
}

.lp-history-dir .lp-hl-summary__val--accent {
	color: #22D3EE;
	text-shadow: 0 0 14px rgba(34, 211, 238, 0.32);
}

.lp-history-dir .lp-hl-summary__lbl {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.62);
}

.lp-history-dir .lp-hl-summary__divider {
	width: 1px;
	height: 32px;
	background: rgba(255, 255, 255, 0.12);
}

/* Search / Filter Toolbar */
.lp-history-dir .lp-hl-toolbar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 22px;
}

.lp-history-dir .lp-hl-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 360px;
}

.lp-history-dir .lp-hl-search-icon {
	position: absolute;
	left: 14px;
	color: #94a3b8;
	pointer-events: none;
}

.lp-history-dir .lp-hl-search-input {
	width: 100%;
	padding: 10px 14px 10px 40px;
	background: rgba(11, 13, 18, 0.85);
	color: #f1f5f9;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.lp-history-dir .lp-hl-search-input::placeholder {
	color: #64748b;
}

.lp-history-dir .lp-hl-search-input:focus {
	border-color: #22D3EE;
	box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

/* Uniform Responsive League Grid */
.lp-history-dir .lp-hl-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	align-items: stretch;
}

.lp-history-dir .lp-hl-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: space-between;
	padding: 22px 16px 16px;
	background: linear-gradient(160deg, rgba(22, 36, 71, 0.66) 0%, rgba(11, 17, 34, 0.92) 100%);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	color: #e6ebf2;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
	transition:
		transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.22s ease,
		box-shadow 0.24s ease,
		background 0.24s ease;
	overflow: hidden;
}

.lp-history-dir .lp-hl-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.12) 0%, transparent 65%);
	opacity: 0;
	transition: opacity 0.24s ease;
	pointer-events: none;
}

.lp-history-dir .lp-hl-card:hover {
	transform: translateY(-4px);
	border-color: rgba(34, 211, 238, 0.52);
	box-shadow:
		0 14px 32px rgba(0, 0, 0, 0.48),
		0 0 24px rgba(34, 211, 238, 0.16);
	background: linear-gradient(160deg, rgba(31, 64, 104, 0.72) 0%, rgba(11, 23, 57, 0.94) 100%);
}

.lp-history-dir .lp-hl-card:hover::before {
	opacity: 1;
}

.lp-history-dir .lp-hl-card[hidden] {
	display: none;
}

.lp-history-dir .lp-hl-card__link {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
}

.lp-history-dir .lp-hl-card__link:hover,
.lp-history-dir .lp-hl-card__link:focus-visible {
	color: #ffffff;
	text-decoration: none;
	outline: none;
}

.lp-history-dir .lp-hl-card__link--static {
	cursor: default;
}

/* Official League Logo Stage */
.lp-history-dir .lp-hl-card__logo-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 92px;
	height: 92px;
	margin: 0 auto 14px;
	padding: 12px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.09);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
	transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.lp-history-dir .lp-hl-card:hover .lp-hl-card__logo-stage {
	transform: scale(1.04);
	border-color: rgba(34, 211, 238, 0.35);
	background: rgba(255, 255, 255, 0.07);
}

.lp-history-dir .lp-hl-card__logo {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 68px;
	max-height: 68px;
	object-fit: contain;
	object-position: center;
}

.lp-history-dir .lp-hl-card__initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 14px;
	background: rgba(37, 99, 235, 0.22);
	border: 1px solid rgba(59, 130, 246, 0.45);
	color: #93c5fd;
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: 0.04em;
}

/* Country Flag + Name subtly below logo */
.lp-history-dir .lp-hl-card__country {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0 0 6px;
	font-size: 0.78rem;
	font-weight: 600;
	color: #94a3b8;
	letter-spacing: 0.02em;
}

.lp-history-dir .lp-hl-card__flag {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(255, 255, 255, 0.28);
	flex-shrink: 0;
}

.lp-history-dir .lp-hl-card__country-name {
	line-height: 1.2;
}

/* League Title */
.lp-history-dir .lp-hl-card__league {
	margin: 0 0 14px;
	padding: 0;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.3;
	color: #f8fafc;
	min-height: 2.6em;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Prominent Historical Predictions Count */
.lp-history-dir .lp-hl-card__stat {
	margin-top: auto;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 12px;
	border-radius: 10px;
	background: rgba(7, 9, 13, 0.62);
	border: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.8rem;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.lp-history-dir .lp-hl-card:hover .lp-hl-card__stat {
	border-color: rgba(34, 211, 238, 0.34);
	background: rgba(7, 9, 13, 0.78);
}

.lp-history-dir .lp-hl-card__stat-label {
	color: #94a3b8;
	font-weight: 500;
	white-space: nowrap;
}

.lp-history-dir .lp-hl-card__stat-value {
	color: #4ade80;
	font-size: 0.92rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* AI League Analysis Button Row inside each League Card */
.lp-history-dir .lp-ai-analyze-row.lp-hl-ai-row {
	position: relative;
	z-index: 2;
	width: 100%;
	margin: 10px 0 0;
}

.lp-history-dir .lp-hl-ai-btn {
	font-family: inherit;
}

.lp-history-dir .lp-hl-empty {
	padding: 36px 20px;
	text-align: center;
	border-radius: 14px;
	background: rgba(11, 13, 18, 0.72);
	border: 1px dashed rgba(255, 255, 255, 0.16);
	color: #94a3b8;
	font-size: 0.95rem;
}

.lp-history-dir .lp-hl-empty[hidden] {
	display: none;
}

/* ── AI League Analysis Modal Panel ─────────────────────────────────────── */
body.lp-la-modal-open {
	overflow: hidden;
}

.lp-la-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(5, 8, 16, 0.78);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lp-la-overlay[hidden] {
	display: none;
}

.lp-la-modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 820px;
	max-height: 88vh;
	background: #0b0d12;
	color: #e6ebf2;
	border: 1px solid #222938;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lp-la-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 22px;
	background: #11151e;
	border-bottom: 1px solid #1f2430;
}

.lp-la-modal__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.lp-la-modal__logo-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 6px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid #222938;
	flex-shrink: 0;
}

.lp-la-modal__logo-wrap[hidden] {
	display: none;
}

.lp-la-modal__logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.lp-la-modal__titles {
	min-width: 0;
}

.lp-la-modal__country {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.76rem;
	font-weight: 600;
	color: #94a3b8;
	margin-bottom: 2px;
}

.lp-la-modal__flag {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	object-fit: cover;
}

.lp-la-modal__title {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 700;
	color: #f8fafc;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lp-la-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: #141923;
	border: 1px solid #262d3d;
	border-radius: 10px;
	color: #cbd5e1;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lp-la-modal__close:hover {
	background: #1f2430;
	border-color: #3b82f6;
	color: #ffffff;
}

.lp-la-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 22px;
	background: #090b10;
	scrollbar-width: thin;
	scrollbar-color: #272e3f #090b10;
}

.lp-la-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 48px 16px;
	color: #cbd5e1;
}

.lp-la-spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid rgba(59, 130, 246, 0.25);
	border-top-color: #22D3EE;
	animation: lpLaSpin 0.8s linear infinite;
	flex-shrink: 0;
}

@keyframes lpLaSpin {
	to {
		transform: rotate(360deg);
	}
}

.lp-la-loading__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.lp-la-loading__text strong {
	color: #f8fafc;
	font-size: 0.98rem;
}

.lp-la-loading__text span {
	color: #94a3b8;
	font-size: 0.84rem;
}

.lp-la-kpis {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 20px;
}

.lp-la-kpi {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #141923;
	border: 1px solid #222938;
}

.lp-la-kpi--accent {
	border-color: rgba(34, 211, 238, 0.3);
	background: rgba(17, 21, 30, 0.95);
}

.lp-la-kpi__lbl {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #94a3b8;
}

.lp-la-kpi__val {
	font-size: 1.04rem;
	font-weight: 800;
	color: #f8fafc;
	font-variant-numeric: tabular-nums;
}

.lp-la-kpi--accent .lp-la-kpi__val {
	color: #4ade80;
}

.lp-la-report {
	font-size: 0.94rem;
	line-height: 1.65;
	color: #e6ebf2;
}

.lp-la-report h2 {
	margin: 18px 0 8px;
	padding-bottom: 6px;
	border-bottom: 1px solid #1f2430;
	font-size: 1.05rem;
	font-weight: 700;
	color: #93c5fd;
}

.lp-la-report h2:first-child {
	margin-top: 0;
}

.lp-la-report h3,
.lp-la-report h4 {
	margin: 12px 0 6px;
	font-size: 0.96rem;
	color: #f8fafc;
}

.lp-la-report p {
	margin: 0 0 10px;
}

.lp-la-report ul,
.lp-la-report ol {
	margin: 6px 0 12px 20px;
	padding: 0;
}

.lp-la-report li {
	margin-bottom: 5px;
}

.lp-la-report strong {
	color: #ffffff;
}

.lp-la-upgrade {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	padding: 36px 20px;
}

.lp-la-upgrade__badge {
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(252, 211, 77, 0.14);
	border: 1px solid rgba(252, 211, 77, 0.4);
	color: #FCD34D;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.lp-la-upgrade h3 {
	margin: 0;
	font-size: 1.2rem;
	color: #f8fafc;
}

.lp-la-upgrade p {
	margin: 0;
	max-width: 500px;
	color: #cbd5e1;
	font-size: 0.94rem;
	line-height: 1.6;
}

.lp-la-upgrade__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 6px;
	padding: 11px 22px;
	border-radius: 10px;
	background: #2563eb;
	color: #ffffff;
	font-size: 0.92rem;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.16s ease, transform 0.14s ease;
}

.lp-la-upgrade__cta:hover {
	background: #1d4ed8;
	color: #ffffff;
	text-decoration: none;
	transform: translateY(-1px);
}

.lp-la-error {
	padding: 18px 20px;
	border-radius: 12px;
	background: #2a1215;
	border: 1px solid #5c1f27;
	color: #fca5a5;
	font-size: 0.92rem;
}

.lp-la-error p {
	margin: 0;
}

/* Responsive Breakpoints (keeping exact 30px left/right spacing across desktop, tablet & mobile) */
@media (max-width: 1060px) {
	.lp-history-dir .lp-hl-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.lp-wrap.lp-history-dir {
		padding: 14px 30px 36px;
	}

	.lp-history-dir .lp-hl-hero {
		padding: 20px 18px;
		gap: 16px;
	}

	.lp-history-dir .lp-hl-summary {
		width: 100%;
		justify-content: space-around;
	}

	.lp-history-dir .lp-hl-toolbar {
		justify-content: stretch;
	}

	.lp-history-dir .lp-hl-search-wrap {
		max-width: 100%;
	}

	.lp-history-dir .lp-hl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.lp-la-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.lp-wrap.lp-history-dir {
		padding: 10px 30px 28px;
	}

	.lp-history-dir .lp-hl-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.lp-history-dir .lp-hl-card {
		padding: 20px 16px 16px;
	}

	.lp-history-dir .lp-hl-card__league {
		min-height: 0;
		margin-bottom: 12px;
	}

	.lp-la-overlay {
		padding: 12px;
	}

	.lp-la-modal__header {
		padding: 14px 16px;
	}

	.lp-la-modal__body {
		padding: 16px;
	}
}
