/* GPX Viewer Admin page */

.gpxv-upload,
.gpxv-table th,
.gpxv-table td {
	font-size: 1.2em;
	font-family: 'Roboto', sans-serif;
}

/* GPX Viewer Main page */

#content > .wrap {
	max-width: 1100px;
}

.gpxv-params {
	float: left;
	max-width: 500px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	padding: 1.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gpxv-option,
.gpxv-option label {
	clear: both;
	width: auto;
	float: left;
	color: #4b5563;
}

.gpxv-option input[type="color"],
.gpxv-option select {
	width: 50px !important;
	float: left;
	margin-left: 10px;
	padding: 3px 5px;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
}

.gpxv-option input[type="color"] {
	line-height: 1.3em;
}

.gpxv-option select {
	height: auto;
	font-size: 1em;
	background: #f3f4f6;
}

.gpxv-head {
	clear: both;
	float: left;
	margin-top: 1.3em;
	width: 100%;
}

.gpxv-head p {
	margin: 0 0 0 0;
	font-weight: 600;
	color: #1f2937;
}

.gpxv-head > div {
	float: left;
	padding: 0.5em 0.5em 0.5em 0.5em !important;
	margin-bottom: 0.5em;
	width: 60%;
}

.gpxv-head .dashicons {
	float: left;
	position: relative;
	top: 0.4em;
	left: -2.0em;
	color: #009540;
	width: 20px;
}

.gpxv-list {
	clear: both;
	float: left;
	height: 33.5em;
	overflow-x: hidden;
	overflow-y: scroll;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	background: #f9fafb;
}

.gpxv-select {
	font-size: 0.9em;
	line-height: 1.0em;
	border: 0;
}

.gpxv-select tbody td {
	padding: 0.2em 0.4em;
	border: 0;
	color: #4b5563;
}

.gpxv-select tbody > tr:nth-of-type(even) {
	background: #f3f4f6;
}

.gpxv-select tbody > tr:nth-of-type(odd) {
	background: #fff;
}

.gpxv-select tbody td:hover {
	color: white;
	background-color: #007a33;
}

.gpxv-select button {
	color: inherit !important;
	background: inherit !important;
	border-style: none;
	padding: 0 0.5em !important;
	margin: inherit !important;
	font-weight: 500;
}

.gpxv-select .selected {
	background-color: #fefcbf;
}

.gpxv-view {
	width: 100%;
	margin-top: 0 !important;
	margin-bottom: 2.0em !important;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

/* next to the selectable track list */
.gpxv-params ~ .gpxv-view {
	float: left;
	width: 500px;
	max-width: 100%;
}

#gpxv-load {
	max-width: none !important;
}

#gpxv-load > div > table {
	border-collapse: unset;
}

/* Messages */
#gpxv-successmessage,
#gpxv-errormessage {
	border-radius: 0.375rem;
	margin: 10px 0 18px;
	padding: 8px 35px 8px 14px;
	text-shadow: 0 1px 0 #fff;
	font-family: 'Roboto', sans-serif;
}

#gpxv-successmessage {
	background: #fefcbf;
	border: 1px solid #fed7aa;
	color: #16a34a;
}

#gpxv-errormessage {
	background: #ffebe6;
	border: 1px solid #ff4d00;
	color: #dc2626;
}

/* Download button */
.gpx-download-button {
	margin: 10px 0;
	padding: 0.75rem 2rem;
	background-color: #007a33;
	color: #ffffff;
	border: none;
	border-radius: 0.375rem;
	font-weight: 600;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.3s;
	font-family: 'Roboto', sans-serif;
}

.gpx-download-button:hover {
	background-color: #005a27;
}

/* Map display */

.wp-admin #map-container {
	width: 610px !important;
}

#map-container {
	clear: both;
	position: relative;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#map-container.small-viewport {
	height: auto;
}

/* fullscreen: native API, or CSS fallback for browsers without it (iPhone) */
#map-container:fullscreen,
#map-container:-webkit-full-screen,
#map-container.gpxv-pseudo-fullscreen {
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
}

#map-container.gpxv-pseudo-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

#map-container:fullscreen #leaflet-map,
#map-container:-webkit-full-screen #leaflet-map,
#map-container.gpxv-pseudo-fullscreen #leaflet-map {
	height: 100% !important;
	aspect-ratio: auto !important;
}

/* consent notice, only visible as long as the map has not been initialized */
.gpxv-consent-notice {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1.5rem;
	text-align: center;
	background: #f3f4f6;
	color: #1f2937;
	z-index: 900;
	opacity: 0;
	animation: gpxv-fade-in 0.3s ease-in 1s forwards;	/* no flicker when consent already given */
}

.gpxv-consent-notice p {
	max-width: 420px;
	margin: 0;
}

