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

[dir='rtl'] {
	::ng-deep {
		.back-button {
			mat-icon {
				transform: scaleX(-1);
			}
		}
		.result-url-source {
			direction: ltr;
			text-align: left;
		}
	}
}

.expand-result-top-continer {
	background-color: $color-white;
	border-radius: 10px;
	height: 100%;
	width: 100%;
	overflow-y: auto;
	gap: 10px;

	.expand-result-continer {
		width: 100%;
		.result-header {
			width: 100%;
			gap: 8px;
			.result-logo {
				border: 2px solid;
				border-radius: 50%;
				border-color: $color-primary;
				min-width: 40px;
				min-height: 40px;
				line-height: normal !important;
				mat-icon {
					color: $color-primary;
				}

				&.ai-source-match-icon {
					border: none !important;
					svg {
						height: 40px;
						width: 40px;
					}
				}
			}
			.repo-img {
				width: 16px;
				height: 25px;
			}
			.internal-database-img {
				width: 20.998px;
				height: 27px;
			}
			.result-title-container {
				flex-grow: 1;
				width: calc(100% - 48px);
				.exclude-button {
					cursor: pointer;
					background-color: $color-white;
					padding: 0px;
					border: 0px;
					mat-icon {
						display: flex;
						align-items: center;
						font-size: 20px;
						width: 20px;
						height: 20px;
						color: var(--Black-600, rgba(11, 22, 62, 0.6));
					}
				}
				.result-title {
					font-weight: 700;
					font-size: 14px;
					color: $color-black;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
					text-overflow: ellipsis;
					line-height: 1.5em;
					max-height: 3em;
					white-space: normal;
					overflow-wrap: break-word;
					word-break: break-word;
				}
				.result-source {
					font-size: 14px;
					font-weight: 500;
					color: $color-medium-dark;
				}
				.result-url-source {
					color: $color-primary;
					text-decoration: none;

					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					max-width: 100%;
					display: flex;
					justify-content: flex-start;
					align-items: center;
					gap: 8px;
					height: 22px !important;

					mat-icon {
						font-size: 16px;
						height: 16px;
						width: 16px;
					}
					span {
						font-size: 14px;
						font-weight: 500;
						text-decoration: underline;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
					}
				}
			}
			.back-button {
				background-color: $color-white;
				color: $color-dark-blue;
				border: 0px;
				align-self: self-start;
				cursor: pointer;
				line-height: normal !important;
				min-width: fit-content !important;
				padding: 0px;

				span {
					font-size: 14px;
					font-weight: 500;
				}
				mat-icon {
					font-size: 18px;
					height: 18px;
					width: 18px;
				}

				::ng-deep {
					.mat-button-wrapper {
						display: flex;
						align-items: center;
						justify-content: center;
						margin-inline-end: 0px;
					}
				}
			}

			.back-button:hover,
			.back-button:focus {
				color: $color-primary;
				background-color: $color-container-background;
				border-radius: 16px;
			}
		}
		.mat-chip-list-container {
			mat-chip-list {
				box-sizing: border-box;
				width: 100%;
				padding: 4px;
				::ng-deep {
					.mat-chip-list-wrapper {
						gap: 4px !important;
						flex-direction: row-reverse;
					}
				}
				mat-chip {
					color: $color-container-background;
					min-height: 22px;
					font-weight: 500;
					font-size: 14px;
					padding: 2px 8px;
					border-radius: 16px;
					margin: 0px;
					max-width: 100%;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					display: block;
					line-height: normal !important;
					border-radius: 16px;
					background: rgba(43, 149, 255, 0.2) !important;
					color: #2b95ff !important;

					&.ai-source-match {
						background: $color-light-ai-detected-text !important;
						color: $color-ai-tab !important;
						font-weight: 800 !important;
					}
				}
			}
		}
	}
	.plagiarism-detection-container {
		width: 100%;
		padding: 2px 4px 4px 4px;
		box-sizing: border-box;
		align-self: flex-end;
	}
}

.back-and-chips-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

