/**
 * ShopPanel Globe 3D Map Styles
 */

/* Full page layout for globe map page */
body.admin_page_shoppanel-globe-map #wpbody-content,
body.toplevel_page_shoppanel-globe-map #wpbody-content {
	margin: 0;
	padding: 0;
	position: fixed;
	top: 32px;
	left: 260px;
	right: 0;
	bottom: 0;
	width: calc(100% - 260px);
	height: calc(100vh - 32px);
	overflow: hidden;
}

body.admin_page_shoppanel-globe-map .shoppanel-globe-map-page,
body.toplevel_page_shoppanel-globe-map .shoppanel-globe-map-page {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	position: relative;
}

body.admin_page_shoppanel-globe-map .shoppanel-globe-map-header,
body.toplevel_page_shoppanel-globe-map .shoppanel-globe-map-header {
	display: none;
}

body.admin_page_shoppanel-globe-map #wpbody-content .wrap,
body.toplevel_page_shoppanel-globe-map #wpbody-content .wrap {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
}

body.admin_page_shoppanel-globe-map #wpfooter,
body.toplevel_page_shoppanel-globe-map #wpfooter {
	display: none;
}

/* Globe Container */
.shoppanel-globe-section {
	margin: 0;
	padding: 0;
	position: relative;
	width: 100%;
	height: 100%;
}

.shoppanel-globe-container {
	position: relative;
	width: 100%;
	height: 100%;
	background: #0f0f1a;
	background-image: 
		/* Stars effect */
		radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.4), transparent),
		radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.3), transparent),
		radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.5), transparent),
		radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.4), transparent),
		radial-gradient(2px 2px at 90% 50%, rgba(255, 255, 255, 0.3), transparent),
		radial-gradient(1px 1px at 33% 60%, rgba(255, 255, 255, 0.4), transparent),
		radial-gradient(1px 1px at 15% 80%, rgba(255, 255, 255, 0.3), transparent),
		radial-gradient(1px 1px at 70% 20%, rgba(255, 255, 255, 0.4), transparent),
		radial-gradient(1px 1px at 40% 90%, rgba(255, 255, 255, 0.3), transparent),
		/* Space gradient */
		radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.06) 40%, transparent 70%),
		/* Deep space - lighter */
		linear-gradient(135deg, rgba(15, 15, 30, 0.6) 0%, rgba(10, 10, 25, 0.7) 100%);
	background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%, 100% 100%, 100% 100%;
	border-radius: 0;
	overflow: hidden;
	box-shadow: none;
}

#shoppanel-globe-container {
	width: 100%;
	height: 100%;
	position: relative;
}

#shoppanel-globe-container .mapboxgl-canvas {
	display: block;
	width: 100%;
	height: 100%;
	/*filter: contrast(0.9) brightness(0.7) saturate(0.4) grayscale(0.1);*/
	position: relative;
	z-index: 2;
}

/* Add subtle glow effect to map (aura) */
/*
.shoppanel-globe-container::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	height: 100%;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.08) 30%, rgba(99, 102, 241, 0.04) 50%, transparent 75%);
	pointer-events: none;
	z-index: 1;
	border-radius: 12px;
	animation: pulse-glow 6s ease-in-out infinite;
}*/

@keyframes pulse-glow {
	0%, 100% {
		opacity: 0.3;
		transform: translate(-50%, -50%) scale(1);
	}
	50% {
		opacity: 0.5;
		transform: translate(-50%, -50%) scale(1.02);
	}
}

/* Mapbox popup styling */
.shoppanel-map-popup {
	padding: 8px;
	color: #ffffff;
	font-size: 13px;
	line-height: 1.5;
}

.shoppanel-map-popup-city {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 4px;
	color: #ffffff;
}

.shoppanel-map-popup-country {
	color: #a7aaad;
	margin-bottom: 4px;
	font-size: 12px;
}

.shoppanel-map-popup-count {
	color: #ffffff;
	font-weight: 600;
	margin-bottom: 4px;
}

.shoppanel-map-popup-value {
	color: #6366f1;
	font-weight: 600;
	font-size: 14px;
}

/* Custom Mapbox popup styles */
.mapboxgl-popup-content {
	background: rgba(26, 26, 26, 0.95) !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: 8px !important;
	padding: 0 !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.mapboxgl-popup-tip {
	border-top-color: rgba(26, 26, 26, 0.95) !important;
}

.mapboxgl-popup-close-button {
	color: #ffffff !important;
	font-size: 20px !important;
	padding: 4px 8px !important;
}

.mapboxgl-popup-close-button:hover {
	color: #a7aaad !important;
}

/* Period Selector */
.shoppanel-globe-period-selector {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 10;
}

#shoppanel-period-select {
	background-color: rgba(26, 26, 26, 0.85) !important;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 16px !important;
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: 8px !important;
	padding: 5px 40px 5px 16px !important;
	color: #ffffff !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	outline: none !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	min-width: 200px;
	transition: all 0.2s ease;
}

.shoppanel-period-select::-ms-expand {
	display: none !important;
}

.shoppanel-period-select::-webkit-select {
	background-color: rgba(26, 26, 26, 0.85) !important;
	color: #ffffff !important;
}

