/**
 * CryptoFrame Crypto Markets — chart styles.
 *
 * The canvas itself is drawn in JavaScript; everything here is the frame around
 * it: controls, the loading overlay, the notice line and the text alternative.
 */

.cfxcm-chart {
	display: block;
	width: 100%;
}

.cfxcm-chart__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.cfxcm-chart__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}

.cfxcm-chart__ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.cfxcm-chart__types {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.cfxcm-chart__types .cfxcm-select {
	width: auto;
	min-width: 8rem;
}

.cfxcm-chart__interval[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Canvas
 * ---------------------------------------------------------------------- */

.cfxcm-chart__canvas-wrap {
	position: relative;
	width: 100%;
}

.cfxcm-chart__canvas {
	display: block;
	width: 100%;
	height: auto;
	touch-action: pan-y;
}

.cfxcm-chart__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.cfxcm-chart__overlay[hidden] {
	display: none;
}

.cfxcm-chart__overlay .cfxcm-skeleton {
	width: 100%;
	height: 100%;
}

/* -------------------------------------------------------------------------
 * Notices and tooltip
 * ---------------------------------------------------------------------- */

.cfxcm-chart__notice {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.75rem;
	border-radius: var(--cfxcm-radius-sm, 6px);
	background: var(--cfxcm-surface-alt, #f6f7f9);
	color: var(--cfxcm-muted, #6b7280);
	font-size: var(--cfx-fs-xs, 0.8125rem);
}

.cfxcm-chart__notice[hidden] {
	display: none;
}

.cfxcm-chart__noscript {
	margin: 0.5rem 0 0;
	color: var(--cfxcm-muted, #6b7280);
	font-size: var(--cfx-fs-xs, 0.8125rem);
}

/* The tooltip is positioned by the renderer and never traps the pointer. */
.cfxcm-chart__tooltip {
	position: absolute;
	z-index: 3;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--cfxcm-border, rgba(0, 0, 0, 0.1));
	border-radius: var(--cfxcm-radius-sm, 6px);
	background: var(--cfxcm-surface, #fff);
	box-shadow: var(--cfx-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
	font-size: var(--cfx-fs-xs, 0.8125rem);
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	pointer-events: none;
	white-space: nowrap;
	transform: translate(-50%, -100%);
}

.cfxcm-chart__tooltip[hidden] {
	display: none;
}

.cfxcm-chart__tooltip-label {
	display: block;
	color: var(--cfxcm-muted, #6b7280);
}

.cfxcm-chart__tooltip-value {
	display: block;
	font-weight: 700;
}

@media (max-width: 480px) {
	.cfxcm-chart__types {
		width: 100%;
		margin-left: 0;
	}

	.cfxcm-chart__types .cfxcm-select {
		flex: 1 1 0;
		min-width: 0;
	}
}
