/*
 * AEO Pro — Stylesheet
 * Enqueue after maksut-aeo-checker (dependency). Loaded via pro-assets.php.
 *
 * @package Maksut
 */

/* ── Token input field ──────────────────────────────────────────────────────── */

.aeo-field--pro-token {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--aeo-border, rgba(26, 23, 20, 0.08));
}

.aeo-badge--pro {
	display: inline-flex;
	align-items: center;
	background: #1a3a2a;
	color: #d4efe2;
	font-family: var(--aeo-mono, var(--mono, monospace));
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	padding: 0.15rem 0.5rem;
	border-radius: 3px;
	margin-left: 0.4rem;
	vertical-align: middle;
}

.aeo-input--mono {
	font-family: var(--aeo-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
	font-size: 0.82rem;
	letter-spacing: 0.04em;
}

.aeo-input--mono.aeo-input--token-ok {
	border-color: #22c55e;
	box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}
.aeo-input--mono.aeo-input--token-err {
	border-color: #ef4444;
	box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

/* ── Pro tag on results panel ───────────────────────────────────────────────── */

.aeo-pro-badge {
	display: none;
	align-items: center;
	gap: 0.35rem;
	background: #1a3a2a;
	color: #d4efe2;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.25rem 0.65rem;
	border-radius: 3px;
	margin-bottom: 1.25rem;
}
.aeo-pro-badge.is-visible {
	display: inline-flex;
}
.aeo-pro-badge::before {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	background: #5dcaa5;
	border-radius: 50%;
}

/* ── Pro results section ────────────────────────────────────────────────────── */

.aeo-pro-results {
	margin-top: 2rem;
	border-top: 1px solid var(--aeo-border, rgba(26, 23, 20, 0.08));
	padding-top: 1.5rem;
}

.aeo-pro-results:not([hidden]) {
	display: block !important;
}

.aeo-pro-results__heading {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aeo-muted, var(--ink-soft, #6b7280));
	margin-bottom: 1rem;
}

/* ── Individual dimension block ─────────────────────────────────────────────── */

.aeo-pro-dim {
	margin-bottom: 1.1rem;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--aeo-border-light, #f3f4f6);
}
.aeo-pro-dim:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.aeo-pro-dim__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

.aeo-pro-dim__label {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--aeo-text, var(--ink, #18181b));
}

.aeo-pro-dim__score {
	font-size: 0.92rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

.aeo-pro-bar-track {
	height: 3px;
	background: var(--aeo-border, rgba(26, 23, 20, 0.08));
	border-radius: 2px;
	margin-bottom: 0.6rem;
	overflow: hidden;
}
.aeo-pro-bar-fill {
	height: 3px;
	border-radius: 2px;
	transition: width 0.4s ease;
}

.aeo-pro-dim__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}
.aeo-pro-dim__list li {
	font-size: 0.8rem;
	line-height: 1.5;
}
.aeo-pro-note {
	color: #15803d;
}
.aeo-pro-suggestion {
	color: #92400e;
}

@media (prefers-color-scheme: dark) {
	.aeo-pro-note       { color: #86efac; }
	.aeo-pro-suggestion { color: #fcd34d; }
}

/* ── Priority improvements ─────────────────────────────────────────────────── */

.aeo-pro-improvements {
	margin-top: 1.5rem;
	background: var(--aeo-surface-alt, #f9fafb);
	border: 1px solid var(--aeo-border, #e5e7eb);
	border-radius: 8px;
	padding: 1rem 1.25rem;
}

.aeo-pro-improvements:not([hidden]) {
	display: block !important;
}

.aeo-pro-improvements h3,
.aeo-pro-improvements .aeo-section-title {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aeo-muted, #6b7280);
	margin: 0 0 0.75rem;
}

.aeo-pro-improvements__list {
	margin: 0;
	padding-left: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.aeo-pro-improvements__list li {
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--aeo-text, #18181b);
}
.aeo-pro-improvements__list li strong {
	color: var(--aeo-muted, #6b7280);
	font-weight: 500;
}

/* ── PDF / export section ───────────────────────────────────────────────────── */

.aeo-pro-export {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--aeo-border, rgba(26, 23, 20, 0.08));
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: flex-end;
}

.aeo-pro-export__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex: 1 1 280px;
}

.aeo-pro-export__field {
	flex: 1 1 140px;
}

.aeo-pro-export__label {
	display: block;
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--aeo-muted, #6b7280);
	margin-bottom: 0.25rem;
	letter-spacing: 0.03em;
}

.aeo-pro-export .aeo-input {
	font-size: 0.82rem;
}

.aeo-btn--export-pdf {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: #1a3a2a;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 500;
	padding: 0.55rem 1.1rem;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, transform 0.1s;
	flex-shrink: 0;
}
.aeo-btn--export-pdf:hover  { background: #2d6b4a; }
.aeo-btn--export-pdf:active { transform: scale(0.97); }
.aeo-btn--export-pdf:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
}

.aeo-btn--export-pdf::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}

/* ── Daily limit upsell (error panel) ───────────────────────────────────────── */

.aeo-pro-upsell {
	display: none;
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-top: 1rem;
	align-items: flex-start;
	gap: 0.75rem;
}
.aeo-pro-upsell.is-visible {
	display: flex;
}
.aeo-pro-upsell__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	background: #22c55e;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	margin-top: 1px;
}
.aeo-pro-upsell__body {
	flex: 1;
}
.aeo-pro-upsell__title {
	font-size: 0.9rem;
	font-weight: 600;
	color: #15803d;
	margin-bottom: 0.25rem;
}
.aeo-pro-upsell__text {
	font-size: 0.82rem;
	color: #166534;
	line-height: 1.5;
}
.aeo-pro-upsell__link {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: #15803d;
	text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
	.aeo-pro-upsell {
		background: #052e16;
		border-color: #166534;
	}
	.aeo-pro-upsell__title { color: #86efac; }
	.aeo-pro-upsell__text  { color: #bbf7d0; }
	.aeo-pro-upsell__link  { color: #86efac; }
}

/* ── Token status ───────────────────────────────────────────────────────────── */

.aeo-pro-token-status {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.75rem;
	margin-top: 0.35rem;
	min-height: 1.2rem;
}
.aeo-pro-token-status--ok  { color: #15803d; }
.aeo-pro-token-status--err { color: #b91c1c; }
.aeo-pro-token-status--checking { color: var(--aeo-muted, #6b7280); }

.aeo-pro-token-status__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
}
.aeo-pro-token-status--ok  .aeo-pro-token-status__dot { background: #22c55e; }
.aeo-pro-token-status--err .aeo-pro-token-status__dot { background: #ef4444; }
.aeo-pro-token-status--checking .aeo-pro-token-status__dot { background: #d1d5db; }

/* ── Funnel dialogs (limit / agency) ───────────────────────────────────────── */

.aeo-funnel-dialog {
	max-width: min(420px, 92vw);
	width: 100%;
	padding: 0;
	border: none;
	border-radius: var(--radius-lg, 12px);
	box-shadow: 0 24px 48px rgba(26, 23, 20, 0.18);
	background: #fff;
	color: var(--ink, #1a1714);
}

.aeo-funnel-dialog::backdrop {
	background: rgba(26, 23, 20, 0.45);
}

.aeo-funnel-dialog__inner {
	position: relative;
	padding: 28px 24px 24px;
}

.aeo-funnel-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: var(--ink-soft, #6b5f55);
	border-radius: var(--radius, 6px);
}

.aeo-funnel-dialog__close:hover {
	color: var(--ink, #1a1714);
	background: var(--cream-mid, #ede6d8);
}

.aeo-funnel-dialog__title {
	font-family: var(--display, inherit);
	font-size: 22px;
	letter-spacing: 0.06em;
	margin: 0 32px 14px 0;
	line-height: 1.2;
}

.aeo-funnel-dialog__body {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink-mid, #3d3530);
}

.aeo-funnel-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

@media (max-width: 540px) {
	.aeo-pro-export {
		flex-direction: column;
		align-items: stretch;
	}
	.aeo-btn--export-pdf {
		width: 100%;
		justify-content: center;
	}
}
