/**
 * Admin styles for Live Visitor Geo Pulse.
 * Uses only native WordPress and WooCommerce design tokens.
 */

/* Stats summary row */

.lvgp-stats-summary {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: 16px 0 24px;
}

.lvgp-stat {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-top: 4px solid var(--wp-admin-theme-color, #3858e9);
	padding: 20px 16px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.lvgp-stat__label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #646970;
}

.lvgp-stat__value {
	margin: 0 0 6px;
	font-size: 36px;
	font-weight: 400;
	line-height: 1;
	color: #1d2327;
}

.lvgp-stat__desc {
	margin: 0;
	font-size: 12px;
	color: #646970;
}

/* Content + sidebar two-column grid */

.lvgp-content-grid {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 16px;
	align-items: start;
}

/* Progress meter */

.lvgp-meter {
	height: 8px;
	background: #f0f0f1;
	border-radius: 2px;
	overflow: hidden;
	margin: 6px 0 8px;
}

.lvgp-meter__fill {
	display: block;
	height: 100%;
	background: var(--wp-admin-theme-color, #3858e9);
	border-radius: inherit;
}

/* Country table */

.lvgp-country-table td {
	vertical-align: middle;
}

.lvgp-country-table .lvgp-meter {
	width: 100%;
	margin: 4px 0 0;
}

.lvgp-rank {
	font-size: 11px;
	color: #646970;
	font-weight: 600;
}

/* Device mix rows */

.lvgp-device-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f1;
}

.lvgp-device-row:last-child {
	border-bottom: none;
}

.lvgp-device-row__label {
	font-size: 13px;
	color: #1d2327;
}

.lvgp-device-row__count {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.lvgp-device-row__share {
	font-size: 11px;
	color: #646970;
	margin-left: 4px;
}

/* Secondary postbox (simulation) */
.lvgp-postbox--secondary .postbox-header .hndle {
	font-size: 13px;
}

.lvgp-postbox--secondary .postbox-header .title-count {
	font-size: 11px;
}

/* Postbox sidebar stacking */

.lvgp-sidebar .postbox-header,
.devlin-geo-pulse-dashboard .postbox-header {
	padding-left: 16px;
}

.lvgp-sidebar > .postbox {
	margin-bottom: 0;
}

.lvgp-sidebar > .postbox + .postbox {
	margin-top: 16px;
}

/* Simulation panel */

.lvgp-simulation-field {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0;
}

.lvgp-simulation-field input[type="number"] {
	width: 80px;
}

.lvgp-simulation-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

/* Live pulse dot */

.lvgp-pulse-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #00a32a;
	vertical-align: middle;
	margin-right: 4px;
	animation: lvgp-pulse 1.8s infinite;
}

@keyframes lvgp-pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lvgp-pulse-dot {
		animation: none;
	}
}

/* Responsive */

@media (max-width: 1199px) {
	.lvgp-stats-summary {
		grid-template-columns: repeat(2, 1fr);
	}

	.lvgp-content-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 782px) {
	.lvgp-stats-summary {
		grid-template-columns: 1fr;
	}

	.lvgp-widget-stats {
		flex-direction: column;
	}
}

/* Dashboard widget */

.lvgp-widget-stats {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.lvgp-widget-stat {
	flex: 1;
	text-align: center;
	padding: 12px 8px;
	background: #f9f9f9;
	border: 1px solid #f0f0f1;
}

.lvgp-widget-stat__value {
	display: block;
	font-size: 28px;
	font-weight: 400;
	color: #1d2327;
	line-height: 1.2;
}

.lvgp-widget-stat__label {
	display: block;
	font-size: 11px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 4px;
}

.lvgp-widget-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 8px 0 0;
	font-size: 13px;
}

.lvgp-widget-freshness {
	font-size: 12px;
	color: #646970;
}

.lvgp-widget-empty {
	text-align: center;
	margin: 0 0 8px;
}

/* Getting started guide */

.lvgp-guide {
	padding: 12px 16px;
	margin-top: 16px;
}

.lvgp-guide h3 {
	margin: 4px 0 8px;
	font-size: 14px;
}

.lvgp-guide ul {
	margin: 8px 0 8px 16px;
	list-style: disc;
}

.lvgp-guide li {
	margin-bottom: 6px;
}

/* How It Works sidebar list */

.lvgp-how-list {
	margin: 4px 0 8px 16px;
}

.lvgp-how-list li {
	margin-bottom: 8px;
	font-size: 13px;
}
