/**
 * Admin Styles for Specflux Marketing Analytics Chat
 *
 * @package Marketing_Analytics_MCP
 */

/* ============================================
   Design Tokens
   ============================================ */
:root {
	/* Colors - WP 6.x standard */
	--smac-primary: #2271b1;
	--smac-primary-hover: #135e96;
	--smac-success: #00a32a;
	--smac-success-bg: #d5f2e0;
	--smac-warning: #dba617;
	--smac-warning-bg: #f0e9d2;
	--smac-error: #d63638;
	--smac-error-bg: #fcf0f1;

	/* Text */
	--smac-text-primary: #1d2327;
	--smac-text-secondary: #646970;
	--smac-text-muted: #a7aaad;

	/* Borders & surfaces */
	--smac-border: #c3c4c7;
	--smac-surface: #fff;
	--smac-surface-alt: #f6f7f7;
	--smac-surface-hover: #f0f0f1;

	/* Spacing */
	--smac-space-xs: 4px;
	--smac-space-sm: 8px;
	--smac-space-md: 12px;
	--smac-space-base: 16px;
	--smac-space-lg: 20px;
	--smac-space-xl: 24px;
	--smac-space-section: 30px;

	/* Shadows */
	--smac-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	--smac-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.1);

	/* Transitions */
	--smac-transition: 0.2s ease;
}

/* ============================================
   Shared Components
   ============================================ */

/* Toggle Switch */
.switch {
	position: relative;
	display: inline-block;
	width: 60px;
	height: 34px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: 0.4s;
}

.slider:before {
	position: absolute;
	content: "";
	height: 26px;
	width: 26px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	transition: 0.4s;
}

input:checked + .slider {
	background-color: var(--smac-primary);
}

input:checked + .slider:before {
	transform: translateX(26px);
}

.slider.round {
	border-radius: 34px;
}

.slider.round:before {
	border-radius: 50%;
}

/* Stat Card */
.stat-card {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: var(--smac-space-lg);
	min-width: 150px;
}

.stat-card h3 {
	margin-top: 0;
	color: var(--smac-text-primary);
	font-size: 14px;
	font-weight: 600;
}

.stat-value {
	font-size: 32px;
	font-weight: 600;
	color: var(--smac-primary);
	margin: 10px 0;
}

.stat-label {
	color: var(--smac-text-secondary);
	font-size: 12px;
	text-transform: uppercase;
}

/* Stat Grid (unified container for all stat cards) */
.smac-stats-grid,
.ai-usage-stats,
.anomaly-stats,
.network-stats {
	display: flex;
	gap: var(--smac-space-lg);
	margin: var(--smac-space-lg) 0;
	flex-wrap: wrap;
}

/* Severity Stat Card Colors */
.stat-card.severity-critical .stat-value {
	color: var(--smac-error);
}

.stat-card.severity-high .stat-value {
	color: #e65100;
}

.stat-card.severity-medium .stat-value {
	color: #996800;
}

.stat-card.severity-low .stat-value {
	color: var(--smac-success);
}

/* Anomaly Type Badges */
.anomaly-type {
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
}

.anomaly-spike {
	background-color: #ffebe9;
	color: var(--smac-error);
}

.anomaly-drop {
	background-color: #e9f5ff;
	color: var(--smac-primary);
}

/* Anomaly Severity Badges */
.anomaly-severity {
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
}

.severity-critical {
	background-color: var(--smac-error);
	color: #fff;
}

.severity-high {
	background-color: #e65100;
	color: #fff;
}

.severity-medium {
	background-color: #dba617;
	color: var(--smac-text-primary);
}

.severity-low {
	background-color: var(--smac-success);
	color: #fff;
}

/* Modal */
.smac-modal,
.modal {
	position: fixed;
	z-index: 100000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.4);
}

.smac-modal-content,
.modal-content {
	background-color: var(--smac-surface);
	margin: 5% auto;
	padding: var(--smac-space-lg);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	width: 60%;
	max-width: 600px;
}

.modal .close {
	color: var(--smac-text-muted);
	float: right;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
}

.modal .close:hover,
.modal .close:focus {
	color: var(--smac-text-primary);
}

