/**
 * TrolleyMap CSS
 * Styling for the interactive map, city labels, hover cards, and detail panel
 */

#minimal-trolley-map {
	position: relative;
	background-color: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	z-index: 1;
}

/* Tile filter to suppress road/town visibility */
.leaflet-tile-pane {
	filter: grayscale(60%) brightness(1.05) contrast(1.1);
}

/* Reset / zoom-out button */
.trolleymap-reset-control {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

.trolleymap-reset-btn {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 6px 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	font-weight: 600;
	color: #333;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: background 0.15s, border-color 0.15s;
	white-space: nowrap;
}

.trolleymap-reset-btn:hover {
	background: #f5f5f5;
	border-color: #ccc;
}

/* Custom pin marker styles */
.trolleymap-marker {
	cursor: pointer;
	background: none !important;
	border: none !important;
	outline: none !important;
}

.trolleymap-marker-pin svg {
	transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.25s ease;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.trolleymap-marker:hover .trolleymap-marker-pin svg {
	transform: scale(1.18) translateY(-3px);
	filter: drop-shadow(0 6px 14px rgba(220, 4, 39, 0.5));
}

.trolleymap-marker:hover path {
	fill: #ff1c43 !important; /* brighter red on hover */
}

.trolleymap-marker-active .trolleymap-marker-pin svg {
	transform: scale(1.35) translateY(-4px);
	filter: drop-shadow(0 8px 16px rgba(220, 4, 39, 0.55));
}

.trolleymap-marker-active .trolleymap-marker-pin path {
	fill: #ff1c43 !important;
}

.trolleymap-marker-highlight svg {
	animation: trolleymap-pin-pulse 1s ease-in-out infinite alternate;
}

@keyframes trolleymap-pin-pulse {
	0% {
		transform: scale(1);
		filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
	}
	100% {
		transform: scale(1.22) translateY(-4px);
		filter: drop-shadow(0 8px 16px rgba(220, 4, 39, 0.6));
	}
}

/* Country label on hover */
.trolleymap-country-label {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid #999;
	border-radius: 3px;
	padding: 3px 8px;
	font-family: Arial, sans-serif;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Prevent body scroll when detail panel is open */
.trolleymap-detail-open {
	overflow: hidden;
	overflow-x: hidden;
}

.trolleymap-city-detail-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 999998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.trolleymap-detail-open .trolleymap-city-detail-backdrop {
	opacity: 1;
	visibility: visible;
}

.trolleymap-city-detail-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 500px;
	max-width: 90vw;
	background: #ffffff;
	z-index: 999999;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
}

.trolleymap-city-detail-panel * {
	box-sizing: border-box;
}

.trolleymap-city-detail-panel.trolleymap-detail-visible {
	transform: translateX(0);
}

.trolleymap-city-detail-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: opacity 0.2s ease;
	min-width: 0;
}

.trolleymap-city-detail-content img,
.trolleymap-city-detail-content video,
.trolleymap-city-detail-content iframe {
	max-width: 100%;
	height: auto;
}

.trolleymap-detail-body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

.trolleymap-detail-section {
	padding: 16px 24px;
	box-sizing: border-box;
	max-width: 100%;
}

.trolleymap-detail-section + .trolleymap-detail-section {
	border-top: 1px solid #f0f0f0;
}

.trolleymap-detail-section-heading {
	margin: 0 0 12px 0;
	font-weight: 700;
	color: #DC0427;
	letter-spacing: 0.6px;
}

.trolleymap-detail-section-subheading {
	margin: 0 0 8px 0;
	font-weight: 600;
	color: #333;
}

.trolleymap-detail-content-html a {
	color: #DC0427;
	text-decoration: none;
}

.trolleymap-detail-content-html a:hover {
	text-decoration: underline;
}

.trolleymap-detail-content-html {
	color: #555;
	line-height: 1.7;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.trolleymap-detail-content-html p {
	margin: 0 0 12px 0;
}

.trolleymap-detail-content-html p:last-child {
	margin-bottom: 0;
}

.trolleymap-detail-content-html ul,
.trolleymap-detail-content-html ol {
	margin: 0 0 12px 0;
	padding-left: 20px;
}

.trolleymap-detail-content-html li {
	margin-bottom: 4px;
}

.trolleymap-detail-content-html br + br {
	display: none;
}

.trolleymap-detail-content-html strong {
	font-weight: 700;
	color: #333;
}

/* Detail Header */
.trolleymap-detail-header {
	padding: 10px 15px 0px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.trolleymap-detail-header-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 14px;
}

.trolleymap-detail-city-name {
	margin: 0 0 2px 0;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.2;
}

.trolleymap-detail-country {
	color: #888;
}

.trolleymap-detail-close {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s, background 0.15s;
	flex-shrink: 0;
	margin-left: 12px;
	margin-top: -4px;
}

.trolleymap-detail-close:hover {
	color: #333;
	background: #f5f5f5;
}

.trolleymap-detail-back {
	background: none;
	border: none;
	color: #DC0427;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 4px;
	font-weight: 600;
	transition: background 0.15s;
}

.trolleymap-detail-back:hover {
	background: #fdf0f0;
}

.trolleymap-detail-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	color: #555;
}

.trolleymap-detail-table tr:not(:last-child) td {
	padding-bottom: 8px;
}

.trolleymap-detail-table td:first-child {
	color: #888;
	font-weight: 500;
	padding-right: 16px;
	white-space: nowrap;
	width: 40%;
}

.trolleymap-detail-table td:last-child {
	color: #333;
	font-weight: 600;
	word-break: break-word;
	overflow-wrap: break-word;
}

/* News Section */
.trolleymap-detail-news-section {
	padding-bottom: 20px;
}

.trolleymap-detail-news-list {
	overflow-y: auto;
}



/* Plain link style */
.trolleymap-plain-link {
	color: #DC0427;
	text-decoration: none;
	font-weight: 600;
	word-break: break-all;
}

.trolleymap-plain-link:hover {
	text-decoration: underline;
}

.trolleymap-attachment-row {
	color: #555;
	line-height: 1.6;
}

/* News Card */
.trolleymap-news-card {
	display: flex;
	gap: 12px;
	padding: 12px;
	margin: 0 3px 10px 3px;
	background: #FBFBFB;
	border: 1px solid #eee;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 3px 8px rgba(0, 0, 0, 0.04);
	text-decoration: none;
	color: inherit;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
	cursor: pointer;
	align-items: center;
}

.trolleymap-news-card-image {
	width: 80px;
	aspect-ratio: 4 / 3;
	border-radius: 6px;
	background-size: cover;
	background-position: center;
	background-color: #ffffff;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.trolleymap-news-card-image-placeholder {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='60'%3E%3Crect fill='%23e8e8e8' width='80' height='60'/%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' dy='.3em' fill='%23aaa'%3ENo Image%3C/text%3E%3C/svg%3E");
}

.trolleymap-news-fallback-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 4px;
	box-sizing: border-box;
}

