@import '../../../styles/styles.scss';
@import '../../../styles/website-colors.styles.scss';
@import '../../../styles/cls-mat-components-overrides/cls-mat-expansion-panel-overrides.scss';
@import '../../../styles/cls-mat-components-overrides/cls-mat-chip-overrides.scss';

:host {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 8px;
	flex-grow: 25;

	[dir='rtl'] {
		::ng-deep {
			.bar,
			.grade-bar,
			.match-type-stats-bar-container {
				flex-direction: row-reverse !important;
			}
		}
	}

	.hide-alerts-icon {
		$icon-size: 18px;
		font-size: $icon-size;
		width: $icon-size;
		height: $icon-size;
		color: $color-black;
		cursor: pointer;
		transition: transform 0.2s ease-in-out;
	}

	.hide-alerts-icon:hover {
		color: $color-primary;
	}

	::ng-deep {
		mat-expansion-panel {
			gap: 10px !important;
		}

		mat-panel-title {
			display: flex;
			flex-direction: column;
			align-items: flex-start;
			gap: 8px;
			margin-inline-end: 0px;
		}
		.mat-expansion-panel-content {
			display: flex;
			max-height: 100%;
			@media screen and (min-width: 960px) {
				max-height: 100%;
			}
		}

		/* Hide default toggle icon */
		.mat-expansion-panel-header .mat-expansion-indicator::after {
			border: none;
			content: '';
		}

		.mat-expansion-indicator {
			display: none !important;
		}

		mat-panel-description {
			margin-inline-end: 0px !important;
			justify-content: end;
			gap: 16px !important;
		}

		.chip-button {
			border: none !important;
			background: transparent !important;
			padding: 0px !important;
			margin: 0px !important;
		}

		.mat-expansion-panel-header[aria-expanded='true'] .hide-alerts-icon {
			transform: rotate(180deg);
		}

		.mat-expansion-panel-header {
			border-radius: 0px;
			background-color: $color-white !important;
			padding: 0px !important;
		}

		.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled='true']) {
			background: $color-white !important;
		}
	}

	mat-accordion {
		width: 100%;
		height: 100%;
		display: flex;
	}

	::ng-deep .mobile-results-panel-header {
		padding: 8px !important;
	}

	.title-container {
		display: flex;
		align-items: center;
		gap: 4px;
		mat-icon {
			width: 18px;
			height: 18px;
			font-size: 18px;
			color: $color-black;
		}
		.title {
			font-size: 18px;
			font-style: normal;
			font-weight: 700;
			line-height: normal;
			text-transform: capitalize;
			color: $color-black;
		}
	}

	.upper-title-section-container {
		display: flex;
		flex-direction: row;
		width: 100%;
		justify-content: space-between;
		align-items: center;
	}

	.score {
		color: $color-black;
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}
}

.focus-indicator {
	:focus-visible {
		border: 2px solid black !important;
	}
}

.grade-bar {
	display: flex;
	flex-direction: column;
	width: 100%;
	background-color: $color-white;
	border: 1px solid $color-effect-dialog-background;
	border-radius: 10px;
	box-sizing: border-box;
	height: 8px;
}

.bar {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	* {
		height: 100%;
	}
}

.identical,
.paraphrased,
.minor-changes,
.ai-content {
	transition: width 0.7s;
}

.identical {
	background-color: $color-plagiarism-identical;
	border: 1px solid $color-plagiarism-identical;
	border-radius: 4px 0px 0px 4px;
}

.paraphrased {
	background-color: $color-plagiarism-paraphrased;
	border: 1px solid $color-plagiarism-paraphrased;
}

.minor-changes {
	background-color: $color-plagiarism-minor-changes;
	border: 1px solid $color-plagiarism-minor-changes;
}

.ai-content {
	background-color: #c1addc;
	border-radius: 10px;
}

.grammar-check {
	background-color: $color-grammar-dark;
	border: 1px solid $color-grammar-dark;
	border-radius: 10px;
}

.first-percentage {
	border-top-left-radius: 10px;
	border-bottom-left-radius: 10px;
}

.last-percentage {
	border-top-right-radius: 10px;
	border-bottom-right-radius: 10px;
}

.bar-title-container {
	display: flex;
	flex-direction: row;
	width: 100%;
	justify-content: space-between;
	.bar-title,
	.bar-score {
		color: $color-black;
		font-size: 18px;
		font-style: normal;
		font-weight: 700;
	}
}