/* DataForSEO / Credit Balance Display */
.credit-balance-display {
	background: var(--smac-surface-alt);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: 15px;
	margin: var(--smac-space-lg) 0;
}

.balance-info {
	font-size: 24px;
	margin: 10px 0;
}

.balance-amount {
	font-weight: bold;
	color: var(--smac-primary-hover);
}

.balance-info.low-balance .balance-amount {
	color: var(--smac-error);
}

.low-balance-warning {
	color: var(--smac-error);
	font-size: 14px;
	margin-left: 10px;
}

.usage-stats {
	margin-top: 10px;
	font-size: 14px;
}

.api-info {
	background: var(--smac-surface-hover);
	border-left: 4px solid var(--smac-primary);
	padding: 12px;
	margin: var(--smac-space-lg) 0;
}

.api-info h5 {
	margin-top: 0;
	margin-bottom: 10px;
}

.api-info ul {
	margin-left: 20px;
	list-style-type: disc;
}

.api-info ul li {
	margin: 5px 0;
}

/* Status Badge Variants for Heading Context */
.connection-panel h3 .status-badge {
	vertical-align: middle;
	margin-left: 8px;
}

.status-badge.connected {
	background: var(--smac-success-bg);
	color: var(--smac-success);
}

.status-badge.disconnected {
	background: var(--smac-warning-bg);
	color: #996800;
}

.status-badge.error {
	background: var(--smac-error-bg);
	color: var(--smac-error);
}

/* Heading badge style - solid background */
.status-badge.heading-connected {
	background: var(--smac-success);
	color: white;
	padding: 4px 12px;
	border-radius: 3px;
	font-size: 13px;
	font-weight: normal;
}

.status-badge.heading-connected .dashicons {
	font-size: 14px;
	margin-top: 2px;
}

.status-badge.heading-disconnected {
	background: var(--smac-error);
	color: white;
	padding: 4px 12px;
	border-radius: 3px;
	font-size: 13px;
	font-weight: normal;
}

.status-badge.heading-disconnected .dashicons {
	font-size: 14px;
	margin-top: 2px;
}

/* Description color helpers */
.description.success {
	color: var(--smac-success);
}

.description.error {
	color: var(--smac-error);
}

/* Site status indicators */
.site-status-active {
	color: var(--smac-success);
}

.site-status-inactive {
	color: var(--smac-error);
}

/* Widget heading */
.smac-widget-heading {
	margin: 0 0 10px 0;
	font-size: 13px;
	text-transform: uppercase;
	color: var(--smac-text-secondary);
}

/* Widget section spacing */
.smac-widget-section + .smac-widget-section {
	margin-top: 16px;
}

/* Widget footer actions */
.smac-widget-footer {
	margin-top: 10px;
	text-align: right;
}

/* Notification status helpers */
.notification-status-sent {
	color: var(--smac-success);
}

.notification-status-failed {
	color: var(--smac-error);
}

/* Dashboard Layout */
.specflux-marketing-analytics-chat-dashboard {
	max-width: 1200px;
}

.smac-welcome {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-left: 4px solid var(--smac-primary);
	padding: var(--smac-space-lg);
	margin: var(--smac-space-section) 0;
}

.smac-welcome h2 {
	margin-top: 0;
}

/* Quick Action Cards */
.smac-quick-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 20px;
	margin: 30px 0;
}

.quick-action-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 20px;
	display: flex;
	align-items: flex-start;
	gap: 15px;
	transition: box-shadow 0.2s;
}

.quick-action-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-action-icon {
	font-size: 40px;
	color: #2271b1;
	flex-shrink: 0;
}

.quick-action-icon .dashicons {
	width: 40px;
	height: 40px;
	font-size: 40px;
}

.quick-action-content {
	flex: 1;
}

.quick-action-content h3 {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 600;
}

.quick-action-content p {
	margin: 0 0 12px 0;
	color: #646970;
	font-size: 13px;
}

/* Status Cards */
.smac-status-cards {
	margin: 30px 0;
}

.status-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	margin-top: 15px;
}

.status-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 20px;
	text-align: center;
	transition: box-shadow 0.2s;
}

.status-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-card.connected {
	border-left: 4px solid #00a32a;
}

