/*
 * Always set the map height explicitly to define the size of the div element
 * that contains the map.
 */
#map {
	height: 100%;
}
.spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid white;
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin-right: 5px;
	vertical-align: middle;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}
/* The popup bubble styling. */
.popup-bubble {
	/* Position the bubble centred-above its parent. */
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: start;
	position: absolute;
	top: 0;
	left: 0;
	transform: translate(-50%, -100%);
	/* Style the bubble. */
	background-color: white;
	border-radius: 15px;
	font-family: sans-serif;
	overflow-y: auto;
	max-height: 500px;
	box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.5);
}
.popup-lower {
	display: flex;
	width: 100%;
	flex-direction: row;
	justify-content: space-between;
	font-size: 0.82rem;
	gap: 10px;
}
.leader-infos {
	display: flex;
	flex-direction: column;
	align-items: start;
	padding: 10px;
}
.popup-bubble .leader-name {
	font-weight: bold;
	color: #222222;
	font-size: 0.93rem;
	text-transform: capitalize;
}
.popup-bubble .city-name {
	color: #6a6a6a;
	font-size: 0.93rem;
}
.popup-bubble p {
	text-align: center;
}
/* The parent of the bubble. A zero-height div at the top of the tip. */
.popup-bubble-anchor {
	/* Position the div a fixed distance above the tip. */

	position: absolute;
	width: 100%;
	bottom: 8px;
	left: 0;
}

/* JavaScript will position this div at the bottom of the popup tip. */
.popup-container {
	cursor: auto;
	height: 0;
	position: absolute;
	/* The max width of the info window. */
	width: 327px;
}

.leader-btn {
	margin: 5px;
	color: white;
	cursor: pointer;
	font-weight: bold;
	font-size: 12px;
	padding: 5px;
	border: none;
	border-radius: 30px;
	background-color: #4e8098;
	height: fit-content;
}

.close-popup {
	cursor: pointer;
	font-weight: bold;
	position: absolute;
	color: #575757;
	background-color: #ecececec;
	padding: 6px;
	height: 15px;
	width: 15px;
	display: flex;
	justify-content: center;
	align-items: center;
	border: 1px solid #575757;
	border-radius: 500px;
	font-size: 16px;
	top: 10px;
	right: 10px;
}

.leader-image-container {
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

.leader-image-container img {
	max-height: 100%;
	width: 100%;
	object-fit: cover;
	max-width: 327px;
}

.popup-no-leader {
	display: flex;
	padding: 15px;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 90%;
	font-weight: bold;
	font-size: 12px;
	color: #575757;
}
.popup-no-leader .city-name {
	font-weight: bold;
	font-size: 20px;
	color: black;
}

/* Container that wraps everything */
.leaderboard-container {
	max-width: 500px;
	margin: 2rem auto;
	padding: 1rem;
	background-color: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-family: "Helvetica Neue", Arial, sans-serif;
	color: #333;
}

/* Title */
.leaderboard-container h2 {
	text-align: center;
	margin-bottom: 1rem;
	font-size: 1.25rem;
	letter-spacing: 1px;
	color: #333;
}

/* The list container */
.leaderboard-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Each row/item in the leaderboard */
.leaderboard-list li {
	display: flex;
	align-items: center;
	padding: 0.75rem 0;
	border-top: 1px solid #eee;
}

.leaderboard-list li:first-child {
	border-top: none; /* Remove top border on the first item */
}

/* Rank number on the left */
.rank {
	flex: 0 0 2em;
	font-weight: bold;
	color: #666;
	text-align: right;
	margin-right: 1rem;
}

/* Avatar image */
.avatar {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 50%; /* Make it circular */
	margin-right: 1rem;
}

/* Wrapper for name + location */
.info {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.name {
	font-weight: 600;
	color: #333;
}

.location {
	font-size: 0.9rem;
	color: #777;
}

/* Score on the far right */
.score {
	flex: 0 0 auto;
	font-weight: 600;
	color: #333;
	margin-left: 1rem;
}

/* Fullscreen overlay (dimmed background) */
.leader-form-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.4); /* Semi-transparent black overlay */
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000; /* Ensure it's on top of other elements */
}

/* The modal "card" itself */
.leader-form-card {
	position: relative; /* Important for absolutely positioned child (the X) */
	background: #fff;
	width: 90%;
	max-width: 600px;
	border-radius: 12px;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
	padding: 24px;
	font-family: "Helvetica Neue", Arial, sans-serif;
}

/* Heading */
.leader-form-card h2 {
	margin: 0 0 16px;
	font-size: 1.25rem;
	font-weight: 600;
	color: #333;
}

/* Labels and inputs */
.leader-form-card form label {
	display: block;
	margin: 16px 0 6px;
	font-size: 0.95rem;
	font-weight: 500;
	color: #333;
}

.leader-form-card form input[type="text"],
.leader-form-card form input[type="number"],
.leader-form-card form input[type="file"] {
	width: 100%;
	padding: 10px;
	font-size: 0.95rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-sizing: border-box;
}

/* Button row styling */
.button-row {
	margin-top: 24px;
	width: 90%;
	justify-content: end;
	display: flex;
	gap: 8px; /* space between buttons */
}

/* Primary and secondary (cancel) buttons */
.leader-form-card form button[type="submit"] {
	background-color: #6a8d92; /* Airbnb-like pinkish-red */
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 16px;
	font-size: 0.95rem;
	cursor: pointer;
}

.leader-form-card form button[type="button"] {
	background-color: #999;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 16px;
	font-size: 0.95rem;
	cursor: pointer;
}

/* Hover effect for both buttons */
.leader-form-card form button:hover {
	opacity: 0.9;
}

/* The "X" close button */
.leader-form-close-btn {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 1.5rem;
	line-height: 1;
	color: #999;
	cursor: pointer;
}

.leader-form-close-btn:hover {
	color: #666;
}
