/* ============================================================
   GetLegacyHomes Wallet Advanced — Premium Dashboard Layer
   Scope: only when Wallet Advanced injects premium sections
   ============================================================ */

:root {
	--gwa-prem-bg: #0a0e1a;
	--gwa-prem-card: rgba(17, 28, 53, 0.72);
	--gwa-prem-card-2: rgba(13, 24, 40, 0.78);
	--gwa-prem-border: rgba(255, 255, 255, 0.08);
	--gwa-prem-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
	--gwa-prem-text: #e8eaf0;
	--gwa-prem-muted: #8892aa;
	--gwa-prem-blue: #3a7bd5;
	--gwa-prem-green: #22c55e;
	--gwa-prem-red: #e05050;
	--gwa-prem-gold: #f0a500;
	--gwa-prem-purple: #a88ef0;
	--gwa-prem-radius: 20px;
}

/* Enable premium mode */
#glhWrap.gwa-premium-on {
	background: var(--gwa-prem-bg);
}

/* Hide the legacy sections that would duplicate the premium home experience */
#glhWrap.gwa-premium-on.gwa-home-active .glh-tabs,
#glhWrap.gwa-premium-on.gwa-home-active .glh-ctx-panel,
#glhWrap.gwa-premium-on.gwa-home-active .glh-banners,
#glhWrap.gwa-premium-on.gwa-home-active .glh-txn-section {
	display: none !important;
}

/* Keep the hero, but remove big buttons (we use Quick Actions) */
#glhWrap.gwa-premium-on #glhHero .glh-hero-btns {
	display: none !important;
}

/* Slightly more premium hero framing (no functionality change) */
#glhWrap.gwa-premium-on #glhHero.glh-hero {
	border-radius: 24px;
	min-height: 260px;
	border-color: rgba(255, 255, 255, 0.10);
	background: linear-gradient(135deg, rgba(17, 28, 53, 0.92), rgba(13, 24, 40, 0.92));
	backdrop-filter: blur(14px) saturate(130%);
	-webkit-backdrop-filter: blur(14px) saturate(130%);
	box-shadow: var(--gwa-prem-shadow);
}

/* ------------------------------------------------------------
   Premium sections wrapper
------------------------------------------------------------ */
.gwa-premium-home {
	color: var(--gwa-prem-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	padding-bottom: 96px; /* space for bottom nav */
}

/* When user navigates to another dashboard context (invest/wallet/referral),
   hide the premium home sections and allow the native panels to show. */
#glhWrap.gwa-premium-on:not(.gwa-home-active) #gwaPremiumHome {
	display: none !important;
}

.gwa-premium-section {
	background: var(--gwa-prem-card);
	border: 1px solid var(--gwa-prem-border);
	border-radius: var(--gwa-prem-radius);
	box-shadow: var(--gwa-prem-shadow);
	backdrop-filter: blur(18px) saturate(140%);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	padding: 18px 16px;
	margin: 14px 0;
	position: relative;
	overflow: hidden;
}

.gwa-premium-section::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(1000px 420px at 88% 18%, rgba(34, 197, 94, 0.10), transparent 52%),
		radial-gradient(800px 360px at 12% 22%, rgba(58, 123, 213, 0.10), transparent 55%);
	pointer-events: none;
}

.gwa-premium-section > * {
	position: relative;
}

.gwa-sec-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.gwa-sec-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gwa-sec-ico {
	width: 40px;
	height: 40px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gwa-prem-green);
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(34, 197, 94, 0.22);
}

.gwa-sec-ico i {
	font-size: 20px;
}

.gwa-sec-head h2 {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
}

.gwa-sec-head p {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--gwa-prem-muted);
}

/* ------------------------------------------------------------
   Quick Actions
------------------------------------------------------------ */
.gwa-qa-row {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 14px;
}

.gwa-qa-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	border: none;
	background: none;
	color: var(--gwa-prem-text);
	padding: 0;
	cursor: pointer;
}

.gwa-qa-ico {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.10);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
	transition: transform 0.14s ease, background 0.14s ease;
}

.gwa-qa-ico i {
	font-size: 22px;
}

.gwa-qa-label {
	font-size: 12.5px;
	font-weight: 600;
	color: rgba(232, 234, 240, 0.92);
}

.gwa-qa-btn:active .gwa-qa-ico {
	transform: scale(0.96);
}