.status-card.disconnected {
	border-left: 4px solid #dba617;
}

.status-icon {
	font-size: 48px;
	color: #2271b1;
	margin-bottom: 10px;
}

.status-card h4 {
	margin: 10px 0;
	font-size: 16px;
}

.status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.status-description {
	color: #646970;
	font-size: 13px;
	margin: 10px 0;
}

/* MCP Configuration */
.specflux-marketing-analytics-chat-info {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin: 30px 0;
}

.mcp-endpoint-box {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 15px 0;
}

.mcp-endpoint {
	flex: 1;
	padding: 10px 15px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	font-family: monospace;
	font-size: 13px;
	word-break: break-all;
}

.copy-endpoint {
	white-space: nowrap;
}

/* Getting Started */
.smac-getting-started {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin: 30px 0;
}

.smac-getting-started h3 {
	margin-top: 0;
}

.smac-getting-started ol {
	margin-left: 20px;
}

.smac-getting-started li {
	margin-bottom: 15px;
	line-height: 1.6;
}

/* Advanced Section */
.smac-advanced {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin: 30px 0;
}

.smac-advanced details {
	cursor: pointer;
}

.smac-advanced summary {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 10px;
}

.smac-advanced summary::-webkit-details-marker {
	display: none;
}

.smac-advanced summary::before {
	content: '\25B6';
	font-size: 12px;
	color: #646970;
	transition: transform 0.2s;
}

.smac-advanced details[open] summary::before {
	transform: rotate(90deg);
}

.smac-advanced summary h3 {
	margin: 0;
	display: inline;
	font-size: 16px;
}

.smac-advanced details[open] {
	padding-bottom: 10px;
}

/* Connections Page */
.specflux-marketing-analytics-chat-connections .nav-tab-wrapper {
	margin: 20px 0;
}

.connection-panel {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin-top: 20px;
}

.connection-panel h3 {
	margin-top: 0;
}

.connection-panel .form-table {
	margin-top: 20px;
}

/* Settings Page */
.specflux-marketing-analytics-chat-settings h2 {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #c3c4c7;
}

.specflux-marketing-analytics-chat-settings h2:first-of-type {
	border-top: none;
	padding-top: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
	.smac-quick-actions {
		grid-template-columns: 1fr;
	}

	.status-cards-grid {
		grid-template-columns: 1fr;
	}

	.mcp-endpoint-box {
		flex-direction: column;
		align-items: stretch;
	}

	.copy-endpoint {
		width: 100%;
	}
}

/* Notices and alerts */
.smac-notice {
	margin: 15px 0;
}

/* Loading states */
.testing-connection {
	opacity: 0.6;
	pointer-events: none;
}

.connection-status-indicator {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 5px;
}

.connection-status-indicator.success {
	background: #00a32a;
}

.connection-status-indicator.error {
	background: #d63638;
}

.connection-status-indicator.pending {
	background: #dba617;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.specflux-marketing-analytics-chat-prompts-container .chat{
	max-width: 100%;
}

.specflux-marketing-analytics-chat-prompts-container .card {
	padding: 20px;
}

.specflux-marketing-analytics-chat-prompts-container table th {
	font-weight: 600;
}

.specflux-marketing-analytics-chat-prompts-container .button-link-delete {
	color: #b32d2e;
}

.specflux-marketing-analytics-chat-prompts-container .button-link-delete:hover {
	color: #d63638;
}

.specflux-marketing-analytics-chat-prompts-container textarea.code {
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
}

/* Dashboard Widget */
.smac-widget {
	padding: 5px 0;
}

.smac-widget-section {
	padding: 0;
}

.smac-widget-platforms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.smac-widget-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.smac-widget-badge.connected {
	background: #d5f2e0;
	color: #00a32a;
}

.smac-widget-badge.disconnected {
	background: #f0f0f1;
	color: #646970;
}

.smac-widget-severity {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	margin-right: 6px;
}

.smac-widget-severity.critical {
	background: var(--smac-error-bg);
	color: var(--smac-error);
}

.smac-widget-severity.high {
	background: #fef3eb;
	color: #e65100;
}

