@import "https://js.arcgis.com/4.34/@arcgis/core/assets/esri/themes/light/main.css";

:root {
	--calcite-spacing-md: 0.3rem;
  --calcite-spacing-md-plus: 0.35rem;
	--border-color: #dee2e6;
}

html, body { 
	margin: 0;
	display: flex;
}

html {
	height: 100%;
	width: 100%;
}

body {
	font-family: "Avenir Next", "Helvetica Neue", helvetica, arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	flex: 1;
	padding-left: 1rem;
	padding-top: 1rem;
	padding-bottom: 1rem;
}

ul, ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

img {
	max-width: 100%;
}

hr {
	background: none;
	border: none;
}

button {
	background-color: #000;
	border-radius: 9999px;
	color: #fff;
	padding: 0.25rem 0.5rem;
	border: none;
	cursor: pointer;
	font-size: 0.75rem;
	line-height: 1;
}
button:hover {
	background-color: #333;
}
button:active {
	background-color: #666;
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* -------------- Map -------------- */

.esri-view .esri-view-surface {
	border-radius: 0.5rem;
}

.esri-ui .esri-popup,
.esri-popup__main-container {
	border-radius: 0.5rem;
}

.esri-view-width-medium .esri-popup__main-container {
	max-width: 260px;
}

.map-attribution {
	position: absolute;
	bottom: 0;
	right: 0;
	font-size: 0.75rem;
	color: #fff;
	background-color:rgba(0, 0, 0, 0.5);
	padding: 0.1rem;
	line-height: 1;
	border-top-left-radius: 0.25rem;
	border-bottom-right-radius: 0.25rem;
}
.map-attribution a {
	color: inherit;
	text-decoration: none;
}
.map-attribution a:hover {
	text-decoration: underline;
}

#map {
	flex: 1;
	position: relative;
}

/* -------------- Panel -------------- */

#panel {
	position: relative;
	width: 100%;
	max-width: 240px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.panel-section {
	padding-left: 1rem;
	padding-right: 1rem;
}

.panel-divider {
	background-color: var(--border-color);
	height: 1px;
	width: 90%;
	margin: 0.75rem auto;
}

.panel-spacer {
	flex: 1;
}

.panel-header {
	font-size: 1rem;
	font-weight: bold;
	margin-bottom: 0.5rem;
}

/* -------------- Search -------------- */

.panel-search {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.panel-search-bar {
	display: flex;
	flex-direction: row;
	align-items: center;
	column-gap: 0.25rem;
	height: 1.5rem;
	margin-bottom: 0.75rem;
}

#search-bar,
#search-send-button,
#search-clear-button {
	height: 100%;
}

#search-bar {
	width: 100%;
	border: 1px solid var(--border-color);
	border-radius: 0.33rem;
	padding-left: 0.5rem;
	padding-right: 0.5rem;
	color: #212529;
	background-color: #fff;
}

#search-bar:focus {
	border-color: #80bdff;
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#search-loader {
	display: none;
	flex-direction: column;
}
.search-loader-bar {
	width: 100%;
	height: 4px;
	background-color: #000;
	border-radius: 0.5rem;
	animation: search-loader-bar-animation 1s linear infinite;
}

@keyframes search-loader-bar-animation {
	0% {
		width: 0%;
	}
	100% {
		width: 100%;
	}
}

#search-results {
	display: none;
	flex-direction: column;
}

#search-results li {
	padding: 0.25rem;
	border-bottom: 1px solid var(--border-color);
}

#search-results li:last-child {
	border-bottom: none;
}

#search-results a {
	color: #212529;
	text-decoration: none;
	cursor: pointer;
}

#search-results a:hover {
	color: #0056b3;
	text-decoration: underline;
}

#search-results a small {
	display: block;
	margin-top: -0.15rem;
}

#search-pagination {
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	padding-top: 0.75rem;
	padding-bottom: 0;
	border-top: 1px solid var(--border-color);
	font-size: 0.75rem;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.pagination-info {
	color: #6c757d;
	margin-bottom: 0.5rem;
	text-align: center;
}

.pagination-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	column-gap: 0.5rem;
}

.pagination-page {
	color: #212529;
	min-width: 4rem;
	text-align: center;
}

.pagination-button {
	line-height: 0.7;
	padding-bottom: 5px;
}

/* -------------- Legend -------------- */

.esri-widget {
	border-radius: 0.25rem;
	overflow: hidden;
}

.panel-legend {
	display: flex;
	flex-direction: column;
}

.legend-item {
	position: relative;
	padding-left: 0.5rem;
	display: flex;
	align-items: center;
	column-gap: 0.5rem;
}

.legend-color,
.legend-icon {
	width: 8px;
	height: 8px;
  outline: 1px solid #000;
	border-radius: 50%;
	border: 1px solid currentColor;
	background-color: currentColor;
}

.legend-icon-beste-sender {
	color: rgb(255, 215, 0);
	transform: rotate(45deg);
	border-radius: 0;
	width: 6px;
	height: 6px;
	margin-right: 2px;
}
.legend-icon-sender {
	color: rgb(0, 122, 255);
}
.legend-icon-skyggesender {
	color: rgb(255, 149, 0);
}
.legend-best {
	color: #5e8515;
}
.legend-good {
	color: #bfdf68;
}
.legend-maybe {
	color: #d2d2d2;
}
.legend-none {
	color: #ffffff;
}

/* Loading spinner */
.spinner {
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0078d7;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@media (max-width: 666px) {
	body {
		flex-direction: column;
		padding: 0.5rem;
	}
	#panel {
		max-width: none;
		overflow-y: hidden;
	}
	.panel-header {
		margin-bottom: 0.25rem;
	}
	.panel-legend {
		flex-direction: row;
		margin-bottom: 0.5rem;
	}
	.panel-section {
		padding-left: 0;
		padding-right: 0;
	}
	.panel-divider {
		display: none;
	}
	.panel-search {
    flex: none;
    padding-top: 0.25rem;
	}
	.panel-search-bar {
		margin-bottom: 0.5rem;
	}
	button,
	#search-bar {
		font-size: 16px;
	}
	#search-send-button {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	#search-loader {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}
	#search-results {
		height: 20vh;
		overflow-y: auto;
		padding-left: 0.25rem;
		padding-right: 0.25rem;
	}
	#search-results a small {
		display: inline;
		margin-top: 0;
		margin-left: 0.25rem;
	}
	#search-pagination {
		border-top: none;
		padding-top: 0.25rem;
		padding-left: 0;
		padding-right: 0;
		justify-content: space-between;
		flex-direction: row;
	}
	.pagination-info {
		margin-bottom: 0;
	}
}
