/* Live Crypto Portfolio Pro — frontend widget styles */

.lcpp-widget {
	--lcpp-text: #14161a;
	--lcpp-muted: #8a8f9c;
	--lcpp-up: #16c784;
	--lcpp-down: #ea3943;
	--lcpp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--lcpp-font);
	color: var(--lcpp-text);
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 4px 14px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	vertical-align: top;
	max-width: 100%;
	width: 320px;
	box-sizing: border-box;
	text-align: center;
}

.lcpp-widget.lcpp-theme-dark {
	--lcpp-text: #e7e9ee;
	--lcpp-muted: #9096a3;
}

.lcpp-widget.lcpp-theme-light {
	--lcpp-text: #14161a;
	--lcpp-muted: #6b7280;
}

.lcpp-widget *,
.lcpp-ticker-group * {
	box-sizing: border-box;
}

/* Explicitly force upright, non-synthesized text everywhere in the
   widget. Without this, some browsers substitute a synthesized
   ("fake") bold for a heavy font-weight when the actual matched font
   has no true bold face available on that device — and that synthetic
   bold can render with a visible slant. Setting font-style: normal and
   disabling synthesis guarantees straight, upright digits on every
   device/browser regardless of which font in the stack actually loads. */
.lcpp-widget,
.lcpp-ticker-group,
.lcpp-digits,
.lcpp-ticker-price,
.lcpp-change-inline,
.lcpp-ticker-change,
.lcpp-asset-amount {
	font-style: normal;
	font-synthesis: none;
	-moz-font-feature-settings: normal;
}

/* ---- Main value + inline change ---- */

.lcpp-widget-value {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	line-height: 1.1;
}

.lcpp-digits {
	display: inline-flex;
	font-size: 38px;
	font-weight: 700;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
	color: var(--lcpp-text);
	transform: scale(1);
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease, text-shadow 0.3s ease;
}

.lcpp-compact .lcpp-digits {
	font-size: 26px;
}

/* ---- Text size variants (widget) ---- */

.lcpp-size-small .lcpp-digits {
	font-size: 24px;
}
.lcpp-size-small .lcpp-change-inline {
	font-size: 12px;
}

.lcpp-size-medium .lcpp-digits {
	font-size: 38px;
}

.lcpp-size-large .lcpp-digits {
	font-size: 54px;
}
.lcpp-size-large .lcpp-change-inline {
	font-size: 19px;
}

/* ---- Text size variants (ticker) ---- */

.lcpp-ticker-group.lcpp-size-small .lcpp-ticker-price {
	font-size: 16px;
}
.lcpp-ticker-group.lcpp-size-small .lcpp-ticker-change {
	font-size: 11px;
}

.lcpp-ticker-group.lcpp-size-large .lcpp-ticker-price {
	font-size: 34px;
}
.lcpp-ticker-group.lcpp-size-large .lcpp-ticker-change {
	font-size: 16px;
}

/* Subtle scale pulse + soft glow flash on change — no background fill */
.lcpp-widget[data-flash="up"] .lcpp-digits {
	color: var(--lcpp-up);
	transform: scale(1.02);
	text-shadow: 0 0 14px rgba(22, 199, 132, 0.35);
}

.lcpp-widget[data-flash="down"] .lcpp-digits {
	color: var(--lcpp-down);
	transform: scale(1.02);
	text-shadow: 0 0 14px rgba(234, 57, 67, 0.35);
}

.lcpp-change-inline {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 16px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--lcpp-muted);
	transition: color 0.3s ease;
	white-space: nowrap;
}

.lcpp-compact .lcpp-change-inline {
	font-size: 13px;
}

.lcpp-change-inline.is-up {
	color: var(--lcpp-up);
}

.lcpp-change-inline.is-down {
	color: var(--lcpp-down);
}

.lcpp-change-arrow {
	font-size: 11px;
	line-height: 1;
}

.lcpp-change-inline.is-up .lcpp-change-arrow::after {
	content: "▲";
}

.lcpp-change-inline.is-down .lcpp-change-arrow::after {
	content: "▼";
}

.lcpp-change-pct {
	opacity: 0.9;
}

.lcpp-widget-error {
	margin: 8px 0 0;
	font-size: 11px;
	color: var(--lcpp-down);
	text-align: center;
}

/* ---- Clickable price + currency menu ---- */

.lcpp-price-wrap {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
}

.lcpp-price-wrap.lcpp-clickable {
	cursor: pointer;
}

.lcpp-price-wrap.lcpp-clickable:hover .lcpp-digits,
.lcpp-price-wrap.lcpp-clickable:hover .lcpp-ticker-price {
	opacity: 0.85;
}

