@use 'variables' as *;

// Chart Card (Figma 0:1206): 1196 × 422, white bg, 1px "Light Stroke colour" #D0CEBC, radius 12, padding 25.
.simplestats-chart-card {
	background: #fff;
	border: 1px solid #D0CEBC;                // Light Stroke colour
	border-radius: 12px;
	padding: 25px;

	&__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 16px;
	}

	// "Analytics Overview" (0:1209): Typography/Body 2/Bold 16/24, neutral/900 #18191D.
	&__title {
		margin: 0;
		font-size: 16px;
		font-weight: 700;
		line-height: 24px;
		color: #18191D;                       // neutral/900
	}

	// Tab List (0:1211): bg #F0F0F0, rounded 8, padding 3, gap 2.
	&__tabs {
		display: inline-flex;
		gap: 2px;
		padding: 3px;
		background: #F0F0F0;
		border-radius: 8px;
	}

	// Inactive tab (0:1214): Regular 14/20 neutral/900 #18191D, transparent on top of #F0F0F0.
	// Active tab (0:1212): alias/surface #FFFFFF pill, SemiBold 14/20 neutral/900. No border.
	&__tab {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 5px 9px;
		min-height: 29px;
		background: transparent;
		border: 0;
		border-radius: 4px;
		cursor: pointer;
		font-size: 14px;
		font-weight: 400;
		line-height: 20px;
		color: #18191D;                       // neutral/900

		&.is-active {
			background: #FFFFFF;              // alias/surface
			font-weight: 600;
		}
	}

	&__empty { padding: 80px 0; text-align: center; color: $muted-text; }
}

// Tooltip (Figma 0:1287): bg neutral/900 #18191D, padding 12, rounded 6, shadow 0 6 8 rgba(0,0,0,0.15).
.simplestats-chart-tooltip {
	position: relative;
	background: #18191D;                      // neutral/900
	color: #fff;
	padding: 12px;
	border-radius: 6px;
	box-shadow: 0 6px 8px rgba( 0, 0, 0, 0.15 );
	font-family: inherit;
	min-width: 149px;

	&__row {
		display: flex;
		align-items: flex-end;
		justify-content: center;
		gap: 12px;
	}

	&__text {
		display: flex;
		flex-direction: column;
	}

	// "Visitors" Body 3/SemiBold 14/20 white.
	&__label {
		font-size: 14px;
		font-weight: 600;
		line-height: 20px;
		color: #fff;
	}

	// "1,278" SemiBold 32/40 white.
	&__value {
		font-size: 32px;
		font-weight: 600;
		line-height: 40px;
		color: #fff;
	}

	// Stat-tag style inline (red down, green up — matches Figma 240:1038).
	&__delta {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		padding: 4px 8px;
		border-radius: 100px;
		font-size: 14px;
		font-weight: 600;
		line-height: 20px;
		white-space: nowrap;
		margin-bottom: 4px;        // aligns with the bottom of the big number

		&--up   { background: #DCFCE7; color: #16A34A; }   // semantic/success
		&--down { background: #FEE2E2; color: #DC2626; }   // semantic/danger
	}

	// Date footer "16th April 26" (0:1291): Body 3/Regular 14/20, brand/400 #FACC15.
	&__date {
		margin-top: 8px;
		font-size: 14px;
		font-weight: 400;
		line-height: 20px;
		color: #FACC15;                       // brand/400
	}

	// Tooltip arrow at bottom-center (0:1292): 12 × 6 triangle, filled neutral/900 #18191D.
	&__arrow {
		position: absolute;
		left: 50%;
		bottom: -6px;
		transform: translateX( -50% );
		width: 0;
		height: 0;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-top: 6px solid #18191D;
	}
}

// ApexCharts default tooltip wrapper — strip default styling.
.apexcharts-tooltip.apexcharts-theme-light {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	overflow: visible !important;
}

.apexcharts-xaxistooltip, .apexcharts-yaxistooltip { display: none !important; }
