/*
 * Utvalgte Kart - Frontend Styles
 * Brandon Grotesque font + map UI
 */

/* === Font Face === */
/* Place Brandon Grotesque font files in ../fonts/ directory */
@font-face {
	font-family: 'Brandon Grotesque';
	src: url('../fonts/BrandonGrotesque-Regular.woff2') format('woff2'),
		url('../fonts/BrandonGrotesque-Regular.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Brandon Grotesque';
	src: url('../fonts/BrandonGrotesque-Medium.woff2') format('woff2'),
		url('../fonts/BrandonGrotesque-Medium.woff') format('woff');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Brandon Grotesque';
	src: url('../fonts/BrandonGrotesque-Bold.woff2') format('woff2'),
		url('../fonts/BrandonGrotesque-Bold.woff') format('woff');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* === Map Wrapper === */
#utvalgte-kart-wrapper {
	position: relative;
	width: 100%;
	height: 100vh;
	min-height: 500px;
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	overflow: hidden;
}

#utvalgte-kart-wrapper *,
#utvalgte-kart-wrapper *::before,
#utvalgte-kart-wrapper *::after {
	box-sizing: border-box;
}

#utvalgte-kart-map {
	width: 100%;
	height: 100%;
	z-index: 1;
}

/* === Map Logo (top right) === */
#utvalgte-kart-logo {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 1000;
	pointer-events: none;
}

#utvalgte-kart-logo img {
	max-height: 50px;
	width: auto;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* === Heart Button === */
#utvalgte-kart-heart {
	position: absolute;
	top: 80px;
	right: 20px;
	z-index: 1000;
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #E63946;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
}

#utvalgte-kart-heart:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#utvalgte-kart-heart svg {
	width: 26px;
	height: 26px;
}

/* === Locate Button === */
#utvalgte-kart-locate {
	position: absolute;
	bottom: 120px;
	right: 20px;
	z-index: 1000;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #333;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, background-color 0.2s ease;
	padding: 0;
}

#utvalgte-kart-locate:hover {
	background: #f5f5f5;
}

#utvalgte-kart-locate.utvalgte-locating {
	animation: pulse-locate 1.5s ease-in-out infinite;
}

@keyframes pulse-locate {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.15); }
}

#utvalgte-kart-locate svg {
	width: 22px;
	height: 22px;
}

/* === Default Pin Marker === */
.utvalgte-default-pin {
	background: transparent !important;
	border: none !important;
}

/* === Popup Panel === */
#utvalgte-kart-popup {
	position: absolute;
	top: 0;
	right: 0;
	width: 380px;
	max-width: 90vw;
	height: 100%;
	z-index: 1100;
	background: #fff;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	pointer-events: none;
}

#utvalgte-kart-popup.utvalgte-popup-visible {
	transform: translateX(0);
	pointer-events: auto;
}

/* === Popup Close Button === */
.utvalgte-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 10;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #333;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: background 0.2s;
	backdrop-filter: blur(4px);
}

.utvalgte-popup-close:hover {
	background: #fff;
}

/* === Popup Content === */
.utvalgte-popup-content {
	display: flex;
	flex-direction: column;
}

/* === Popup Media === */
.utvalgte-popup-media {
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f0f0f0;
}

.utvalgte-popup-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.utvalgte-popup-media video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.utvalgte-popup-media iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* === Popup Body === */
.utvalgte-popup-body {
	padding: 24px 20px;
}

.utvalgte-popup-title {
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 8px;
	line-height: 1.3;
}

.utvalgte-popup-text {
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	font-weight: 400;
	color: #666;
	margin: 0 0 20px;
	line-height: 1.6;
}

/* === Popup Links === */
.utvalgte-popup-links {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.utvalgte-popup-link,
.utvalgte-popup-phone {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #333;
	text-decoration: none;
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s;
	padding: 8px 0;
}

.utvalgte-popup-link:hover,
.utvalgte-popup-phone:hover {
	color: #E63946;
}

.utvalgte-popup-link svg,
.utvalgte-popup-phone svg {
	flex-shrink: 0;
	color: #E63946;
}

/* === Directions Button === */
.utvalgte-popup-directions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 20px;
	border: 2px solid #E63946;
	border-radius: 8px;
	background: transparent;
	color: #E63946;
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	margin-bottom: 24px;
}

.utvalgte-popup-directions:hover {
	background: #E63946;
	color: #fff;
}

.utvalgte-popup-directions svg {
	flex-shrink: 0;
}

/* === Popup Logo === */
.utvalgte-popup-logo {
	display: flex;
	justify-content: center;
	padding: 16px 0 8px;
	border-top: 1px solid #eee;
}

.utvalgte-popup-logo img {
	max-height: 40px;
	width: auto;
	opacity: 0.7;
}

/* === Directions Panel === */
#utvalgte-kart-directions-panel {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1100;
	background: #fff;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 20px;
	border-radius: 16px 16px 0 0;
	max-height: 40vh;
	overflow-y: auto;
	pointer-events: none;
}

#utvalgte-kart-directions-panel.utvalgte-directions-visible {
	transform: translateY(0);
	pointer-events: auto;
}

.utvalgte-directions-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: #f5f5f5;
	color: #333;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.utvalgte-directions-close:hover {
	background: #e0e0e0;
}

.utvalgte-directions-content {
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
}

.utvalgte-directions-summary {
	display: flex;
	gap: 24px;
	margin-bottom: 16px;
}

.utvalgte-directions-stat {
	display: flex;
	flex-direction: column;
}

.utvalgte-directions-stat-label {
	font-size: 12px;
	font-weight: 500;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.utvalgte-directions-stat-value {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
}

/* === Notification Toast === */
.utvalgte-notification {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1200;
	background: #333;
	color: #fff;
	padding: 12px 24px;
	border-radius: 8px;
	font-family: 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	opacity: 1;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.utvalgte-notification-error {
	background: #E63946;
}

.utvalgte-notification-hide {
	opacity: 0;
	transform: translateX(-50%) translateY(20px);
}

/* === User Location Marker === */
.utvalgte-user-location {
	background: transparent !important;
	border: none !important;
}

.utvalgte-user-dot {
	width: 16px;
	height: 16px;
	background: #4285F4;
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(66, 133, 244, 0.4);
}

/* === Leaflet Routing Machine Overrides === */
.leaflet-routing-container {
	display: none !important;
}

/* === Leaflet Attribution === */
.leaflet-control-attribution {
	font-size: 10px !important;
}

/* === Responsive === */
@media (max-width: 480px) {
	#utvalgte-kart-popup {
		width: 100%;
		max-width: 100%;
	}

	#utvalgte-kart-logo img {
		max-height: 36px;
	}

	#utvalgte-kart-heart {
		width: 42px;
		height: 42px;
		top: 70px;
	}

	#utvalgte-kart-heart svg {
		width: 22px;
		height: 22px;
	}

	.utvalgte-popup-title {
		font-size: 18px;
	}

	.utvalgte-popup-body {
		padding: 18px 16px;
	}
}