.lcpp-currency-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--lcpp-muted) !important;
	font-size: 13px;
	line-height: 1;
	padding: 2px 3px;
	align-self: center;
	text-decoration: none !important;
}

.lcpp-currency-toggle:hover,
.lcpp-currency-toggle:focus,
.lcpp-currency-toggle:active {
	color: var(--lcpp-muted) !important;
	text-decoration: none !important;
	outline: none;
	box-shadow: none;
}

.lcpp-asset-amount {
	font-size: 14px;
	color: #3b82f6;
	margin-bottom: 4px;
	font-variant-numeric: tabular-nums;
}

/* ---- Shared off-canvas currency picker (one instance, appended to
   <body>, reused by every widget on the page — see attachCurrencyMenus
   in frontend.js). Fixed positioning means it's never clipped by a
   theme's overflow/stacking on the widget's ancestors. ---- */

.lcpp-currency-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 17, 21, 0.45);
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.lcpp-currency-backdrop.is-open {
	opacity: 1;
}

.lcpp-currency-backdrop[hidden] {
	display: none;
}

.lcpp-currency-sheet {
	position: fixed;
	left: 50%;
	bottom: 0;
	transform: translate(-50%, 100%);
	width: 100%;
	max-width: 360px;
	background: #ffffff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.22);
	z-index: 100001;
	padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.lcpp-currency-sheet.is-open {
	transform: translate(-50%, 0);
}

.lcpp-currency-sheet[hidden] {
	display: none;
}

@media (min-width: 560px) {
	.lcpp-currency-sheet {
		bottom: 50%;
		transform: translate(-50%, 20px);
		border-radius: 16px;
		opacity: 0;
		transition: transform 0.2s ease, opacity 0.2s ease;
	}
	.lcpp-currency-sheet.is-open {
		transform: translate(-50%, 50%);
		opacity: 1;
	}
}

.lcpp-currency-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 600;
	color: #14161a;
}

.lcpp-currency-sheet-close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	color: #8a8f9c;
	padding: 4px;
}

.lcpp-currency-sheet-close:hover {
	color: #14161a;
}

.lcpp-currency-sheet-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.lcpp-currency-sheet-option {
	background: none;
	border: none;
	text-align: left;
	padding: 12px 10px;
	font-size: 15px;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	color: #14161a;
}

.lcpp-currency-sheet-option:hover {
	background: rgba(127, 127, 127, 0.12);
}

/* ---- Ticker widget (individual coin price + fluctuation) ---- */

.lcpp-ticker-group {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 20px;
	vertical-align: top;
	max-width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--lcpp-text: #14161a;
	--lcpp-muted: #8a8f9c;
	--lcpp-up: #16c784;
	--lcpp-down: #ea3943;
}

.lcpp-ticker-group.lcpp-theme-dark {
	--lcpp-text: #e7e9ee;
	--lcpp-muted: #9096a3;
}

.lcpp-ticker-group.lcpp-theme-light {
	--lcpp-text: #14161a;
	--lcpp-muted: #6b7280;
}

.lcpp-ticker {
	background: transparent;
	border: none;
	text-align: center;
	min-width: 130px;
}

.lcpp-ticker-price {
	display: block;
	font-size: 24px;
	font-weight: 700;
	color: var(--lcpp-text);
	font-variant-numeric: tabular-nums;
	transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.lcpp-ticker[data-flash="up"] .lcpp-ticker-price {
	color: var(--lcpp-up);
	transform: scale(1.03);
	text-shadow: 0 0 14px rgba(22, 199, 132, 0.35);
}

.lcpp-ticker[data-flash="down"] .lcpp-ticker-price {
	color: var(--lcpp-down);
	transform: scale(1.03);
	text-shadow: 0 0 14px rgba(234, 57, 67, 0.35);
}

.lcpp-ticker-change {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 13px;
	font-weight: 600;
	color: var(--lcpp-muted);
}

.lcpp-ticker-change.is-up {
	color: var(--lcpp-up);
}

.lcpp-ticker-change.is-down {
	color: var(--lcpp-down);
}

@media (max-width: 480px) {
	.lcpp-widget {
		width: 100%;
		padding: 4px 10px;
	}
	.lcpp-ticker-group {
		width: 100%;
		justify-content: center;
	}
	.lcpp-digits {
		font-size: 28px;
	}
	.lcpp-change-inline {
		font-size: 13px;
	}
	.lcpp-ticker-price {
		font-size: 20px;
	}
}