.shoppanel-period-select:hover,
.shoppanel-period-select:active,
.shoppanel-period-select:focus,
.shoppanel-period-select:focus-visible {
	background-color: rgba(26, 26, 26, 0.95) !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
	color: #ffffff !important;
	outline: none !important;
}

.shoppanel-period-select:focus {
	background-color: rgba(26, 26, 26, 0.85) !important;
	border-color: rgba(255, 255, 255, 0.2) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
	color: #ffffff !important;
}

.shoppanel-period-select option {
	background: #1a1a1a !important;
	color: #ffffff !important;
	padding: 10px;
	font-size: 14px;
	font-weight: 400;
}

.shoppanel-period-select option:hover,
.shoppanel-period-select option:checked {
	background: rgba(26, 26, 26, 0.95) !important;
	color: #ffffff !important;
}

/* Stats Panel */
.shoppanel-globe-stats {
	position: absolute;
	top: 20px;
	left: 20px;
	background: rgba(26, 26, 26, 0.85);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 16px;
	min-width: 280px;
	z-index: 10;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shoppanel-globe-stats-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shoppanel-globe-stats-title {
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.shoppanel-globe-stats-badge {
	background: #0066cc;
	color: #ffffff;
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.5;
		transform: scale(0.95);
	}
}

.shoppanel-globe-stats-content {
	color: #ffffff;
}

.shoppanel-globe-stat-item {
	margin-bottom: 12px;
}

.shoppanel-globe-stat-item:last-child {
	margin-bottom: 0;
}

.shoppanel-globe-stat-label {
	font-size: 12px;
	color: #a7aaad;
	margin-bottom: 4px;
	display: block;
}

.shoppanel-globe-stat-value {
	font-size: 20px;
	font-weight: 600;
	color: #ffffff;
}

.shoppanel-stat-countries {
	margin-top: 12px;
}

.shoppanel-stat-country {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	font-size: 12px;
	color: #ffffff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shoppanel-stat-country:last-child {
	border-bottom: none;
}

.shoppanel-stat-country-flag {
	font-size: 16px;
	width: 20px;
	text-align: center;
}

.shoppanel-stat-country-name {
	flex: 1;
	color: #ffffff;
}

.shoppanel-stat-country-count {
	color: #a7aaad;
	font-weight: 600;
}

/* Activity Feed */
.shoppanel-globe-activity {
	position: absolute;
	bottom: 20px;
	left: 20px;
	background: rgba(26, 26, 26, 0.85);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 16px;
	width: 320px;
	max-height: 300px;
	z-index: 10;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	overflow-y: auto;
}

.shoppanel-globe-activity-header {
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shoppanel-activity-feed {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shoppanel-activity-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	opacity: 0;
	transform: translateY(10px);
	transition: all 0.3s ease;
}

.shoppanel-activity-item-visible {
	opacity: 1;
	transform: translateY(0);
}

.shoppanel-activity-icon {
	color: #0066cc;
	font-size: 8px;
	margin-top: 6px;
	flex-shrink: 0;
}

.shoppanel-activity-text {
	flex: 1;
	font-size: 12px;
	color: #ffffff;
	line-height: 1.4;
}

.shoppanel-activity-ago {
	font-size: 11px;
	color: #a7aaad;
	flex-shrink: 0;
	margin-left: auto;
}

/* Globe Controls */
.shoppanel-globe-controls {
	position: absolute;
	bottom: 20px;
	right: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 10;
}

.shoppanel-globe-control-btn {
	background: rgba(26, 26, 26, 0.85);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	cursor: pointer;
	transition: all 0.2s ease;
}

.shoppanel-globe-control-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}

.shoppanel-globe-control-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Loading State */
.shoppanel-globe-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #ffffff;
	font-size: 14px;
	z-index: 5;
}

.shoppanel-globe-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: shoppanel-spin 0.8s linear infinite;
	margin-left: 8px;
	vertical-align: middle;
}

.shoppanel-globe-loading.shoppanel-loading-error::after {
	display: none;
}

@keyframes shoppanel-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Responsive */
@media (max-width: 1200px) {
	.shoppanel-globe-stats {
		min-width: 240px;
	}

	.shoppanel-globe-activity {
		width: 280px;
		max-height: 250px;
	}
}

@media (max-width: 782px) {
	.shoppanel-globe-container {
		height: 400px;
	}

	.shoppanel-globe-stats {
		position: relative;
		top: auto;
		left: auto;
		margin-bottom: 12px;
		min-width: auto;
		width: 100%;
	}

	.shoppanel-globe-activity {
		position: relative;
		bottom: auto;
		left: auto;
		width: 100%;
		max-height: 200px;
		margin-top: 12px;
	}

	.shoppanel-globe-controls {
		position: relative;
		bottom: auto;
		right: auto;
		flex-direction: row;
		margin-top: 12px;
		justify-content: center;
	}
}

/* Scrollbar for activity feed */
.shoppanel-globe-activity::-webkit-scrollbar {
	width: 6px;
}

.shoppanel-globe-activity::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 3px;
}

.shoppanel-globe-activity::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 3px;
}

.shoppanel-globe-activity::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