.smac-widget-severity.medium {
	background: #fef8e7;
	color: #996800;
}

.smac-widget-severity.low {
	background: #f0f6fc;
	color: #2271b1;
}

.smac-refresh-widget .dashicons.spin {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* ============================================
   Onboarding Wizard
   ============================================ */

.smac-wizard {
	position: relative;
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: var(--smac-space-xl);
	margin: var(--smac-space-section) 0;
	box-shadow: var(--smac-shadow);
	overflow: hidden;
}

/* Skip Setup Link */
.smac-wizard-skip {
	position: absolute;
	top: var(--smac-space-base);
	right: var(--smac-space-lg);
	color: var(--smac-text-muted);
	font-size: 13px;
	text-decoration: none;
	transition: color var(--smac-transition);
}

.smac-wizard-skip:hover {
	color: var(--smac-text-secondary);
}

/* Progress Bar */
.smac-wizard-progress {
	position: relative;
	background: var(--smac-surface-alt);
	height: 4px;
	border-radius: 2px;
	margin-bottom: var(--smac-space-xl);
}

.smac-wizard-progress-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: var(--smac-primary);
	border-radius: 2px;
	width: 0;
	transition: width 0.4s ease;
}

/* Step Dots */
.smac-wizard-steps-indicator {
	display: flex;
	justify-content: space-between;
	position: relative;
	top: -14px;
	margin-bottom: -14px;
}

.smac-wizard-step-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--smac-surface-alt);
	border: 2px solid var(--smac-border);
	color: var(--smac-text-muted);
	font-size: 12px;
	font-weight: 600;
	transition: all var(--smac-transition);
}

.smac-wizard-step-dot.active {
	background: var(--smac-primary);
	border-color: var(--smac-primary);
	color: var(--smac-surface);
}

.smac-wizard-step-dot.completed {
	background: var(--smac-success);
	border-color: var(--smac-success);
	color: var(--smac-surface);
}

/* Wizard Steps */
.smac-wizard-step {
	display: none;
}

.smac-wizard-step.active {
	display: block;
	animation: macWizardFadeIn 0.3s ease;
}

@keyframes macWizardFadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.smac-wizard-step-content {
	text-align: center;
	max-width: 700px;
	margin: 0 auto;
	padding: var(--smac-space-lg) 0;
}

.smac-wizard-step-content h2 {
	margin: 0 0 var(--smac-space-md) 0;
	color: var(--smac-text-primary);
	font-size: 22px;
}

.smac-wizard-step-icon {
	margin-bottom: var(--smac-space-base);
}

.smac-wizard-step-icon .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--smac-primary);
}

.smac-wizard-success-icon .dashicons {
	color: var(--smac-success);
}

.smac-wizard-step-description {
	color: var(--smac-text-secondary);
	font-size: 14px;
	line-height: 1.6;
	margin: 0 0 var(--smac-space-sm) 0;
}

.smac-wizard-step-subtitle {
	color: var(--smac-text-muted);
	font-size: 13px;
	font-style: italic;
	margin: 0 0 var(--smac-space-xl) 0;
}

/* Step Actions (Navigation Buttons) */
.smac-wizard-step-actions {
	display: flex;
	justify-content: center;
	gap: var(--smac-space-md);
	margin-top: var(--smac-space-xl);
}

/* Platform Cards (Step 2) */
.smac-wizard-platform-cards {
	display: flex;
	flex-direction: column;
	gap: var(--smac-space-md);
	margin: var(--smac-space-xl) 0;
	text-align: left;
}

.smac-wizard-platform-card {
	display: flex;
	align-items: center;
	gap: var(--smac-space-base);
	padding: var(--smac-space-base);
	background: var(--smac-surface-alt);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	transition: box-shadow var(--smac-transition);
}

.smac-wizard-platform-card:hover {
	box-shadow: var(--smac-shadow-hover);
}

.smac-wizard-platform-card.connected {
	border-left: 4px solid var(--smac-success);
}

.smac-wizard-platform-icon .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--smac-primary);
}

.smac-wizard-platform-info {
	flex: 1;
}

.smac-wizard-platform-info h3 {
	margin: 0 0 var(--smac-space-xs) 0;
	font-size: 14px;
	color: var(--smac-text-primary);
}

