@import "@automattic/color-studio/dist/color-variables";
@import "@automattic/components/src/styles/typography";
@import "@wordpress/base-styles/breakpoints";

$blueberry-color: #3858e9;

.core-web-vitals-display {
	display: flex;
	flex-direction: column;
	width: 100%;

	&.is-desktop {
		display: flex;
		flex-direction: row;
		width: 100%;
		gap: 16px;
	}
}

.core-web-vitals-display__description-subheading,
.core-web-vitals-display__recommendations-title {
	font-family: $font-sf-pro-display;
	color: var(--studio-black);
	font-size: $font-body;
	line-height: 20px;
	font-weight: 500;
	margin-bottom: 8px;
}

.core-web-vitals-display__description-aka {
	font-size: $font-body-extra-small;
	color: var(--studio-gray-70);
}

.core-web-vitals-display__description p {
	margin-top: 0;
	margin-bottom: 24px;
	max-width: 496px;
	line-height: 24px;
}

.core-web-vitals-display__description a {
	color: $blueberry-color;
}

$blueberry-color: #3858e9;
.core-web-vitals-display__recommendations {
	display: flex;
	flex-direction: column;

	.core-web-vitals-display__recommendations-subtitle {
		line-height: 24px;
		margin-bottom: 16px;
	}

	.recommendations-anchor.components-button.is-secondary {
		border-radius: 2px;
		border: 1px solid $blueberry-color;
		background: #fff;
		color: $blueberry-color;
		box-shadow: none;
		margin-bottom: 16px;

		&:hover {
			box-shadow: none;
		}
	}
}

.core-web-vitals-display__metric {
	font-family: $font-sf-pro-display;
	font-size: $font-size-header;
	margin-bottom: 24px;

	&.good {
		color: var(--studio-green-60);
	}

	&.needs-improvement {
		color: var(--studio-orange-60);
	}

	&.bad {
		color: var(--studio-red-60);
	}
}

.core-web-vitals-display__history-graph-container {
	.chart-container {
		width: 100%;
		max-width: 100%;
	}
}

.core-web-vitals-display__details {
	border: 1px solid var(--studio-gray-5);
	background: var(--studio-white);
	/* stylelint-disable-next-line scales/radii */
	border-radius: 6px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	column-gap: 32px;
	min-height: 360px;
	flex-wrap: wrap;
	flex-grow: 1;

	& > div {
		flex-grow: 1;
		flex-basis: 0;
		min-width: 300px;
	}

	& > p {
		min-height: 80px;
	}

	@media (max-width: $break-large) {
		border: 0;
		padding-top: 0;
	}

}

.core-web-vitals-display__description-container {
	display: flex;
	gap: 24px;

	.header {
		flex: 1;
	}

	@media (max-width: $break-large) {
		flex-direction: column;
		gap: 0;
	}
}

.core-web-vitals-display__ranges {
	display: flex;
	flex-direction: row;
	justify-content: start;
	margin-bottom: 24px;
	column-gap: 24px;

	.range {
		display: flex;
		flex-direction: row;
		column-gap: 6px;
		font-family: $font-sf-pro-display;

		& > svg {
			padding-top: 4px;
		}

		.range-heading {
			font-size: $font-body-small;
			font-weight: 500;
			line-height: 20px;
		}

		.range-subheading {
			font-size: $font-body-extra-small;
			line-height: 20px;
		}
	}

	@media (max-width: $break-mobile) {
		flex-direction: column;
		gap: 8px;
	}
}

.metric-tab-bar__tab-metric.performance-score {
	&.tab {
		margin-top: 16px;
	}

	&.accordion {
		margin-top: 6px;
	}
}
