/**
 * AI Native Badge styles for WP Agent Shared.
 *
 * Floating badge + expandable info panel. The z-index (999990) is kept below
 * the chat widget (999999) so the chat toggle stays on top when both exist.
 *
 * @package WP_Agent_Shared
 * @since   1.2.0
 */

.wpas-ai-badge {
	position: fixed;
	z-index: 999990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* Positions. bottom-right sits above the chat widget toggle (56px + 24px margin). */
.wpas-ai-badge-bottom-right {
	right: 24px;
	bottom: 90px;
}

.wpas-ai-badge-bottom-left {
	left: 24px;
	bottom: 24px;
}

/* Pill. */
.wpas-badge-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 999px;
	background: linear-gradient( 135deg, #6366f1 0%, #8b5cf6 100% );
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.2px;
	box-shadow: 0 4px 14px rgba( 99, 102, 241, 0.35 );
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}

.wpas-ai-badge:hover .wpas-badge-pill {
	transform: translateY( -1px );
	box-shadow: 0 6px 18px rgba( 99, 102, 241, 0.45 );
}

.wpas-ai-badge:focus-visible {
	outline: 2px solid #6366f1;
	outline-offset: 3px;
	border-radius: 999px;
}

.wpas-badge-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.wpas-badge-text {
	pointer-events: none;
}

/* Panel. */
.wpas-badge-panel {
	display: none;
	position: absolute;
	bottom: calc( 100% + 10px );
	width: 300px;
	max-width: calc( 100vw - 48px );
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.15 );
	overflow: hidden;
	border: 1px solid rgba( 0, 0, 0, 0.06 );
}

.wpas-ai-badge-bottom-right .wpas-badge-panel {
	right: 0;
}

.wpas-ai-badge-bottom-left .wpas-badge-panel {
	left: 0;
}

.wpas-badge-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient( 135deg, #6366f1 0%, #8b5cf6 100% );
	color: #fff;
}

.wpas-badge-panel-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.wpas-badge-panel-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.wpas-badge-panel-close:hover {
	opacity: 1;
}

.wpas-badge-panel-body {
	padding: 14px 16px 16px;
}

.wpas-badge-panel-desc {
	margin: 0 0 6px;
	font-size: 13px;
	color: #6b7280;
	font-weight: 500;
}

.wpas-badge-panel-caps {
	margin: 0 0 14px;
	padding-left: 18px;
	font-size: 13px;
	color: #374151;
	line-height: 1.8;
}

.wpas-badge-panel-caps li {
	margin: 0;
}

.wpas-badge-panel-mcp {
	margin-bottom: 14px;
	font-size: 12px;
}

.wpas-badge-panel-label {
	color: #6b7280;
	font-weight: 500;
}

.wpas-badge-panel-endpoint {
	display: block;
	margin-top: 4px;
	padding: 6px 8px;
	background: #f3f4f6;
	border-radius: 6px;
	font-size: 11px;
	color: #4b5563;
	word-break: break-all;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.wpas-badge-panel-link {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 8px;
	background: #6366f1;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: background 0.2s ease;
}

.wpas-badge-panel-link:hover {
	background: #4f46e5;
	color: #fff;
}

/* Mobile responsive. */
@media ( max-width: 480px ) {
	.wpas-ai-badge-bottom-right {
		right: 16px;
		bottom: 84px;
	}

	.wpas-ai-badge-bottom-left {
		left: 16px;
		bottom: 16px;
	}

	.wpas-badge-pill {
		padding: 6px 12px;
		font-size: 12px;
	}

	.wpas-badge-panel {
		width: calc( 100vw - 32px );
	}
}
