/**
 * AI Summarize frontend styles.
 *
 * Classes for theming (docs):
 *   .wpps-ai-summarize
 *   .wpps-ai-summarize--align-{left|center|right}
 *   .wpps-ai-summarize--style-{icon|icon_label|label}
 *   .wpps-ai-summarize--shape-{rounded|square|circle}
 *   .wpps-ai-summarize--size-{small|medium|large}
 *   .wpps-ai-summarize__heading
 *   .wpps-ai-summarize__buttons
 *   .wpps-ai-summarize__btn
 *   .wpps-ai-summarize__btn--{chatgpt|gemini|claude|perplexity|grok}
 *   .wpps-ai-summarize__icon
 *   .wpps-ai-summarize__label
 */

.wpps-ai-summarize {
	box-sizing: border-box;
	margin: 24px 0;
	padding: 0;
	color: #1a1a1a;
	font-family: inherit;
}

.wpps-ai-summarize *,
.wpps-ai-summarize *::before,
.wpps-ai-summarize *::after {
	box-sizing: border-box;
}

.wpps-ai-summarize__heading {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: inherit;
}

.wpps-ai-summarize__buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.wpps-ai-summarize--align-left .wpps-ai-summarize__buttons {
	justify-content: flex-start;
}

.wpps-ai-summarize--align-center .wpps-ai-summarize__buttons {
	justify-content: center;
}

.wpps-ai-summarize--align-right .wpps-ai-summarize__buttons {
	justify-content: flex-end;
}

.wpps-ai-summarize--align-left .wpps-ai-summarize__heading {
	text-align: left;
}

.wpps-ai-summarize--align-center .wpps-ai-summarize__heading {
	text-align: center;
}

.wpps-ai-summarize--align-right .wpps-ai-summarize__heading {
	text-align: right;
}

.wpps-ai-summarize__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding: 11px 14px;
	margin: 0;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
	text-decoration: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.wpps-ai-summarize--size-small .wpps-ai-summarize__btn {
	min-width: 36px;
	min-height: 36px;
	padding: 8px 10px;
	font-size: 13px;
}

.wpps-ai-summarize--size-large .wpps-ai-summarize__btn {
	min-width: 52px;
	min-height: 52px;
	padding: 14px 16px;
	font-size: 15px;
}

.wpps-ai-summarize--shape-rounded .wpps-ai-summarize__btn {
	border-radius: 10px;
}

.wpps-ai-summarize--shape-square .wpps-ai-summarize__btn {
	border-radius: 0;
}

.wpps-ai-summarize--shape-circle .wpps-ai-summarize__btn {
	border-radius: 999px;
}

.wpps-ai-summarize--shape-circle.wpps-ai-summarize--style-icon .wpps-ai-summarize__btn {
	width: 44px;
	padding-left: 0;
	padding-right: 0;
}

.wpps-ai-summarize--shape-circle.wpps-ai-summarize--style-icon.wpps-ai-summarize--size-small .wpps-ai-summarize__btn {
	width: 36px;
}

.wpps-ai-summarize--shape-circle.wpps-ai-summarize--style-icon.wpps-ai-summarize--size-large .wpps-ai-summarize__btn {
	width: 52px;
}

.wpps-ai-summarize__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: currentColor;
}

.wpps-ai-summarize__icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.wpps-ai-summarize--size-small .wpps-ai-summarize__icon svg {
	width: 16px;
	height: 16px;
}

.wpps-ai-summarize--size-large .wpps-ai-summarize__icon svg {
	width: 22px;
	height: 22px;
}

.wpps-ai-summarize__label {
	max-width: 12em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpps-ai-summarize--style-icon .wpps-ai-summarize__label {
	display: none;
}

.wpps-ai-summarize__btn--chatgpt .wpps-ai-summarize__icon { color: #10a37f; }
.wpps-ai-summarize__btn--gemini .wpps-ai-summarize__icon { color: #8e75b2; }
.wpps-ai-summarize__btn--claude .wpps-ai-summarize__icon { color: #d97757; }
.wpps-ai-summarize__btn--perplexity .wpps-ai-summarize__icon { color: #20808d; }
.wpps-ai-summarize__btn--grok .wpps-ai-summarize__icon { color: #000; }

.wpps-ai-summarize__btn:hover {
	background: #f9fafb;
	border-color: #98a2b3;
	color: #1a1a1a;
	transform: translateY(-1px);
}

.wpps-ai-summarize__btn:focus {
	outline: none;
}

.wpps-ai-summarize__btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.wpps-ai-summarize__btn:active {
	transform: translateY(0);
}

.wpps-ai-summarize__status:not(:empty) {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: #1d2327;
}

.wpps-ai-summarize__dialog[hidden] {
	display: none !important;
}

.wpps-ai-summarize__dialog {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wpps-ai-summarize__dialog-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.wpps-ai-summarize__dialog-panel {
	position: relative;
	z-index: 1;
	width: min(480px, 100%);
	max-height: min(80vh, 640px);
	overflow: auto;
	padding: 20px;
	border-radius: 12px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.wpps-ai-summarize__dialog-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
}

.wpps-ai-summarize__dialog-help {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.45;
}

.wpps-ai-summarize__dialog-text {
	width: 100%;
	min-height: 120px;
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.45;
	resize: vertical;
}

.wpps-ai-summarize__dialog-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpps-ai-summarize__dialog-copy,
.wpps-ai-summarize__dialog-close {
	appearance: none;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background: #f6f7f7;
	color: #1d2327;
	padding: 8px 12px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.wpps-ai-summarize__dialog-copy {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

@media (max-width: 600px) {
	.wpps-ai-summarize__buttons {
		gap: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpps-ai-summarize__btn {
		transition: none;
	}

	.wpps-ai-summarize__btn:hover {
		transform: none;
	}
}

.rtl .wpps-ai-summarize--align-left .wpps-ai-summarize__buttons {
	justify-content: flex-end;
}

.rtl .wpps-ai-summarize--align-right .wpps-ai-summarize__buttons {
	justify-content: flex-start;
}