.smac-wizard-platform-info p {
	margin: 0;
	font-size: 13px;
	color: var(--smac-text-secondary);
}

.smac-wizard-platform-status {
	flex-shrink: 0;
}

.smac-wizard-connected-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--smac-space-xs);
	color: var(--smac-success);
	font-size: 13px;
	font-weight: 600;
}

.smac-wizard-connected-badge .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Action Cards (Step 3) */
.smac-wizard-action-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--smac-space-base);
	margin: var(--smac-space-xl) 0;
	text-align: center;
}

.smac-wizard-action-card {
	display: block;
	padding: var(--smac-space-lg);
	background: var(--smac-surface-alt);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	text-decoration: none;
	color: var(--smac-text-primary);
	transition: all var(--smac-transition);
}

.smac-wizard-action-card:hover {
	box-shadow: var(--smac-shadow-hover);
	border-color: var(--smac-primary);
	color: var(--smac-text-primary);
}

.smac-wizard-action-card .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: var(--smac-primary);
	margin-bottom: var(--smac-space-sm);
}

.smac-wizard-action-card h3 {
	margin: 0 0 var(--smac-space-xs) 0;
	font-size: 14px;
	font-weight: 600;
}

.smac-wizard-action-card p {
	margin: 0;
	font-size: 13px;
	color: var(--smac-text-secondary);
}

/* Or Section (Step 3) */
.smac-wizard-or-section {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--smac-space-md);
	margin: var(--smac-space-lg) 0 0 0;
	color: var(--smac-text-muted);
	font-size: 13px;
}

/* Final Links (Step 4) */
.smac-wizard-final-links {
	display: flex;
	justify-content: center;
	gap: var(--smac-space-lg);
	margin: var(--smac-space-xl) 0;
}

.smac-wizard-final-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--smac-space-sm);
	padding: var(--smac-space-base);
	background: var(--smac-surface-alt);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	text-decoration: none;
	color: var(--smac-text-primary);
	min-width: 100px;
	transition: all var(--smac-transition);
}

.smac-wizard-final-link:hover {
	box-shadow: var(--smac-shadow-hover);
	border-color: var(--smac-primary);
	color: var(--smac-text-primary);
}

.smac-wizard-final-link .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: var(--smac-primary);
}

.smac-wizard-final-link span:last-child {
	font-size: 13px;
	font-weight: 600;
}

/* Responsive Wizard */
@media screen and (max-width: 768px) {
	.smac-wizard-action-cards {
		grid-template-columns: 1fr;
	}

	.smac-wizard-final-links {
		flex-wrap: wrap;
	}

	.smac-wizard-final-link {
		min-width: 80px;
		flex: 1;
	}

	.smac-wizard-platform-card {
		flex-wrap: wrap;
	}

	.smac-wizard-skip {
		position: static;
		display: block;
		text-align: right;
		margin-bottom: var(--smac-space-sm);
	}
}

/* ============================================
   Quick Analysis Buttons (Dashboard)
   ============================================ */

.smac-quick-analysis-buttons {
	display: flex;
	gap: var(--smac-space-sm);
	flex-wrap: wrap;
}

.smac-quick-analysis-buttons .button {
	white-space: nowrap;
}

/* ============================================
   Admin Bar Analytics Pulse
   ============================================ */

#wp-admin-bar-specflux-mac-pulse .smac-pulse-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 4px;
	vertical-align: middle;
}

#wp-admin-bar-specflux-mac-pulse .smac-pulse-dot.healthy {
	background-color: var(--smac-success);
}

#wp-admin-bar-specflux-mac-pulse .smac-pulse-dot.warning {
	background-color: var(--smac-warning);
}

#wp-admin-bar-specflux-mac-pulse .smac-pulse-dot.critical {
	background-color: var(--smac-error);
}

#wp-admin-bar-specflux-mac-pulse .smac-anomaly-badge {
	display: inline-block;
	background: var(--smac-error);
	color: #fff;
	font-size: 9px;
	font-weight: 600;
	line-height: 16px;
	min-width: 16px;
	height: 16px;
	text-align: center;
	border-radius: 8px;
	padding: 0 4px;
	margin-left: 4px;
	vertical-align: middle;
}