.copy-url-button {
	display: flex !important;
	padding: 0px !important;
	background: transparent !important;
	border: none !important;
	height: 18px !important;
	width: 18px !important;
	cursor: pointer;
	font-size: 18px !important;
}

.skeleton {
	width: fit-content;
	display: flex;
	height: fit-content !important;
	::ng-deep .loader {
		height: 16px !important;
		margin-bottom: 0px !important;
		border-radius: 10px !important;
		opacity: 0.2;
		background-color: $color-medium-dark;
	}
}

.copied-url-chip {
	border-radius: 32px !important;
	background: #00800133 !important;
	display: inline-flex !important;
	height: 22px !important;
	padding: 0px 8px 0px 4px !important;
	align-items: center !important;
	gap: 4px !important;
	flex-shrink: 0 !important;
	opacity: 0; /* Initially hidden */
	transform: translateY(-10px); /* Initial position for the animation */
	animation: fadeInSlideDown 0.3s ease-out forwards; /* Animation */
	::ng-deep {
		.copy-message {
			overflow: hidden !important;
			color: $color-message-positive !important;
			font-size: 12px !important;
			font-style: normal !important;
			font-weight: 700 !important;
			line-height: normal !important;
		}

		mat-icon {
			width: 18px !important;
			height: 18px !important;
			font-size: 18px !important;
			color: $color-message-positive !important;
		}
	}
}

.loader-container {
	display: flex;
	flex-direction: row;
	width: 100%;

	.left-side-loader,
	.right-side-loader {
		width: 50%;
		display: flex;
		flex-direction: column;
	}

	.left-side-loader {
		gap: 10px;
		.back-btn {
			width: 15%;
			::ng-deep .loader {
				height: 22px !important;
			}
		}
		.result-title-loader-container {
			width: 100%;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: flex-start;
			gap: 8px;
			.result-icon-loader {
				::ng-deep .loader {
					border-radius: 50% !important;
					width: 32px !important;
					height: 32px !important;
				}
			}
			.icons-loader-container {
				display: flex;
				flex-direction: column;
				gap: 4px;
				.icon-loader {
					::ng-deep .loader {
						border-radius: 50% !important;
						width: 16px !important;
						height: 16px !important;
					}
				}
			}

			.info-loader-container {
				display: flex;
				flex-direction: column;
				gap: 4px;
				flex-grow: 1;
				.skeleton {
					width: 80%;
				}
				.skeleton:first-of-type {
					width: 60%;
				}
			}
		}

		.result-chips-loader-container {
			display: flex;
			flex-direction: row;
			gap: 4px;
			.skeleton {
				width: 15%;
				::ng-deep .loader {
					height: 22px !important;
				}
			}
		}
	}

	.right-side-loader {
		gap: 4px;
		.title-loader {
			width: 30%;
			::ng-deep .loader {
				height: 16px !important;
			}
		}

		.stats-loader-container {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			padding-inline-start: 8px;
			align-items: center;

			.skeleton:first-child {
				width: 30%;
				::ng-deep .loader {
					height: 16px !important;
				}
			}

			.stats-values-loader-container {
				display: flex;
				flex-direction: row;
				align-items: center;
				gap: 16px;
				.skeleton {
					width: 32px !important;
					::ng-deep .loader {
						height: 16px !important;
					}
				}
			}

			.specific-stat-loader-container {
				display: flex;
				flex-direction: row;
				align-items: center;
				gap: 4px;
				flex-grow: 1;
				.skeleton {
					width: 30%;
					::ng-deep .loader {
						height: 16px !important;
					}
				}

				.skeleton:first-child {
					width: 16px !important;
					::ng-deep .loader {
						width: 16px !important;
						height: 16px !important;
						border-radius: 50% !important;
					}
				}
			}
		}
	}
}

.internet-result-favicon {
	width: 20px !important;
}

.cdk-keyboard-focused {
	outline: 2px solid black !important;
}

@keyframes fadeInSlideDown {
	0% {
		opacity: 0;
		transform: translateY(-10px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}
