/* Actualway World Map — frontend styles */

.awm-map-wrapper {
	--awm-bg:        #ffffff;
	--awm-dot:       #1FB8AA;
	--awm-c-hq:      #1B4FA0;
	--awm-c-europe:  #1FB8AA;
	--awm-c-asia:    #E8632B;
	--awm-c-africa:  #D33B3B;
	--awm-c-america: #7C5DA8;
	--awm-c-oceania: #1FB8AA;

	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	background: var(--awm-bg);
}

.awm-map {
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 1;
}

/* SVG dotted background.
 * Default: dots inherit `--awm-dot` color and use the per-dot fill-opacity baked
 * into the SVG (varied 0.18 — 1.0) to mimic the PDF's textured look.
 * Hover/active: dots animate smoothly to full opacity while keeping their color.
 */
.awm-map-bg {
	position: absolute;
	inset: 0;
	color: var(--awm-dot);
	pointer-events: none;
}

.awm-map-bg svg,
.awm-map-bg .awm-svg {
	width: 100%;
	height: 100%;
	display: block;
}

.awm-map-bg .awm-dots circle {
	transition: fill-opacity 0.6s ease;
}

/* Solid state — dots all become fully opaque (still green). */
.awm-map.is-hovering .awm-map-bg .awm-dots circle {
	fill-opacity: 1 !important;
}

/* Pin layer */
.awm-pins {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.awm-pin {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 22px;
	height: 22px;
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	pointer-events: auto;
	color: var(--awm-c-europe);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.awm-pin:focus {
	outline: none;
}

.awm-pin:focus-visible .awm-pin-dot {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 0 5px currentColor;
}

.awm-pin--hq      { color: var(--awm-c-hq); }
.awm-pin--europe  { color: var(--awm-c-europe); }
.awm-pin--asia    { color: var(--awm-c-asia); }
.awm-pin--africa  { color: var(--awm-c-africa); }
.awm-pin--america { color: var(--awm-c-america); }
.awm-pin--oceania { color: var(--awm-c-oceania); }

.awm-pin-dot {
	position: relative;
	z-index: 2;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 2px var(--awm-bg), 0 1px 4px rgba(0, 0, 0, 0.25);
	transition: transform 0.25s ease;
}

.awm-pin:hover .awm-pin-dot,
.awm-pin.is-active .awm-pin-dot {
	transform: scale(1.35);
}

/* HQ pin is slightly bigger */
.awm-pin--hq .awm-pin-dot {
	width: 12px;
	height: 12px;
}

.awm-pin-pulse {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
	animation: awm-pulse 2.2s ease-out infinite;
	z-index: 1;
	pointer-events: none;
}

.awm-pin--hq .awm-pin-pulse {
	width: 12px;
	height: 12px;
}

@keyframes awm-pulse {
	0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.55; }
	70%  { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
	100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.awm-pin-pulse { animation: none; opacity: 0; }
	.awm-map-bg, .awm-map-bg .awm-dots circle, .awm-pin-dot { transition: none; }
}

/* Tooltip */
.awm-tooltip {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, calc(-100% - 14px));
	min-width: 120px;
	max-width: 220px;
	background: #fff;
	color: #1f2933;
	padding: 8px 12px;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
	font-size: 13px;
	line-height: 1.35;
	pointer-events: none;
	z-index: 10;
	opacity: 0;
	transition: opacity 0.18s ease;
	text-align: center;
	border-top: 3px solid currentColor;
}

.awm-tooltip[data-visible="true"] {
	opacity: 1;
}

.awm-tooltip::after {
	content: "";
	position: absolute;
	bottom: -7px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 7px solid #fff;
}

.awm-tooltip strong { display: block; font-weight: 600; color: inherit; }
.awm-tooltip .awm-tooltip-cont {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	margin-top: 2px;
}
.awm-tooltip .awm-tooltip-desc { display: block; margin-top: 4px; color: #4b5563; }
.awm-tooltip .awm-tooltip-cont:empty,
.awm-tooltip .awm-tooltip-desc:empty { display: none; }

/* Tooltip color follows the active continent */
.awm-tooltip[data-continent="hq"]      { color: var(--awm-c-hq); }
.awm-tooltip[data-continent="europe"]  { color: var(--awm-c-europe); }
.awm-tooltip[data-continent="asia"]    { color: var(--awm-c-asia); }
.awm-tooltip[data-continent="africa"]  { color: var(--awm-c-africa); }
.awm-tooltip[data-continent="america"] { color: var(--awm-c-america); }
.awm-tooltip[data-continent="oceania"] { color: var(--awm-c-oceania); }

/* Small screens — keep aspect ratio but allow horizontal scroll if too tight */
@media (max-width: 480px) {
	.awm-pin { width: 18px; height: 18px; }
	.awm-pin-dot, .awm-pin-pulse { width: 8px; height: 8px; }
	.awm-pin--hq .awm-pin-dot, .awm-pin--hq .awm-pin-pulse { width: 10px; height: 10px; }
}