#wp-admin-bar-specflux-mac-pulse .smac-bar-severity {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	margin-right: 4px;
}

#wp-admin-bar-specflux-mac-pulse .smac-bar-severity-critical {
	background: var(--smac-error);
	color: #fff;
}

#wp-admin-bar-specflux-mac-pulse .smac-bar-severity-high {
	background: #e65100;
	color: #fff;
}

#wp-admin-bar-specflux-mac-pulse .smac-bar-severity-medium {
	background: var(--smac-warning);
	color: var(--smac-text-primary);
}

#wp-admin-bar-specflux-mac-pulse .smac-bar-severity-low {
	background: var(--smac-success);
	color: #fff;
}

#wp-admin-bar-specflux-mac-pulse .ab-submenu .ab-item {
	height: auto !important;
	line-height: 1.4 !important;
	padding: 6px 10px !important;
}

/* ============================================
   Insights Panel — Analytics at a Glance
   ============================================ */

.smac-insights-panel {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: var(--smac-space-lg);
	margin: var(--smac-space-section) 0;
	box-shadow: var(--smac-shadow);
}

.smac-insights-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--smac-space-lg);
}

.smac-insights-header h3 {
	margin: 0;
	font-size: 16px;
	color: var(--smac-text-primary);
}

.smac-insights-refresh {
	display: inline-flex;
	align-items: center;
	gap: var(--smac-space-xs);
}

.smac-insights-refresh .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.smac-insights-refresh.updating-message .dashicons {
	animation: spin 1s linear infinite;
}

/* Metric Cards Grid */
.smac-insights-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--smac-space-base);
}

.smac-metric-card {
	background: var(--smac-surface-alt);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: var(--smac-space-base);
	display: flex;
	flex-direction: column;
	gap: var(--smac-space-xs);
	transition: box-shadow var(--smac-transition);
}

.smac-metric-card:hover {
	box-shadow: var(--smac-shadow-hover);
}

.smac-metric-platform {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--smac-primary);
}

.smac-metric-label {
	font-size: 12px;
	color: var(--smac-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.smac-metric-value {
	font-size: 28px;
	font-weight: 600;
	color: var(--smac-text-primary);
	line-height: 1.2;
}

.smac-metric-change {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	width: fit-content;
}

.smac-metric-change.positive {
	background: var(--smac-success-bg);
	color: var(--smac-success);
}

.smac-metric-change.negative {
	background: var(--smac-error-bg);
	color: var(--smac-error);
}

.smac-metric-change.neutral {
	background: var(--smac-surface-hover);
	color: var(--smac-text-secondary);
}

/* Sparkline Container */
.smac-sparkline {
	margin-top: var(--smac-space-xs);
	line-height: 0;
}

/* Empty State */
.smac-insights-empty {
	text-align: center;
	padding: var(--smac-space-xl) var(--smac-space-base);
	color: var(--smac-text-secondary);
}

.smac-insights-empty .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--smac-text-muted);
	margin-bottom: var(--smac-space-md);
}

.smac-insights-empty p {
	margin: 0;
	font-size: 14px;
}