.trolleymap-news-card-body {
	flex: 1;
	min-width: 0;
}

.trolleymap-news-card-title {
	margin: 0 0 4px 0;
	font-weight: 600;
	color: #222;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.trolleymap-news-card-date {
	display: block;
	color: #999;
	margin-bottom: 4px;
}

.trolleymap-news-empty {
	text-align: center;
	padding: 40px 20px;
	color: #999;
}

.trolleymap-news-loading {
	text-align: center;
	padding: 30px 20px;
	color: #999;
}

/* News detail sub-panel */
.trolleymap-news-detail-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	background-size: cover;
	background-position: center;
	background-color: #e8e8e8;
	border-radius: 0;
}

.trolleymap-news-detail-date {
	display: block;
	color: #999;
	margin-top: 4px;
}

.trolleymap-news-detail-meta {
	color: #555;
}

.trolleymap-news-detail-firma {
	color: #333;
}

/* Leaflet control overrides for clean look */
#minimal-trolley-map .leaflet-control-zoom a {
	color: #555;
}

#minimal-trolley-map .leaflet-interactive,
#minimal-trolley-map .leaflet-interactive:focus,
#minimal-trolley-map path.leaflet-interactive:focus {
	outline: none !important;
}

#minimal-trolley-map .leaflet-control-attribution {
	background: rgba(255, 255, 255, 0.7);
	padding: 2px 5px;
}