.gpxv-consent-notice button {
	padding: 0.75rem 2rem;
	background-color: #007a33;
	color: #fff;
	border: none;
	border-radius: 0.375rem;
	font-weight: 600;
	cursor: pointer;
}

.gpxv-consent-notice button:hover {
	background-color: #005a27;
}

.leaflet-container ~ .gpxv-consent-notice {
	display: none;
}

#leaflet-map:not(.leaflet-container) ~ .track-info {
	display: none;
}

@keyframes gpxv-fade-in {
	to { opacity: 1; }
}

.small-viewport .map-control.profile-button {
	display: none;
}

.map-control > img,
.map-control.dashicons {
	width: 30px;
	height: 30px;
	background-color: #fff;
	font-size: 25px;
	border-radius: 0.375rem;
}

.map-control-container .map-control {
	margin: 0 0 0 10px;
	display: inline-block;
	width: 30px;
	height: 30px;
	background-color: white;
	line-height: 30px;
	cursor: pointer;
	text-align: center;
	clear: none;
	float: right;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
}

.map-control.dashicons:hover {
	background-color: #f3f4f6;
	color: #009540;
}

.map-control.screen-button::before {
	content: "\f211";
}

.map-control.screen-button.active::before {
	content: "\f506";
}

.map-control .map-select {
	visibility: hidden;
	background-color: white;
	padding-left: 0.5rem;
	font-size: 0.8rem;
	line-height: 20px;
	height: 20px;
	width: 130px;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
}

.map-select:hover {
	background-color: #f3f4f6;
	color: #009540;
}

.map-control:hover .map-select,
.map-control:focus .map-select,
.map-control:active .map-select {
	visibility: visible;
}

.dashicons-download {
	padding-top: 5px;
	color: #009540;
}

#leaflet-map {
	height: clamp(320px, 60vh, 560px);
}

/* Profile display */
/*--------------------------------------------------------------
9.0 Tables
--------------------------------------------------------------*/

.track-info {
	float: right;
	position: absolute;
	max-height: 240px;
	text-align: left;
	top: 50px;
	right: 0px;
	width: 300px;
	height: 240px;
	opacity: 1;
	overflow: hidden;
	background-color: #ffffff;
	font-family: 'Roboto', sans-serif;
	font-size: 12px;
	z-index: 800;
	border: 1px solid #e5e7eb;
	border-radius: 0.375rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	padding: 1rem;
}

.track-info {
	-ms-transition: -ms-transform 0.8s, max-height 0.8s;
	-webkit-transition: -webkit-transform 0.8s, max-height 0.8s;
	-moz-transition: -moz-transform 0.8s, max-height 0.8s;
	-o-transition: -o-transform 0.8s, max-height 0.8s;
	transition: transform 0.8s, max-height 0.8s;
	-ms-transition-timing-function: ease-in-out;
	-webkit-transition-timing-function: ease-in-out;
	-moz-transition-timing-function: ease-in-out;
	-o-transition-timing-function: ease-in-out;
	transition-timing-function: ease-in-out;
}

.track-info.hidden {
	max-height: 0;
	-ms-transform: translateX(400px);
	-webkit-transform: translateX(400px);
	-moz-transform: translateX(400px);
	-o-transform: translateX(400px);
	transform: translateX(400px);
	-ms-transition: -ms-transform 0.8s, max-height 0.8s;
	-webkit-transition: -webkit-transform 0.8s, max-height 0.8s;
	-moz-transition: -moz-transform 0.8s, max-height 0.8s;
	-o-transition: -o-transform 0.8s, max-height 0.8s;
	transition: transform 0.8s, max-height 0.8s;
	-ms-transition-timing-function: ease-in-out;
	-webkit-transition-timing-function: ease-in-out;
	-moz-transition-timing-function: ease-in-out;
	-o-transition-timing-function: ease-in-out;
	transition-timing-function: ease-in-out;
}

.track-info h3 {
	font-size: 1.5rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 0.5rem;
}

.track-info h3:first-child {
	padding: 0 5px;
	margin-top: 0;
	margin-bottom: 2px;
	text-overflow: ellipsis;
	overflow: hidden;
	background-color: #f3f4f6;
	color: #1f2937 !important;
	border-radius: 0.375rem;
}

.track-info table {
	border-collapse: collapse;
	margin: 0 0 1.5em;
	width: 100%;
}

.track-info thead th {
	border-bottom: 2px solid #d1d5db;
	padding-bottom: 0.5em;
	color: #4b5563;
}

.track-info th {
	padding: 0.4em;
	text-align: left;
	color: #6b7280;
	font-weight: 500;
}

.track-info tr {
	border-bottom: 1px solid #e5e7eb;
	font-size: 12px !important;
}