/* Responsive: stack to 1 column on mobile */
@media screen and (max-width: 768px) {
	.smac-insights-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================
   Connection Depth Prompt
   ============================================ */

.smac-connection-prompt {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-left: 4px solid var(--smac-primary);
	border-radius: 4px;
	padding: var(--smac-space-lg);
	margin: var(--smac-space-section) 0;
	box-shadow: var(--smac-shadow);
}

.smac-connection-prompt-header {
	display: flex;
	align-items: center;
	gap: var(--smac-space-sm);
	margin-bottom: var(--smac-space-md);
}

.smac-connection-prompt-header .dashicons {
	color: var(--smac-primary);
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.smac-connection-prompt-header h3 {
	margin: 0;
	font-size: 15px;
	color: var(--smac-text-primary);
}

.smac-connection-prompt-progress {
	display: flex;
	align-items: center;
	gap: var(--smac-space-md);
	margin-bottom: var(--smac-space-md);
}

.smac-connection-prompt-bar {
	flex: 1;
	height: 6px;
	background: var(--smac-surface-alt);
	border-radius: 3px;
	overflow: hidden;
}

.smac-connection-prompt-fill {
	height: 100%;
	background: var(--smac-primary);
	border-radius: 3px;
	transition: width 0.4s ease;
}

.smac-connection-prompt-count {
	font-size: 12px;
	color: var(--smac-text-secondary);
	white-space: nowrap;
}

.smac-connection-prompt-message {
	margin: 0 0 var(--smac-space-base) 0;
	color: var(--smac-text-secondary);
	font-size: 13px;
	line-height: 1.5;
}

.smac-connection-prompt .button-primary {
	display: inline-flex;
	align-items: center;
	gap: var(--smac-space-xs);
}

.smac-connection-prompt .button-primary .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

/* ============================================
   Abilities Catalog
   ============================================ */

.smac-abilities-catalog {
	max-width: 1200px;
}

.smac-abilities-catalog > .description {
	font-size: 14px;
	margin-bottom: var(--smac-space-lg);
}

/* Filter Button Group */
.smac-abilities-filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--smac-space-sm);
	margin: var(--smac-space-lg) 0;
}

.smac-abilities-filter-btn {
	padding: 6px 16px;
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-radius: 20px;
	color: var(--smac-text-secondary);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--smac-transition);
}

.smac-abilities-filter-btn:hover {
	border-color: var(--smac-primary);
	color: var(--smac-primary);
}

.smac-abilities-filter-btn.active {
	background: var(--smac-primary);
	border-color: var(--smac-primary);
	color: #fff;
}

/* Abilities Grid */
.smac-abilities-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--smac-space-lg);
	margin: var(--smac-space-lg) 0;
}

/* Ability Card */
.smac-ability-card {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-radius: 4px;
	padding: var(--smac-space-lg);
	transition: box-shadow var(--smac-transition), border-color var(--smac-transition);
	display: flex;
	flex-direction: column;
}

.smac-ability-card:hover {
	box-shadow: var(--smac-shadow-hover);
	border-color: var(--smac-primary);
}

.smac-ability-icon {
	margin-bottom: var(--smac-space-md);
}

.smac-ability-icon .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--smac-primary);
}

.smac-ability-card h3 {
	margin: 0 0 var(--smac-space-sm) 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--smac-text-primary);
}

.smac-ability-card p {
	margin: 0 0 var(--smac-space-base) 0;
	font-size: 13px;
	color: var(--smac-text-secondary);
	line-height: 1.5;
	flex: 1;
}

/* Ability Meta (status badge + slug) */
.smac-ability-meta {
	display: flex;
	align-items: center;
	gap: var(--smac-space-sm);
	flex-wrap: wrap;
	border-top: 1px solid var(--smac-surface-alt);
	padding-top: var(--smac-space-md);
	margin-top: auto;
}

.smac-ability-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.smac-ability-status.free {
	background: var(--smac-success-bg);
	color: var(--smac-success);
}

.smac-ability-status.premium {
	background: #f0e9ff;
	color: #7b2dde;
}

.smac-ability-meta code {
	font-size: 11px;
	color: var(--smac-text-muted);
	background: var(--smac-surface-alt);
	padding: 2px 6px;
	border-radius: 3px;
}

/* MCP Info Section */
.smac-abilities-mcp-info {
	background: var(--smac-surface);
	border: 1px solid var(--smac-border);
	border-left: 4px solid var(--smac-primary);
	border-radius: 4px;
	padding: var(--smac-space-lg);
	margin: var(--smac-space-section) 0;
}

.smac-abilities-mcp-info h3 {
	margin: 0 0 var(--smac-space-sm) 0;
	font-size: 16px;
	color: var(--smac-text-primary);
}

.smac-abilities-mcp-info p {
	margin: 0 0 var(--smac-space-md) 0;
	color: var(--smac-text-secondary);
	font-size: 13px;
}

/* Responsive Abilities Grid */
@media screen and (max-width: 768px) {
	.smac-abilities-grid {
		grid-template-columns: 1fr;
	}

	.smac-abilities-filter {
		flex-wrap: wrap;
	}
}