/* Search */
.trolleymap-search-container {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1000;
	display: flex;
	align-items: stretch;
	height: 34px;
}

.trolleymap-search-toggle {
	width: 34px;
	height: 34px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	flex-shrink: 0;
}

.trolleymap-search-toggle:hover {
	background-color: #f5f5f5;
	border-color: #ccc;
}

.trolleymap-search-dropdown {
	width: 0;
	overflow: hidden;
	transition: width 0.25s ease;
	display: flex;
	align-items: stretch;
}

.trolleymap-search-container.trolleymap-search-open .trolleymap-search-dropdown {
	width: 220px;
}

.trolleymap-search-container.trolleymap-search-open .trolleymap-search-toggle {
	border-radius: 6px 0 0 6px;
	border-right: none;
}

.trolleymap-search-input {
	width: 220px;
	height: 34px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-left: none;
	border-radius: 0 6px 6px 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	outline: none;
	background: #fff;
	color: #333;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
	line-height: 34px;
}

.trolleymap-search-input::placeholder {
	color: #aaa;
}

.trolleymap-search-results {
	position: absolute;
	top: 40px;
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	max-height: 240px;
	overflow-y: auto;
	display: none;
	z-index: 801;
}

.trolleymap-search-results.trolleymap-search-visible {
	display: block;
}

.trolleymap-search-item {
	padding: 10px 14px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.1s;
}

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

.trolleymap-search-item:hover {
	background: #f5f5f5;
}

.trolleymap-search-item-name {
	display: block;
	font-weight: 600;
	color: #333;
}

.trolleymap-search-item-country {
	display: block;
	color: #999;
}

.trolleymap-search-empty {
	padding: 16px 14px;
	text-align: center;
	color: #999;
}

/* Fullscreen Control */
.trolleymap-fullscreen-control {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	margin-bottom: 10px;
}

.trolleymap-fullscreen-btn {
	width: 34px;
	height: 34px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	color: #555;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	line-height: 1;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.trolleymap-fullscreen-btn:hover {
	background: #f5f5f5;
	border-color: #ccc;
	color: #333;
}

.trolleymap-fullscreen-btn:active {
	transform: scale(0.96);
}

.trolleymap-fullscreen-btn svg {
	width: 16px;
	height: 16px;
	display: block;
}

/* Fullscreen mode styles */
#minimal-trolley-map.trolleymap-fullscreen-mode {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 99998 !important;
	border: none !important;
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
}

:fullscreen #minimal-trolley-map,
:-webkit-full-screen #minimal-trolley-map,
:-moz-full-screen #minimal-trolley-map,
:-ms-fullscreen #minimal-trolley-map {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99998;
	border: none;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.trolleymap-fullscreen-active {
	overflow: hidden !important;
}

.trolleymap-fullscreen-active #minimal-trolley-map {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 99998 !important;
	border: none;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

