/**
 * AP XHR Simulator styles (scoped).
 */

.ap-xhr-simulator {
	--ap-xhr-bg: #0b0f14;
	--ap-xhr-surface: #111826;
	--ap-xhr-surface-2: #172238;
	--ap-xhr-border: rgba(130, 153, 181, 0.25);
	--ap-xhr-text: #dfeaff;
	--ap-xhr-muted: #8da2bf;
	--ap-xhr-cyan: #24e0ff;
	--ap-xhr-green: #2ff7a8;
	--ap-xhr-red: #ff6b7a;
	--ap-xhr-shadow: 0 20px 55px rgba(0, 0, 0, 0.42);

	max-width: 940px;
	margin: 1.8rem auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ap-xhr-card {
	background:
		radial-gradient(circle at 0% 0%, rgba(36, 224, 255, 0.09), transparent 35%),
		radial-gradient(circle at 100% 100%, rgba(47, 247, 168, 0.08), transparent 35%),
		var(--ap-xhr-bg);
	border: 1px solid var(--ap-xhr-border);
	border-radius: 14px;
	padding: clamp(1rem, 2.8vw, 1.55rem);
	box-shadow: var(--ap-xhr-shadow);
	color: var(--ap-xhr-text);
}

.ap-xhr-title {
	margin: 0 0 0.35rem;
	font-size: clamp(1.15rem, 2.6vw, 1.45rem);
	letter-spacing: 0.01em;
}

.ap-xhr-subtitle {
	margin: 0 0 1rem;
	color: var(--ap-xhr-muted);
	font-size: 0.9rem;
}

.ap-xhr-actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.7rem;
	margin-bottom: 1rem;
}

@media (min-width: 760px) {
	.ap-xhr-actions {
		grid-template-columns: 1fr 1fr;
	}
}

.ap-xhr-btn {
	appearance: none;
	border: 1px solid var(--ap-xhr-border);
	border-radius: 10px;
	background: var(--ap-xhr-surface);
	color: var(--ap-xhr-text);
	padding: 0.7rem 0.85rem;
	font-size: 0.88rem;
	line-height: 1.35;
	cursor: pointer;
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ap-xhr-btn:hover {
	transform: translateY(-1px);
}

.ap-xhr-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.ap-xhr-btn--dom:hover {
	border-color: rgba(255, 107, 122, 0.75);
	box-shadow: 0 8px 20px rgba(255, 107, 122, 0.2);
}

.ap-xhr-btn--xhr:hover {
	border-color: rgba(47, 247, 168, 0.75);
	box-shadow: 0 8px 20px rgba(47, 247, 168, 0.2);
}

.ap-xhr-progress-wrap {
	background: var(--ap-xhr-surface);
	border: 1px solid var(--ap-xhr-border);
	border-radius: 10px;
	padding: 0.8rem;
	margin-bottom: 0.9rem;
}

.ap-xhr-progress-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.8rem;
	font-size: 0.82rem;
	color: var(--ap-xhr-muted);
	margin-bottom: 0.5rem;
}

.ap-xhr-progress-label strong {
	color: var(--ap-xhr-cyan);
}

.ap-xhr-progress {
	height: 11px;
	border-radius: 999px;
	background: #0a1220;
	border: 1px solid rgba(141, 162, 191, 0.25);
	overflow: hidden;
}

.ap-xhr-progress-bar {
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--ap-xhr-cyan), var(--ap-xhr-green));
	transition: width 0.28s cubic-bezier(0.2, 0.85, 0.3, 1);
	box-shadow: 0 0 16px rgba(36, 224, 255, 0.35);
}

.ap-xhr-metrics {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.45rem;
	margin-bottom: 0.9rem;
	font-size: 0.84rem;
}

@media (min-width: 640px) {
	.ap-xhr-metrics {
		grid-template-columns: 1fr 1fr;
	}
}

.ap-xhr-metrics > div {
	display: flex;
	justify-content: space-between;
	gap: 0.7rem;
	padding: 0.55rem 0.65rem;
	background: var(--ap-xhr-surface-2);
	border: 1px solid var(--ap-xhr-border);
	border-radius: 8px;
}

.ap-xhr-metrics span {
	color: var(--ap-xhr-muted);
}

.ap-xhr-json {
	margin: 0 0 0.95rem;
	padding: 0.8rem;
	min-height: 124px;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 0.82rem;
	line-height: 1.45;
	background: #0a1220;
	border: 1px solid rgba(141, 162, 191, 0.25);
	border-radius: 10px;
	color: #bfe8ff;
}

.ap-xhr-conclusion {
	padding: 0.8rem 0.9rem;
	border-radius: 10px;
	border: 1px solid rgba(47, 247, 168, 0.35);
	background: linear-gradient(180deg, rgba(47, 247, 168, 0.14), rgba(47, 247, 168, 0.06));
	font-size: 0.85rem;
	line-height: 1.5;
	color: #d9fff0;
}