.track-info td {
	padding: 0.4em;
	color: #1f2937;
	font-weight: 600;
}

.track-info th:first-child,
.track-info td:first-child {
	padding-left: 0;
}

.track-info th:last-child,
.track-info td:last-child {
	padding-right: 0;
}

.track-info .content {
	height: auto;
	line-height: 1;
	margin: 0 5px 5px 5px;
}

.track-info .content .properties {
	margin: 10px 0 10px 30px;
	color: #4b5563;
}

.track-info .no-data {
	text-align: center;
	color: #dc2626;
	height: 20px;
	line-height: 20px;
	border: 1px dotted #ff4d00;
	margin: 5px;
	background: #ffebe6;
	border-radius: 0.375rem;
}

.track-info svg + .gpx-no-data {
	display: none;
}

.small-viewport .track-info .no-data {
	display: block;
	margin-top: 2px;
	height: 153px;
	line-height: 153px;
}

.small-viewport .track-info,
.small-viewport .track-info.hidden {
	position: static;
	min-width: 100%;
	width: 100%;
	height: auto;
	max-height: none;
	transform: none;
	border: 0;
	border-top: 1px solid #e5e7eb;
	border-radius: 0;
	box-shadow: none;
	box-sizing: border-box;
}

.small-viewport .track-info .properties {
	margin: 10px 0;
}

a.gpx-file {
	margin-left: 5px;
	font-size: 15px;
	line-height: 1.8;
	color: #ffffff;
	background: #007a33;
	font-weight: 500;
	text-decoration: none;
	text-transform: uppercase;
	border: 0;
	float: right;
	border-radius: 0.375rem;
	padding: 0.25rem 0.75rem;
}

.small-viewport a.gpx-file {
	color: inherit;
	background: none;
	border: none;
	box-shadow: none;
	padding: 0;
	margin: 0 2px;
	pointer-events: auto;
	cursor: pointer;
	margin: 0 5px;
}

.small-viewport .track-info .content {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 1.5rem;
	margin-top: 0;
}

.small-viewport .content > * {
	flex: 1 1 260px;
	max-width: 420px;
	margin-top: 5px;
}

.storebutton button,
.update-close-button {
	margin-top: 1.0em;
	padding: 0.75rem 2rem;
	background-color: #007a33;
	color: #ffffff;
	border: none;
	border-radius: 0.375rem;
	font-weight: 600;
	cursor: pointer;
}

/* svg */

.track-info svg {
	min-height: 220px;
	max-height: 220px;
	max-width: 290px;
	margin: 0;
}

.small-viewport .track-info svg {
	margin-top: 0;
	height: 190px;
	min-height: 190px;
	max-height: 190px;
	max-width: 100%;
}

.elevation-profile {
	z-index: 1000;
	position: relative;
	margin-bottom: 5px;
	border: 1px solid #e5e7eb;
	border-radius: 0.375rem;
	background: #f9fafb;
}

.track-info .axis {
	stroke: #4b5563;
	stroke-width: 1px;
	marker-end: url(#t);
}

.track-info text {
	font-family: 'Roboto', sans-serif;
	font-size: 12px;
	stroke: none;
	fill: #4b5563;
}

.track-info .line {
	stroke: #d1d5db;
	stroke-width: 1px;
	font-family: 'Roboto', sans-serif;
	font-size: 10px;
}

.track-info rect {
	stroke: #d1d5db;
	fill: none;
}

.track-info .profile-line {
	stroke: #009540;
	fill: none;
	stroke-width: 3px;
}

.track-info .move-line {
	stroke: #dc2626;
	fill: none;
	stroke-width: 1px;
}

.upload-dialog input {
	font-size: 1em;
	font-weight: 600;
	padding: 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	background: #f3f4f6;
}

.upload-name input {
	font-size: 1em;
	padding: 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	background: #f3f4f6;
}

#gpxv-list input[type="search"] {
	color: #4b5563;
	font-size: 1em;
	line-height: normal;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	display: block;
	padding: 0 0.7em;
	width: 100%;
}
/* Mobile: smaller map, profile and stats stacked below it */
@media (max-width: 767px) {
	#leaflet-map {
		height: 55vh;
		min-height: 280px;
	}

	.small-viewport .track-info {
		padding: 0.75rem;
	}

	/* overlay in fullscreen would cover the whole map on a phone */
	#map-container:not(.small-viewport) .track-info {
		display: none;
	}
}
/* keyboard focus */
.gpx-download-button:focus-visible,
.storebutton button:focus-visible,
.gpxv-consent-notice button:focus-visible,
a.gpx-file:focus-visible,
.gpxv-select button:focus-visible {
	outline: 3px solid #005a27;
	outline-offset: 2px;
}