/* Hover card on red dots */
.trolleymap-hover-tooltip {
	background: #fff;
	border: none;
	border-radius: 8px;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
	padding: 10px 14px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.trolleymap-hover-tooltip::before {
	border-top-color: #fff;
}

.trolleymap-hover-card {
	line-height: 1.7;
	color: #555;
}

.trolleymap-hover-card strong {
	color: #333;
	font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
	#minimal-trolley-map {
		height: 50vh !important;
		min-height: 300px;
	}

	/* Right-side slide-in panel (same as desktop) */
	.trolleymap-city-detail-panel {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
		box-sizing: border-box;
	}

	.trolleymap-detail-body {
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
	}

	.trolleymap-detail-content-html {
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	.trolleymap-plain-link {
		word-break: break-all;
		overflow-wrap: anywhere;
	}

	.trolleymap-detail-header {
		padding: 12px 16px 0;
	}

	.trolleymap-detail-header-top {
		margin-bottom: 10px;
	}

	.trolleymap-detail-city-name {
	}

	.trolleymap-detail-country {
	}

	.trolleymap-detail-section {
		padding: 12px 16px;
	}

	.trolleymap-detail-section-heading {
		margin-bottom: 10px;
	}

	.trolleymap-detail-table {
		table-layout: fixed;
		width: 100%;
	}

	.trolleymap-detail-table td:last-child {
		word-break: break-word;
		overflow-wrap: anywhere;
	}

	.trolleymap-detail-table td:first-child {
		width: 38%;
	}

	.trolleymap-detail-news-list {
		max-height: none;
	}

	.trolleymap-detail-close {
		width: 36px;
		height: 36px;
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
	}

	.trolleymap-detail-back {
		padding: 8px 14px;
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
	}

	/* News cards */
	.trolleymap-news-card {
		padding: 10px;
		gap: 10px;
	}

.trolleymap-news-card-image {
	width: 80px;
	aspect-ratio: 4 / 3;
	border-radius: 6px;
	background-size: cover;
	background-position: center;
	background-color: #ffffff;
	flex-shrink: 0;
	margin-top: auto;
	margin-bottom: auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

	.trolleymap-news-card-title {
	}

	.trolleymap-news-detail-image {
		aspect-ratio: 16 / 9;
	}

	.trolleymap-detail-content-html {
	}

	.trolleymap-detail-content-html ul,
	.trolleymap-detail-content-html ol {
		padding-left: 16px;
	}

	/* Search */
	.trolleymap-search-container.trolleymap-search-open .trolleymap-search-dropdown {
		width: 180px;
	}

	.trolleymap-search-input {
		width: 180px;
	}

	.trolleymap-search-results {
		max-height: 200px;
	}

	.trolleymap-search-item {
		padding: 12px 14px;
	}
}

@media (max-width: 480px) {
	#minimal-trolley-map {
		height: 45vh !important;
		min-height: 260px;
	}

	.trolleymap-city-detail-panel {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
	}

	.trolleymap-detail-header {
		padding: 10px 12px 0;
	}

	.trolleymap-detail-city-name {
	}

	.trolleymap-detail-section {
		padding: 10px 12px;
	}

	.trolleymap-detail-table {
	}

	.trolleymap-detail-table td:first-child {
		width: 35%;
		padding-right: 10px;
	}

	.trolleymap-news-card {
		padding: 8px;
		gap: 8px;
	}

	.trolleymap-news-card-image {
		width: 56px;
		aspect-ratio: 4 / 3;
	}

	.trolleymap-news-card-title {
	}

	.trolleymap-detail-content-html {
	}

	/* Search */
	.trolleymap-search-container {
		top: 6px;
		right: 6px;
		height: 30px;
	}

	.trolleymap-search-toggle {
		width: 30px;
		height: 30px;
		background-size: 14px 14px;
	}

	.trolleymap-search-container.trolleymap-search-open .trolleymap-search-dropdown {
		width: 150px;
	}

	.trolleymap-search-input {
		width: 150px;
		height: 30px;
		line-height: 30px;
		padding: 0 10px;
	}

	.trolleymap-search-results {
		top: 34px;
		max-height: 180px;
	}
}

/* Print */
@media print {
	#minimal-trolley-map {
		display: none;
	}

	.trolleymap-city-detail-panel,
	.trolleymap-city-detail-backdrop {
		display: none !important;
	}
}
