/**
 * Global Presence Stats Section Styles
 * Statistics counter and interactive world map
 *
 * @package Eryvium
 * @since Eryvium 1.0.0
 */

/* ============================================
   STATS SECTION
   ============================================ */

.global-presence-stats {
	position: relative;
	padding: clamp(80px, 12vw, 160px) 0 0;
	background: linear-gradient(180deg, #FFFFFF 0%, #CCE3FB 100%);
	overflow: visible;
}

.global-presence-stats__container {
	width: 100%;
	max-width: var(--container-max-width);
	margin: 0 auto;
	padding: 0 var(--container-padding);
}

/* Stats Counter */
.stats-counter {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	max-width: 1300px;
	margin: 0 auto;
	padding: 44px;
	background: var(--color-pure-white);
	border-radius: var(--border-radius-lg);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stats-counter__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
	gap: 14px;
}

.stats-counter__divider {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 60px;
	width: 1px;
	background-color: rgba(79, 100, 120, 0.14);
}

.stats-counter__value {
	display: flex;
	align-items: baseline;
	justify-content: center;
}

.stats-counter__number,
.global-presence-stats .stats-counter__number {
	font-family: var(--font-heading), 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
	font-size: 60px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	color: #07B3F1 !important;
}

.stats-counter__suffix,
.global-presence-stats .stats-counter__suffix {
	font-family: var(--font-heading), 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
	font-size: 60px !important;
	font-weight: 500 !important;
	line-height: 1.2 !important;
	color: #07B3F1 !important;
}

.stats-counter__label,
.global-presence-stats .stats-counter__label {
	font-family: var(--font-heading), 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
	font-size: 24px !important;
	font-weight: 500 !important;
	line-height: 1.5 !important;
	color: #4F6478 !important;
	text-align: center;
}

/* ============================================
   WORLD MAP CONTAINER
   ============================================ */

.world-map-container {
	position: relative;
	width: 100%;
	margin-top: 40px;
	overflow: visible;
	display: flex;
	align-items: flex-end;
	min-height: 60vh;
}

.world-map {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	object-position: bottom;
}

/* ============================================
   MAP PINS
   ============================================ */

.map-pin {
	position: absolute;
	transform: translate(-50%, -100%);
	cursor: pointer;
	z-index: 5;
	transition: transform 0.3s ease;
}

.map-pin.tooltip-z-index {
	z-index: 50;
}

.map-pin:hover {
	transform: translate(-50%, -100%) scale(1.1);
}

.map-pin__icon {
	width: 60px;
	height: 60px;
	display: block;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)) brightness(0);
	transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
	position: relative;
	z-index: 1;
	opacity: 1;
}

.map-pin-icon {
	z-index: -1 !important;
	position: relative;
	opacity: 1 !important;
	filter: brightness(0) !important;
	transition: z-index 0.3s ease;
}

.map-pin:hover .map-pin__icon {
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Desktop Pin Positioning - можно настроить позиции для каждого пина */
@media (min-width: 769px) {
	.map-pin[data-pin-index="0"] {
		/* Africa */
		top: 60% !important;
		left: 52% !important;
	}
	
	.map-pin[data-pin-index="1"] {
		/* Asia */
		top: 40% !important;
		left: 70% !important;
	}
	
	.map-pin[data-pin-index="2"] {
		/* Europe */
		top: 28% !important;
		left: 49% !important;
	}
}

/* Tooltip */
.map-pin__tooltip {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
	pointer-events: none;
	z-index: 100;
	width: min(557px, calc(100vw - 80px));
	white-space: normal;
}

.map-tooltip {
	z-index: 50 !important;
	position: absolute;
}

.map-pin:hover .map-pin__tooltip,
.map-pin.active .map-pin__tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.map-pin__tooltip-content {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(236, 244, 255, 0.65) 100%);
	border-radius: var(--border-radius-lg);
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: 0 25px 65px rgba(15, 33, 55, 0.18);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 44px;
	position: relative;
}

.map-pin__tooltip-content::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 8px solid rgba(255, 255, 255, 0.9);
}

.map-pin__title {
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-text-primary);
	margin: 0 0 12px 0;
}

.map-pin__description {
	font-family: var(--font-family-body);
	font-size: clamp(14px, 1.1vw, 16px);
	line-height: 1.6;
	color: #4F6478;
	margin: 0 0 20px 0;
}

.map-pin__items {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.map-pin__item {
	display: flex;
	flex-direction: column;
}

.map-pin__item-heading {
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-text-primary);
	margin: 0 0 4px 0;
}

