/* --- 1. GLOBAL & LAYOUT --- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden !important;
	font-family: "Inter", sans-serif;
	background-color: #096ae9;
}

#map {
	position: fixed !important;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 125vh !important;
	height: 125dvh !important;
	background-image: url("images/world_img.webp");
	filter: brightness(0.9) contrast(1.5) saturate(1.8);
	background-color: rgba(73, 73, 68, 0.141);
	background-blend-mode: multiply;
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	z-index: 1;
}

/* --- 2. LEAFLET & MAP UI --- */
.leaflet-overlay-pane {
	z-index: 10 !important;
}

.leaflet-tile-container {
	background: transparent !important;
	will-change: transform;
	pointer-events: none;
}

.leaflet-zoom-animated {
	backface-visibility: hidden;
}

.leaflet-interactive {
	transition:
		fill 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		fill-opacity 0.4s ease,
		stroke 0.4s ease;
	outline: none;
}

/* Clean, non-blurred country labels */
.leaflet-tooltip {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: #ffffff !important;
	font-weight: 600 !important;
	font-size: 0.8rem !important;
	text-transform: uppercase;
	letter-spacing: 0.5px;

	/* THE FIX: Remove the blurring shadow */
	text-shadow: none !important;

	/* Ensure no white background peek-through */
	white-space: nowrap;
}

/* Remove the 'beak' arrow that Leaflet adds by default */
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	display: none !important;
}
/* 
.country-label {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: white !important;
	font-weight: 600;
	font-size: 11px;
	pointer-events: none;
	display: none;
}

.zoom-active .country-label {
	display: block;
} */

#hoverBox {
	position: fixed;
	background: rgba(15, 23, 42, 0.6);
	color: white;
	padding: 8px 14px;
	border-radius: 8px;
	backdrop-filter: blur(8px) saturate(180%);
	-webkit-backdrop-filter: blur(8px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
	pointer-events: none;
	display: none;
	z-index: 20;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* --- 3. TOP NAVIGATION & GLASS UI --- */

.central-header-wrapper {
	position: fixed;
	top: 85px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	pointer-events: none;
	text-align: center;
	width: 100%;
}

.main-site-title {
	margin: 0;
	font-size: 2.2rem;
	font-weight: 300;
	letter-spacing: 12px;
	color: rgba(255, 255, 255, 0.6);
	text-transform: uppercase;
	text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
}

.main-site-subtitle {
	margin-top: 10px;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 8px;
	color: rgba(255, 255, 255, 0.582);
	text-transform: uppercase;
}

/* --- FIXED LEGEND BUTTON --- */
.legend-btn {
	position: fixed;
	bottom: 2rem;
	left: 2rem;
	z-index: 9999;

	/* Shape & Color */
	background: rgba(3, 74, 228, 0.9);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #ffffff;

	/* The Fix: Vertical (10px) and Horizontal (22px) padding */
	padding: 10px 32px;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.4);

	/* Typography & Alignment */
	display: flex; /* Ensures text centers perfectly */
	align-items: center;
	justify-content: center;
	font-family: "Inter", sans-serif;

	font-weight: 400; /* Made slightly bolder to match your site's style */
	font-size: 0.8rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;

	/* Shadow & Interaction */
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.legend-btn:hover {
	transform: scale(1.05);
	background: rgba(3, 74, 228, 1);
	box-shadow: 0 8px 15px rgba(214, 213, 213, 0.2);
}

/* --- THE POP-UP CONTENT (Upward Dropdown) --- */
.mobile-legend-content {
	display: none;
	position: absolute;
	bottom: 125%; /* Sits above the button */
	left: 0;
	min-width: 220px;

	background: rgba(255, 255, 255, 0.1) !important;
	backdrop-filter: blur(12px) saturate(180%);
	-webkit-backdrop-filter: blur(12px) saturate(180%);

	border-radius: 12px;
	border: 1px solid rgba(240, 238, 127, 0.3);
	box-shadow: 0 8px 15px rgba(214, 213, 213, 0.2);
	overflow: hidden;
}

/* Show State */
.mobile-legend-content.show {
	display: block;
	animation: slideUp 0.3s ease-out;
}

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

/* --- ROWS --- */
.legend-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	color: white;
	font-size: 0.8rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.color-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- 3. RESPONSIVE MEDIA QUERIES --- */

/* --- DESKTOP (min-width: 1101px) --- */
@media (min-width: 1101px) {
	.menu-toggle {
		position: absolute;
		right: 2rem;
		top: 2rem;
		transform: scale(1);
		padding: 5px;
		z-index: 200;
	}

	.bar {
		width: 35px;
		height: 4px;
		margin: 6px 0;
	}

	.glass-nav {
		top: 2rem;
		left: 1.5rem;
	}
}

/* --- ALL TABLET & MOBILE --- */
@media (max-width: 1400px) and (min-width: 1100px) {
	.map-overlay .main-title,
	.map-overlay .subtitle,
	.glass-nav {
		display: none !important;
	}

	.mobile-utility-links {
		padding-bottom: 40px;
	}

	.menu-toggle {
		position: absolute;
		right: 2rem;
		top: 2rem;
		transform: scale(1);
		padding: 5px;
		z-index: 200;
	}

	.bar {
		width: 35px;
		height: 4px;
		margin: 6px 0;
	}

	#translator-anchor {
		width: 240px;
		top: 2rem;
		left: 2rem;
	}
}

/* --- STRICT TABLET (768px to 1100px) --- */
@media (max-width: 1100px) and (min-width: 760px) {
	.main-site-title {
		font-size: 2.4rem; /* Specific scale-up for high-res tablet */
		letter-spacing: 10px;
		top: 75px;
	}

	.main-site-subtitle {
		font-size: 1rem;
		letter-spacing: 6px;
		margin-top: 8px;
		opacity: 0.9;
	}

	.menu-toggle {
		position: absolute;
		right: 2rem;
		top: 2rem;
		transform: scale(1);
		padding: 5px;
		z-index: 200;
	}

	.bar {
		width: 35px;
		height: 4px;
		margin: 6px 0;
	}
}

/* --- MOBILE (max-width: 768px) --- */
@media (max-width: 760px) {
	body {
		background-image: url("images/world_img_mobile.webp");
		background-size: cover;
		background-attachment: fixed;
	}

	.main-site-title {
		font-size: 1.2rem;
		letter-spacing: 6px;
		top: 60px;
	}

	.desktop-only {
		display: none !important;
	}

	.central-header-wrapper {
		top: auto;
		bottom: 80px; /* Moves header to bottom on mobile */
		left: 50%;
		transform: translateX(-50%);
		width: 90%;
	}

	.main-site-title {
		font-size: 1rem;
		letter-spacing: 5px;
		font-weight: 500;
	}

	.main-site-subtitle {
		font-size: 0.55rem;
		letter-spacing: 3px;
		margin-top: 4px;
	}
}