.gwa-qa-ico.is-green { color: var(--gwa-prem-green); }
.gwa-qa-ico.is-red { color: var(--gwa-prem-red); }
.gwa-qa-ico.is-blue { color: #60a5fa; }
.gwa-qa-ico.is-gold { color: var(--gwa-prem-gold); }
.gwa-qa-ico.is-purple { color: var(--gwa-prem-purple); }

@media (max-width: 560px) {
	.gwa-qa-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------
   Cashflow Analytics
------------------------------------------------------------ */
.gwa-cf-tabs {
	display: inline-flex;
	gap: 8px;
	padding: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.10);
}

.gwa-cf-tab {
	border: none;
	background: none;
	color: var(--gwa-prem-muted);
	font-weight: 800;
	font-size: 12px;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
}

.gwa-cf-tab.is-active {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.gwa-cf-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 14px 0 10px;
}

.gwa-metric {
	background: rgba(13, 24, 40, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	padding: 12px 12px;
}

.gwa-metric-label {
	font-size: 12px;
	color: var(--gwa-prem-muted);
	display: flex;
	align-items: center;
	gap: 7px;
	font-weight: 700;
}

.gwa-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
}
.gwa-dot.green { background: var(--gwa-prem-green); }
.gwa-dot.red { background: var(--gwa-prem-red); }
.gwa-dot.blue { background: #60a5fa; }

.gwa-metric-val {
	margin-top: 6px;
	font-size: 16px;
	font-weight: 900;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.gwa-cf-chart-wrap {
	position: relative;
	height: 260px;
	margin-top: 6px;
}

.gwa-cf-tooltip {
	position: absolute;
	inset: auto auto auto auto;
	min-width: 220px;
	background: rgba(17, 28, 53, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.10);
	border-radius: 16px;
	padding: 12px 12px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	pointer-events: none;
	transform: translate(-50%, -104%);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.gwa-cf-tooltip.is-on { opacity: 1; }
.gwa-cf-tooltip h4 { margin: 0 0 8px; font-size: 12px; color: #fff; font-weight: 900; }
.gwa-cf-tooltip .row { display:flex; justify-content:space-between; gap:12px; font-size:12px; color: rgba(232,234,240,0.92); padding:2px 0; }
.gwa-cf-tooltip .row .k { color: var(--gwa-prem-muted); font-weight: 700; }

/* ------------------------------------------------------------
   Summary cards
------------------------------------------------------------ */
.gwa-sum-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.gwa-sum-card {
	background: rgba(13, 24, 40, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 12px 12px;
	min-height: 90px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.gwa-sum-label { font-size: 12px; color: var(--gwa-prem-muted); font-weight: 700; }
.gwa-sum-value { font-size: 18px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
	.gwa-sum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------
   Two-column: transactions + referral wallet
------------------------------------------------------------ */
.gwa-two-col {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
	gap: 12px;
}

@media (max-width: 860px) {
	.gwa-two-col { grid-template-columns: 1fr; }
}

.gwa-txn-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gwa-txn-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 12px;
	border-radius: 16px;
	background: rgba(13, 24, 40, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: pointer;
}

.gwa-txn-ico {
	width: 38px;
	height: 38px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.10);
	flex-shrink: 0;
}
.gwa-txn-ico i { font-size: 18px; }
.gwa-txn-ico.is-green { color: var(--gwa-prem-green); }
.gwa-txn-ico.is-red { color: var(--gwa-prem-red); }
.gwa-txn-ico.is-blue { color: #60a5fa; }
.gwa-txn-ico.is-gold { color: var(--gwa-prem-gold); }
.gwa-txn-ico.is-purple { color: var(--gwa-prem-purple); }

.gwa-txn-mid { flex: 1; min-width: 0; }
.gwa-txn-title { color: #fff; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwa-txn-sub { margin-top: 2px; color: var(--gwa-prem-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwa-txn-right { text-align: right; flex-shrink: 0; }
.gwa-txn-amt { font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.gwa-txn-time { margin-top: 2px; font-size: 11px; color: var(--gwa-prem-muted); }

.gwa-txn-details {
	display: none;
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgba(10, 14, 26, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: rgba(232, 234, 240, 0.92);
	font-size: 12px;
}
.gwa-txn-details .row { display:flex; justify-content:space-between; gap:12px; padding:3px 0; }
.gwa-txn-details .k { color: var(--gwa-prem-muted); font-weight: 700; }

.gwa-txn-row.is-open + .gwa-txn-details { display: block; }

/* Referral wallet */
.gwa-ref-metrics { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.gwa-ref-metrics .gwa-metric { padding: 12px; }
.gwa-ref-btn {
	margin-top: 12px;
	width: 100%;
	border: none;
	border-radius: 14px;
	padding: 12px 12px;
	font-weight: 900;
	color: #131b30;
	background: linear-gradient(90deg, var(--gwa-prem-gold), #d98d00);
	cursor: pointer;
}

.gwa-ref-chart { height: 160px; margin-top: 12px; }

/* ------------------------------------------------------------
   Portfolio + AI
------------------------------------------------------------ */
.gwa-portfolio-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
}
@media (max-width: 860px) { .gwa-portfolio-grid { grid-template-columns: 1fr; } }

.gwa-donut-wrap { height: 240px; }

.gwa-ai-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 12px;
}
@media (max-width: 560px) { .gwa-ai-grid { grid-template-columns: 1fr; } }

.gwa-ai-item {
	background: rgba(13, 24, 40, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 12px 12px;
}
.gwa-ai-k { color: var(--gwa-prem-muted); font-weight: 800; font-size: 12px; }
.gwa-ai-v { margin-top: 6px; font-weight: 900; font-size: 14px; color: #fff; }

/* ------------------------------------------------------------
   Bottom navigation
------------------------------------------------------------ */
.gwa-bottom-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	background: rgba(13, 18, 36, 0.86);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}
.gwa-bottom-nav-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	padding: 10px 12px;
	gap: 8px;
}
.gwa-nav-btn {
	border: none;
	background: none;
	color: var(--gwa-prem-muted);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 6px 4px;
	cursor: pointer;
}
.gwa-nav-btn i { font-size: 20px; }
.gwa-nav-btn span { font-size: 11.5px; font-weight: 700; }
.gwa-nav-btn.is-active { color: #fff; }
.gwa-nav-btn.is-active i { color: var(--gwa-prem-gold); }