.map-pin__item-text {
	font-family: var(--font-family-body);
	font-size: 14px;
	line-height: 1.5;
	color: #4F6478;
	margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
	/* Add bottom padding to section */
	.global-presence-stats {
		padding-bottom: clamp(60px, 8vw, 120px);
	}
	
	.stats-counter {
		padding: 32px 24px;
	}
	
	.stats-counter__number,
	.stats-counter__suffix,
	.global-presence-stats .stats-counter__number,
	.global-presence-stats .stats-counter__suffix {
		font-size: 48px;
		color: #07B3F1;
	}
	
	.stats-counter__suffix,
	.global-presence-stats .stats-counter__suffix {
		font-size: 48px !important;
	}
	
	.stats-counter__label,
	.global-presence-stats .stats-counter__label {
		font-size: 16px !important;
		color: #4F6478;
	}
	
	/* Hide map and pins on tablets and below */
	.world-map {
		display: none;
	}
	
	.map-pin__icon {
		display: none;
	}
	
	/* Make world map container a static grid layout */
	.world-map-container {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 24px;
		min-height: auto;
		padding: 0;
		max-width: var(--container-max-width);
		margin: 40px auto 0;
		align-items: stretch;
	}
	
	/* Make pins static containers */
	.map-pin {
		position: static;
		transform: none;
		cursor: default;
		z-index: auto;
		height: 100%;
		display: flex;
		flex-direction: column;
	}
	
	.map-pin.tooltip-z-index {
		z-index: auto;
	}
	
	.map-pin:hover {
		transform: none;
	}
	
	/* Make tooltips visible and static */
	.map-pin__tooltip {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		pointer-events: auto;
		width: 100%;
		max-width: none;
		min-width: auto;
		z-index: auto;
		height: 100%;
		display: flex;
		flex-direction: column;
	}
	
	.map-tooltip {
		z-index: auto !important;
		position: static;
		height: 100%;
		display: flex;
		flex-direction: column;
	}
	
	.map-pin:hover .map-pin__tooltip,
	.map-pin.active .map-pin__tooltip {
		transform: none;
	}
	
	.map-pin__tooltip-content {
		height: 100%;
		flex: 1;
		display: flex;
		flex-direction: column;
	}
	
	.map-pin__tooltip-content::after {
		display: none;
	}
	
	.map-pin__items {
		grid-template-columns: 1fr;
		gap: 12px;
	}
}

@media (max-width: 768px) {
	.global-presence-stats__container {
		width: 100%;
		max-width: var(--container-max-width);
		margin: 0 auto;
		padding: 0;
	}
	
	.global-presence-page {
		overflow-x: hidden;
	}
	
	.global-presence-stats {
		padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 6vw, 80px);
		overflow-x: hidden;
	}
	
	.stats-counter {
		flex-direction: column;
		gap: 32px;
		padding: 32px 20px;
	}
	
	.stats-counter__divider {
		display: none;
	}
	
	.stats-counter__item {
		width: 100%;
		padding-bottom: 32px;
		border-bottom: 1px solid rgba(79, 100, 120, 0.14);
		gap: 10px;
	}
	
	.stats-counter__item:last-child {
		border-bottom: none;
		padding-bottom: 0;
	}
	
	.stats-counter__number,
	.stats-counter__suffix,
	.global-presence-stats .stats-counter__number,
	.global-presence-stats .stats-counter__suffix {
		font-size: 40px;
		color: #07B3F1;
	}
	
	.stats-counter__label,
	.global-presence-stats .stats-counter__label {
		font-size: 16px;
		color: #4F6478;
	}
	
	/* Mobile: single column layout for cards */
	.world-map-container {
		display: grid;
		grid-template-columns: 1fr;
		gap: 20px;
		margin-top: 40px;
		overflow: visible;
		width: 100%;
		max-width: 100%;
		padding: 0 var(--container-padding);
		min-height: auto;
	}
	
	.world-map {
		display: none;
	}
	
	.map-pin__icon {
		display: none;
	}
	
	.map-pin {
		position: static;
		transform: none;
		height: auto;
		display: block;
	}
	
	.map-pin__tooltip {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		width: 100%;
		max-width: none;
		min-width: auto;
		height: auto;
		display: block;
	}
	
	.map-tooltip {
		position: static;
		z-index: auto !important;
		height: auto;
		display: block;
	}
	
	.map-pin__tooltip-content {
		height: auto;
		display: block;
	}
	
	.map-pin__tooltip-content::after {
		display: none;
	}
}

@media (max-width: 456px) {
	.global-presence-page {
		overflow-x: hidden;
		width: 100%;
		max-width: 100vw;
	}
	
	.global-presence-stats {
		overflow-x: hidden;
		width: 100%;
		max-width: 100vw;
	}
	
	.world-map-container {
		overflow-x: hidden;
		width: 100%;
		max-width: 100vw;
	}
	
	.main-navigation {
		width: 100vw !important;
		max-width: 100vw !important;
	}
}

@media (max-width: 320px) {
	.global-presence-stats__container {
		width: 100%;
		max-width: var(--container-max-width);
		margin: 0 auto;
		padding: 14px;
	}
	
	.global-presence-page {
		overflow-x: hidden !important;
		width: 100%;
		max-width: 100vw;
	}
	
	.global-presence-stats {
		overflow-x: hidden !important;
		width: 100%;
		max-width: 100vw;
	}
	
	.world-map-container {
		overflow-x: hidden !important;
		width: 100%;
		max-width: 100vw;
	}
	
	.main-navigation {
		width: 100vw !important;
		max-width: 100vw !important;
		right: -100vw !important;
	}
	
	.main-navigation.active {
		right: 0 !important;
	}
}

