@use 'sass:color';
@use '@/vue/assets/scss/app/variables.scss' as *;

.aioseo-headline-analyzer-sidebar {
	position: relative;
	font-size: 14px;

	.aioseo-headline-analyzer-pie-chart-container {
		position: relative;
		width: 200px;
		height: 200px;
		margin: 0 auto;
		margin-bottom: 16px;

		.aioseo-headline-analyzer-total-out-of-score {
			font-size: 18px;
			color: #8c8f9a;
			font-weight: 600;
			z-index: 0;
		}
	}

	.components-panel__body {
		svg.components-panel__arrow {
			top: 50%;
			margin-top: -12px;
			transition: .3s;
		}

		&.is-opened {
			svg.components-panel__arrow {
				transform: rotate(0deg);
			}
		}
	}

	p {
		font-size: 14px;
		line-height: 22px;
		color: #434960;
		margin-bottom: 12px;
		> strong {
			font-size: inherit;
			font-weight: $font-bold;
		}
	}

	.green {
		color: #00aa63;
	}

	.orange {
		color: #f18200;
	}

	.red {
		color: #df2a4a;
	}

	.green-bg {
		background: #00aa63;
	}

	.orange-bg {
		background: #f18200;
	}

	.red-bg {
		background: #df2a4a;
	}

	.gray-bg {
		background: #a1a1a1;
	}

	.components-panel__body-toggle.components-button {
		font-size: 14px;
		line-height: 22px;
		font-weight: $font-bold;
		color: #141B38;
		padding-block: 13px;
	}

	.aioseo-headline-analyzer-empty-title-warning {
		margin: 16px !important;
		color: #141B38;
		text-align: start;
	}

	.components-panel__body.is-opened > .components-panel__body-title {
		margin: 0;
	}

	.components-panel__body.is-opened {
		padding: 0;
		.aioseo-headline-analyzer-words-block,
		.aioseo-headline-analyzer-panel-first-block {
			padding: 0 16px;
		}
	}

	.aioseo-headline-analyzer-panel-score.is-opened,
	.aioseo-headline-analyzer-panel-sentiment.is-opened,
	.aioseo-headline-analyzer-panel-previous-scores.is-opened,
	.aioseo-headline-analyzer-panel-character-count.is-opened,
	.aioseo-headline-analyzer-panel-tab-new-score.is-opened,
	.aioseo-headline-analyzer-panel-tab-new-score-form.is-opened,
	.aioseo-headline-analyzer-panel-word-count.is-opened,
	.aioseo-headline-analyzer-panel-beginning-ending-words.is-opened,
	.aioseo-headline-analyzer-panel-tab-new-score.is-opened,
	.aioseo-headline-analyzer-panel-search-preview.is-opened,
	.aioseo-headline-analyzer-panel-types.is-opened,
	.aioseo-headline-analyzer-panel-word-balance.is-opened {
		.components-panel__body-title {
		border-bottom: 1px solid #e8e8eb;
		margin-bottom: 16px;
		}
	}

	.aioseo-headline-analyzer-current-score,
	.aioseo-headline-analyzer-score-status {
		position: absolute;
		top: 45%;
		left: 0;
		right: 0;
		text-align: center;
		font-size: 50px;
		line-height: 0%;
		z-index: 0;
		font-weight: $font-bold;

		p {
		margin-bottom: 0;
		}
	}

	.aioseo-headline-analyzer-new-score-panel {
		top: calc(58% + 16px);
	}

	.aioseo-headline-analyzer-score-status {
		top: 65%;
        font-size: 16px;
		z-index: 0;
	}

	.aioseo-headline-analyzer-current-score-tab {
		p {
			text-align: center;
		}

		.aioseo-headline-analyzer-current-title {
			text-align: center;
			font-size: 14px;
			color: #141B38;
			margin: 0 0 12px 0;
			line-height: 22px;
		}
	}

	.aioseo-headline-analyzer-new-score-panel {
		h4 {
			text-align: center;
			font-size: 16px;
			color: #141B38;
			margin: 0 0 28px 0;
			line-height: 1.4;
		}

		.aioseo-headline-analyzer-pie-chart-container {
			position: relative;
			width: 200px;
			height: 200px;
			margin: 0 auto;
			margin-bottom: 16px;

			.aioseo-headline-analyzer-new-score {
				position: absolute;
				top: calc(38% + 16px);
				left: 0;
				right: 0;
				text-align: center;
				font-size: 50px;
				font-weight: $font-bold;
				line-height: 0%;
				z-index: 10;

				p {
					margin-bottom: 0;
				}
			}
		}

		.current-score {
			border-top: 1px solid #E8E8EB;
			padding-top: 16px;
			margin: 16px 0;
			display: flex;
			align-items: center;
			flex-direction: row;

			.aioseo-headline-analyzer-score {
				min-height: 40px;
				min-width: 40px;
				font-weight: $font-bold;
				color: #ffffff;
				margin-right: 16px;
				text-align: center;
				line-height: 40px;
				border-radius: 50%;
				font-size: 18px;
			}

			h5 {
				font-weight: 400;
				color: #8C8F9A;
				margin-top: 0;
				margin-bottom: 8px;
				font-size: 13px;
			}

			p {
				margin: 0;
			}
		}
	}

	.aioseo-headline-analyzer-new-score-form-block {
		padding: 0 16px 16px;

		form label {
			text-transform: none;
			font-weight: 400;
		}
	}

	.aioseo-headline-analyzer-input-field {
		margin-bottom: 10px;

		.components-base-control__label {
			display: block;
			max-width: 100%;
			font-size: $font-md;
			line-height: 22px;
			font-weight: 400;
			text-transform: none;
			margin: 0 0 12px;
			color: #434960;
		}

		input {
			padding: 11px 12px;
			font-size: 13px;
			border: 1px solid #D0D1D7;
			color: #393f4c;
			border-radius: 3px;
		}
	}

	.aioseo-headline-analyzer-button {
		font-size: 14px;
		border-radius: 4px;
		padding: 0;
		height: 40px;
		background: #005AE0;
		width: 100%;
		justify-content: center;
		color: #ffffff;
		font-weight: 600;
		border: 1px solid transparent;
		transition: background-color .2s ease;
		opacity: 1;

		&:disabled {
			border: 1px solid #dcdde1;
			background-color: #f3f4f5;
			color: #8c8f9a;
			cursor: default;
			&:hover {
				color: #8c8f9a;
			}
		}

		&:hover,
		&:focus,
		&:visited {
			color: #ffffff;
			box-shadow: none;
		}

	}

	.aioseo-headline-analyzer-score-difference {
		font-weight: $font-bold;
		position: absolute;
		left: 0;
		top: 16%;
		right: 0;
		text-align: center;
		width: 42px;
		height: 26px;
		margin: 0 auto;
		font-size: 16px;
		line-height: 26px;
		border-radius: 4px;
		&.red {
			background: color.adjust(#AB2039, $lightness: 55%);
		}
		&.orange {
			background: #FCFAE8;
		}
		&.green {
			background: #CBEAE1;
		}
	}

	.aioseo-headline-analyzer-previous-scores {
		margin: 0 !important;

		li {
			margin-bottom: 16px;
			cursor: pointer;
			display: flex;
			flex-direction: row;
			align-items: center;
			color: #434960;

			span {

				&.aioseo-headline-analyzer-score {
					min-height: 24px;
					min-width: 24px;
					margin-right: 12px;
					font-size: 11px;
					text-align: center;
					line-height: 24px;
					border-radius: 50%;
					color: #ffffff;
					font-weight: $font-bold;
				}

				&.aioseo-headline-analyzer-score-text {
					flex-basis: calc(100% - 32px);
				}
			}
		}
	}

	.components-panel__body {
		&.aioseo-headline-analyzer-panel-has-icon {
		

		&.red {
			.components-panel__body-toggle .components-panel__icon path {
				fill: #df2a4a;
			}
		}

		&.orange {
			.components-panel__body-toggle .components-panel__icon path {
				fill: #f18200;
			}
		}

		&.green {
			.components-panel__body-toggle .components-panel__icon path {
				fill: #00aa63;
				}
			}
		}

		&.aioseo-headline-analyzer-panel-has-icon-alternative {
			position: relative;
			.aioseo-headline-analyzer-panel-icon-alternative {
				position: absolute;
				top: 14px;
				right: 40px;
				font-weight: $font-bold;
			}
		}

		&.aioseo-headline-analyzer-panel-word-balance,
		&.aioseo-headline-analyzer-panel-sentiment,
		&.aioseo-headline-analyzer-panel-types,
		&.aioseo-headline-analyzer-panel-character-count,
		&.aioseo-headline-analyzer-panel-word-count,
		&.aioseo-headline-analyzer-panel-beginning-ending-words,
		&.aioseo-headline-analyzer-panel-search-preview {
			.components-panel__row {
				display: block;

				h4 {
					font-size: 14px;
					color: #141B38;
					font-weight: $font-bold;
					margin: 0 0 12px 0;
				}
			}
		}
	}

	.aioseo-headline-analyzer-words-block {
		margin-top: 12px;
		border-bottom: 1px solid #e8e8eb;

		h5 {
			font-size: 12px;
			line-height: 18px;
			color: #434960;
			margin-top: 0;
			margin-bottom: 8px;
			font-weight: $font-bold;
		}

		.aioseo-headline-analyzer-words-block-data {
			overflow: hidden;
			display: flex;
			flex-direction: row;

		span {
			display: block;
			float: left;
			flex-basis: 70%;
			z-index: 0;

			&.aioseo-headline-analyzer-words-block-percentage {
				font-size: 24px;
				line-height: 30px;
				font-weight: $font-bold;
				flex-basis: 25%;
				justify-content: flex-start;
				align-items: center;
				display: flex;
				margin-right: 11px;
			}

			&.aioseo-headline-analyzer-words-block-goal {
				width: 100%;
				font-size: 14px;
				line-height: 22px;
				font-weight: 400;
				color: #8C8F9A;
			}

			&.aioseo-headline-analyzer-words-block-progressbar {
				width: 100%;
				position: relative;
				height: 4px;
				margin-top: 4px;

				.aioseo-headline-analyzer-progressbar-bg {
					width: 100%;
					background: #EEF0F2;
					height: 4px;
					z-index: 9;
					position: absolute;
					top: 0;
					left: 0;
					border-radius: 30px;
				}

				.aioseo-headline-analyzer-progressbar-part {
					position: absolute;
					height: 4px;
					top: 0;
					left: 0;
					z-index: 10;
					border-radius: 30px;
				}
			}
		}
	}

	.aioseo-headline-analyzer-words-tag-list {
		margin: 0;
		padding: 0;
		list-style: none;
		display: block;
		margin-top: 8px;

		li {
			display: inline-block;
			font-size: 12px;
			line-height: 18px;
			font-weight: $font-bold;
			color: #434960;
			background: #F3F4F5;
			border-radius: 3px;
			padding: 1px 8px;
			margin: 0 8px 8px 0;
		}
	}

		.aioseo-headline-analyzer-words-guideline {
			color: #4f4f4f;
		}
	}

	.aioseo-headline-analyzer-character-length,
	.aioseo-headline-analyzer-word-length {
		> span {
			width: 34px;
			height: 50px;
			display: inline-block;
			background: #e8e8eb;
			text-align: center;
			line-height: 50px;
			font-size: 24px;
			color: #2c324c;
			font-weight: $font-bold;
			margin-right: 2px;
			border-radius: 4px;

			&.character-zero {
				color: #D0D1D7;
			}
		}
	}

	.aioseo-headline-analyzer-status-on-character-length,
	.aioseo-headline-analyzer-status-on-word-length {
		display: block;
		font-weight: $font-bold;
		font-size: 14px;
		color: #141b38;
		margin-bottom: 12px;
	}

	.aioseo-headline-analyzer-character-count-container,
	.aioseo-headline-analyzer-word-counter {
		margin-bottom: 12px;
	}

	.aioseo-headline-analyzer-panel-character-count {
		p {
			text-align: left;
		}

		.aioseo-headline-analyzer-pie-chart-container {
			position: relative;
			width: 200px;
			height: 80px;
			margin: 0 auto;
			margin-bottom: 16px;
			margin-left: -40px;

			.aioseo-headline-analyzer-character-length {
				position: absolute;
				top: 50%;
				left: 0;
				right: 0;
				text-align: center;
				font-size: 30px;
				line-height: 0%;
				z-index: 10;
			}

			.aioseo-headline-analyzer-status-on-character-length {
				position: absolute;
				left: 144px;
				top: 50%;
				font-size: 16px;
				color: #141B38;
				margin: -9px 0 0 0;
				font-weight: $font-bold;
				width: 130px;
			}
		}
	}

	.aioseo-headline-analyzer-panel-word-count {
		p {
			text-align: left;
		}

		.aioseo-headline-analyzer-pie-chart-container {
			position: relative;
			width: 200px;
			height: 80px;
			margin: 0 auto;
			margin-bottom: 16px;
			margin-left: -40px;

			.aioseo-headline-analyzer-word-length {
				position: absolute;
				top: 50%;
				left: 0;
				right: 0;
				text-align: center;
				font-size: 30px;
				line-height: 0%;
				z-index: 10;
			}

			.aioseo-headline-analyzer-status-on-word-length {
				position: absolute;
				left: 144px;
				top: 50%;
				font-size: 14px;
				color: #141B38;
				margin: -9px 0 0 0;
				font-weight: $font-bold;
				width: 130px;
			}
		}
	}

	.aioseo-headline-analyzer-panel-beginning-ending-words {

		.aioseo-headline-analyzer-words {
			display: block;
			margin-bottom: 12px;

			span {
				font-size: 12px;
				line-height: 18px;
				color: #434960;
				background: #f3f4f5;
				border-radius: 3px;
				padding: 1px 8px;
				font-weight: $font-bold;
				display: inline-block;
			}
		}
	}

	.components-panel__body.aioseo-headline-analyzer-panel-beginning-ending-words {
		.aioseo-headline-analyzer-word-ending-title,
		.aioseo-headline-analyzer-word-begining-title {
			font-weight: $font-bold;
			font-size: 14px;
			color: #141b38;
			list-style: none;
			margin: 0 0 8px;

			li {
				margin: 0;
			}
		}
	}

	.components-panel__body.aioseo-headline-analyzer-panel-search-preview {
		.components-panel__row {
			.aioseo-headline-analyzer-search-prevew-wrap {
				background: #ffffff;
				border: 0.837954px solid #e8e8eb;
				padding: 8px;
				margin-bottom: 16px;
			}
			h4 {
				color: #1a0dab;
				font-size: 16px;
				line-height: 24px;
				margin-top: 0 !important;
				text-transform: none;
				margin-bottom: 8px;
				font-weight: 400;
			}

			.aioseo-headline-analyzer-post-url {
				font-size: 14px;
				line-height: 22px;
				margin-bottom: 8px;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;

				a {
					color: #3c4043;
					text-decoration: none;

					&:hover {
						opacity: 0.8;
					}
				}
			}

			p {
				font-size: 14px;
				color: #434960;
				line-height: 125%;
				margin: 0px;
			}
		}
	}

	.aioseo-headline-analyzer-panel-types {

		.aioseo-headline-analyzer-panel-types-title {
			display: flex;
			justify-content: space-between;
			align-items: space-between;
			width: 100%;
			color: #141B38;

			span {
				color: #141B38;
				font-size: 13px;
			}
		}
		p {
			a {
				color: #005AE0;;
				text-decoration: none;
				span {
					text-decoration: underline;
				}
			}
		}
	}
}

button.has-icon[aria-label="Headline Analyzer"],
button.has-icon[aria-label="Headline Analyzer"]:hover {
	background: none !important;
	box-shadow: none !important;

	&[aria-pressed="false"] {
		display: none; // We'll make it visible once the score has been calculated.
	}

	#aioseo-headline-analyzer-sidebar-button {
		display: none;
		align-items: center;
		justify-content: center;
		gap: 4px;
		background: #fff;
		border-radius: 3px;
		height: 36px;
		min-width: 36px;
		width: 100% !important;
		padding: 6px !important;
		max-width: 160px;
		min-width: 82px !important;
		font-weight: bold;

		svg {
			path {
				fill: #fff
			}
		}

		svg {
			max-width: 22px;
			max-height: 20px;
		}

		span {
			color: #fff;
			font-weight: $font-bold;
		}

		&[aioseo-button-color="red"] {
			border: 1px solid #df2a4a;

			svg {
				path {
					fill: #df2a4a;
				}
			}

			span {
				color: #df2a4a;
			}
		}

		&[aioseo-button-color="orange"] {
			border: 1px solid #f18200;

			svg {
				path {
					fill: #f08629;
				}
			}

			span {
				color: #f18200;
			}
		}

		&[aioseo-button-color="green"] {
			border: 1px solid #1ec185;

			svg {
				path {
					fill: #1ec185;
				}
			}

			span {
				color: #1bb17a;
			}
		}

		&[aioseo-button-color="gray"] {
			border: 1px solid #a1a1a1;

			svg {
				path {
					fill: #a1a1a1;
				}
			}

			span {
				color: #a1a1a1;
			}
		}
	}

	&:focus {
		#aioseo-headline-analyzer-sidebar-button[aioseo-button-color="red"] {
			box-shadow: none !important;
		}
	}

	&:active,
	&.is-pressed {
		#aioseo-headline-analyzer-sidebar-button {
			&[aioseo-button-color="red"],
			&[aioseo-button-color="green"],
			&[aioseo-button-color="orange"],
			&[aioseo-button-color="gray"] {
					box-shadow: none !important;

					svg {
						path {
							fill: #fff !important;
						}
					}

					span {
						color: #fff;
					}
				}

			&[aioseo-button-color="red"] {
				background: #df2a4a !important;
			}

			&[aioseo-button-color="orange"] {
				background: #f18200 !important;
			}

			&[aioseo-button-color="green"] {
				background: #1ec185 !important;
			}

			&[aioseo-button-color="gray"] {
				background: #a1a1a1 !important;
			}
		}
	}
}

.edit-post-sidebar,
.editor-sidebar {
	scroll-behavior: smooth;
}

.aioseo-headline-analyzer-current-score-content {
	> p {
		font-weight: $font-bold;
	}
}

.aioseo-headline-analyzer-bottom-notice {
	padding: 8px;
	background: #E6EEFC;
	margin: 16px;
	border-radius: 3px;
	color: #141B38;

	p {
		text-align: start;
		margin-bottom: 0;

		a {
			color: #005AE0;
			text-decoration: none;

			span {
				text-decoration: underline;
			}
		}
	}
}

.aioseo-donut-container {
	display: flex;
	align-items: center;
	justify-content: center;

	.aioseo-seo-headline-analyzer-score__circle {
		animation: aioseo-seo-site-score-fill 1s reverse;
		transform: rotate( -180deg );
		transform-origin: center;
	}
}

.interface-pinned-items {
	button.components-button {
		height: 36px;

		&.is-compact.has-icon {
			&[aria-label*="Headline Analyzer"] {
				width: auto;
			}
		}
	}
}