/*
 * xcoins-chart.css — shared price-chart component (T1 + T3).
 * Figma T1 chart: 868:12413 (desktop) / 868:11649 (mobile).
 */

.xc-chart {
	background: var(--rich-black);
	padding: 64px 0;
}
.xc-chart__card {
	background: rgba(255, 255, 255, .02);
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 14px;
	padding: 21px 21px 39px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.xc-chart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0;
}
.xc-chart__title {
	display: flex;
	align-items: center;
	gap: 16px;
	font-family: var(--display);
	font-weight: 700;
	font-size: 18px;
	line-height: 1;
	margin: 0;
	color: var(--off-white);
}
.xc-chart__icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: contain;
	flex-shrink: 0;
}
.xc-chart__tabs {
	display: flex;
	gap: 6px;
	background: transparent;
	border-radius: 0;
	padding: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.xc-chart__tab {
	font-family: var(--body);
	font-weight: 400;
	font-size: 14px;
	line-height: 1.25;
	padding: 7px 13px;
	height: 32px;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 999px;
	background: transparent;
	color: #aab4c4;
	cursor: pointer;
	white-space: nowrap;
}
.xc-chart__tab.is-active {
	background: rgba(26, 156, 252, .14);
	border-color: rgba(26, 156, 252, .4);
	color: #fff;
}
.xc-chart__canvas-wrap {
	position: relative;
	width: 100%;
	height: 300px;
	min-height: 300px;
	box-sizing: border-box;
	background: rgba(249, 253, 255, .05);
	border: 1px dashed rgba(120, 129, 150, .35);
	border-radius: 14px;
	overflow: hidden;
}
.xc-chart__canvas-wrap canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/*
 * Load states, driven by data-chart-state on the .xc-chart root (set by
 * assets/js/xcoins-chart.js). Hidden with display rather than the [hidden]
 * attribute so nothing has to out-specify a UA rule, and the wrap's height is
 * fixed above — so a slow or missing series can never shift the page.
 */
.xc-chart__empty {
	display: none;
	position: absolute;
	inset: 0;
	margin: 0;
	place-content: center;
	text-align: center;
	padding: 0 24px;
	font-family: var(--xc-body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--xc-slate);
}
[data-chart-state="empty"] .xc-chart__empty {
	display: grid;
}
[data-chart-state="loading"] .xc-chart__canvas-wrap {
	opacity: .55;
	transition: opacity .2s ease;
}
/*
 * The wrap clips (rounded corners + gradient fill), so the tooltip must never
 * need to overflow it: assets/js/xcoins-chart.js sets its top-left directly,
 * clamped inside the box and flipped below the point when there's no room above.
 * Hence no transform here — JS owns the exact position and needs to measure the
 * real box to keep it in bounds.
 */
.xc-chart__tooltip {
	position: absolute;
	pointer-events: none;
	opacity: 0;
	background: #151a24;
	border: none;
	border-radius: 20px;
	padding: 10px 14px;
	font-family: var(--body);
	font-size: 14px;
	line-height: 1.25;
	color: #aab4c4;
	white-space: nowrap;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .07);
	transition: opacity .1s ease;
	z-index: 2;
}
.xc-chart__tooltip.is-visible { opacity: 1; }
.xc-chart__tooltip strong {
	display: block;
	color: #aab4c4;
	font-family: var(--body);
	font-weight: 400;
}

@media (max-width: 960px) {
	.xc-chart { padding: 24px 0; }
	.xc-chart .xc-container { padding-inline: 18px; }
	.xc-chart__card { padding: 15px; gap: 10px; }
	.xc-chart__head { flex-direction: column; align-items: flex-start; gap: 10px; }
	.xc-chart__tabs { width: 100%; }
	.xc-chart__canvas-wrap {
		height: 200px;
		min-height: 200px;
	}
}
