:root {
	--apple-blue: #007aff;
	--sheet-height: 70vh;
}

*::-webkit-scrollbar {
	width: 0;
	display: none;
}

body,
html {
	height: 100vh;
	width: 100vw;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: #f8f9fa;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro HK", sans-serif;
	-webkit-font-smoothing: antialiased;
}

#map {
	height: 100vh;
	width: 100vw;
	z-index: 1;
	background: #ebe6df;
	filter: grayscale(20%);
}

/* Initial Overlay */
#appLock {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px) saturate(130%);
	-webkit-backdrop-filter: blur(4px) saturate(130%);
	pointer-events: auto;
	transition: all 0.5s ease;
}

.is-active #appLock {
	opacity: 0;
	pointer-events: none;
	backdrop-filter: blur(0);
}

.is-active .search-outer {
	top: 2%;
}

/* Unified Search Component */
.search-outer {
	position: fixed;
	top: 40%;
	/* Initial center-ish position */
	left: 50%;
	transform: translateX(-50%) translateY(0);
	width: 90%;
	max-width: 500px;
	z-index: 100;
	transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.search-outer.active {
	top: 30%;
	transform: translateX(-50%) translateY(-10%);
}

.search-container {
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(17px) saturate(200%);
	-webkit-backdrop-filter: blur(17px) saturate(200%);
	border-radius: 30px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.7);
	overflow: hidden;
	overflow-y: scroll;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateY(0);
	height: 64px;
}

.search-container.expanded {
	border-radius: 24px;
	transform: translateY(-10%);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.search-bar-row {
	height: 64px;
	display: flex;
	align-items: center;
	padding: 0 20px;
	position: fixed;
	top: 0;
	height: 64px;
	width: 100%;
}

.search-input {
	flex-grow: 1;
	border: none;
	outline: none;
	padding: 12px 8px;
	font-size: 18px;
	background: transparent;
	color: #000;
}

/* Suggestion List inside the box */
#suggestionList {
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	overflow-y: auto;
	border-top: 0.5px solid rgba(0, 0, 0, 0.08);
	pointer-events: none;
	position: absolute;
	top: 64px;
	width: 100%;
}

.expanded #suggestionList {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.suggestion-item {
	padding: 16px 20px;
	border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
	cursor: pointer;
	transition: background 0.2s;
}

.suggestion-item:last-child {
	border-bottom: none;
}

.suggestion-item:active {
	background: rgba(0, 122, 255, 0.1);
}

/* Popups */
.image-style-popup {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(12px) saturate(180%);
	-webkit-backdrop-filter: blur(12px) saturate(180%);
	border-radius: 20px;
	padding: 18px 22px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-width: 280px;
	max-width: 320px;
	position: relative;
	cursor: pointer;
	border: 0.5px solid rgba(255, 255, 255, 0.5);
}

.image-style-popup.confirm-theme {
	background: rgba(0, 122, 255, 0.85);
	color: white;
}

.image-style-popup::after {
	content: "";
	position: absolute;
	bottom: -10px;
	left: 50%;
	transform: translateX(-50%);
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid rgba(255, 255, 255, 0.85);
}

.image-style-popup.confirm-theme::after {
	border-top-color: rgba(0, 122, 255, 0.85);
}

.leaflet-popup-content-wrapper {
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
}

.leaflet-popup-tip-container {
	display: none !important;
}

.leaflet-popup-content {
	margin: 0 !important;
	width: auto !important;
}

/* Sheet */
#resultsSheet {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border-top-left-radius: 24px;
	border-top-right-radius: 24px;
	height: var(--sheet-height);
	transform: translateY(100%);
	transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
	touch-action: none;
}

.pill {
	font-size: 10px;
	font-weight: 800;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.05);
	color: #8e8e93;
	display: inline-block;
	margin-bottom: 4px;
}

.pill-white {
	background: rgba(255, 255, 255, 0.2);
	color: white;
}

/* Modal Animations */
#infoModal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	background: rgba(0, 0, 0, 0);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(0px);
	transition:
		background 0.4s ease,
		backdrop-filter 0.4s ease;
}

#infoModal.visible {
	background: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(10px);
}

.modal-content {
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(30px) saturate(180%);
	width: 100%;
	max-width: 360px;
	border-radius: 24px;
	padding: 24px;
	transform: scale(0.8) translateY(20px);
	opacity: 0;
	transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 480px) {
	#infoModal .modal-content {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		transform: scale(0) translateY(0);
        max-width: none;
        border-radius: 0;
        padding: 12px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
	}
}

#infoModal.visible .modal-content {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.modal-input {
	width: 100%;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: rgba(255, 255, 255, 0.5);
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 16px;
	margin-top: 4px;
	outline: none;
	transition: border-color 0.2s;
}

.modal-input:focus {
	border-color: var(--apple-blue);
}

/* Ensure the map isn't totally obscured but unclickable */
#finalSuccessOverlay {
	pointer-events: auto;
}

/* Animations */
#finalSuccessOverlay.opacity-100 {
	opacity: 1;
}

#finalSuccessOverlay .scale-100 {
	transform: scale(1);
}

/* Ticket Notch Detail */
#finalSuccessOverlay .border-dashed {
	background-image: linear-gradient(
		to right,
		#f3f4f6 50%,
		rgba(255, 255, 255, 0) 0%
	);
	background-position: bottom;
	background-size: 15px 4px;
	background-repeat: repeat-x;
	border-bottom: none;
}
