/* Trail Info Component Styles */
.trailInfoContainer {
	width: 100%;
	margin: 0 auto;
	padding: 20px;
}
.flex-container {
	display: flex;
	flex-wrap: wrap;
	align-content: center;
	justify-content: center;
}
.trail-stats, .trailInfoTags, .trailInfoButtons, .trailInfoDescription, .map-and-elevation {
	margin-bottom: 20px;
}
.trailInfoButtons button {
	display: inline-block;
	margin: 5px;
	padding: 10px 20px;
	background-color: #007BFF;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
}
.trailInfoButtons button:hover {
	background-color: #0056b3;
}
#elevation-profile {
	height: 150px;
	background-color: #f0f0f0;
	margin-top: 10px;
}
.stats-grid-container {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	margin: 20px;
}
.stats-flex-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	width: 100%;
	/*margin: 20px;  */
	justify-content: center;
}
.stat-card {
	flex: 0 0 auto;
	background-color: #e4fbea;
	padding: 5px;
	position: relative;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	display: flex;
	justify-content: space-between;
	box-sizing: border-box;
}
.stat-card strong {
	display: block;
	margin-bottom: 8px;
}
.stat-card-text {
    flex: 1;
    margin-right: 10px;
}
.stat-card-image {
    max-width: 35px !important;
    height: auto !important;
    object-fit: contain;
	margin-right: 10px;
}
.taInfoSheet {
	display: inline-block;
	padding: 10px;
	margin-left: 10px;
	color: #fff !important;
	background-color: green;
	text-align: center;
	text-decoration: none;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	transition: background-color 0.3s ease;
}
.taInfoSheet:hover {
	background-color: #24b54b;
}
.taSmaller {
	font-size: 11px;
}
.taTagBG {
	background-color: #cffcdb;
	border-radius: 10px;
	padding: 5px;
	display: inline-block;
	white-space: nowrap;
	margin: 2px;
}
.taTag {
	height: 15px !important;
}
#elevMap {
	height: 500px;
	width: 800px;
	max-width: 800px;
	max-height: 500px;
	border-radius: 8px;
}
#elevation-div {
	width: 100%;
	padding: 0;
	margin: 0;
}
.elevation-control .area {
	fill: #24b504;
}
.green-theme {
  --ele-bg: rgba(36,181,4, 0.4);
  --ele-area: #24b504;
  --ele-brush: rgba(36, 181, 4, 0.4);
  --ele-line: #24b504;
}
.elevation-waypoint-icon {
  --ele-marker: url('https://trailadvocate.org/trailInfo/fsTHIcon.png') !important;
}

.taWarning {
	background: radial-gradient(yellow, transparent);
    padding: 25px;
    border-radius: 50px;
	margin-top: 10px;
	text-align:center;
}
    .popup-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      display: none; /* Hidden by default */
      justify-content: center;
      align-items: center;
      z-index: 1000;
    }

    /* Styles for the popup panel */
    .popup-panel {
      background-color: white;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      max-width: 50%;
      max-height: 50%;
      overflow: auto; /* Add scroll if content overflows */
    }

    /* Close button styles */
    .close-btn {
      font-size: 18px;
      cursor: pointer;
	  text-align: right;
	  margin-top: -10px;
	  margin-right: 0px;
    }
	.trailInfoPhoto-icon {
		width: 50px !important;
		height:	50px !important;
		border-radius: 8px;
		border: 1px solid white;
	}
	.ta-popup-image {
	  width: 300px;
	  height: auto;
	}

/* Styles for smartphones (portrait and landscape) */
@media only screen and (max-width: 600px) {
	.stats-grid-container {
		grid-template-columns: repeat(2, 1fr);
	}
	.stats-flex-container {
		margin: 0px;
	}
	#elevMap {
		width: 350px;
		max-width: 350px;
		height: 400px;
		max-height: 400px;
	}
	.ta-popup-image {
  		width: 250px;
	}
	.trailInfoPhoto-icon {
		width: 40px !important;
		height:	40px !important;
	}
	.trailInfoTags {
		display: none;
	}
}

/* leaflet-photo css below */
.leaflet-marker-photo {
	border: 2px solid #fff;
	box-shadow: 3px 3px 10px #888;
}

.leaflet-marker-photo div {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.leaflet-marker-photo b {
	position: absolute;
	top: -7px;
	right: -11px;
	color: #555;
	background-color: #fff;
	border-radius: 8px;
	height: 12px;
	min-width: 12px;
	line-height: 12px;
	text-align: center;
	padding: 3px;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

/* Leaflet-elevation css below */
.leaflet-hidden {
  visibility: hidden;
}

.legend {
  cursor: pointer;
}

.leaflet-container {
  z-index: 0;
  /* prevent overlapping the .elevation-detached chart */
}

.elevation-control .background {
  background-color: var(--ele-bg, rgba(70, 130, 180, 0.2));
  border-radius: 5px;
  overflow: visible;
  display: block;
  touch-action: none;
  user-select: none;
  max-width: 100%;
}

.elevation-control .grid,
.elevation-control .area > foreignObject,
.elevation-control .axis,
.elevation-control .tooltip,
.height-focus.line {
  pointer-events: none;
}

.elevation-control .axis line,
.elevation-control .axis path {
  stroke: var(--ele-axis, #2D1130);
  stroke-width: 1;
  fill: none;
}

.elevation-control .grid .tick line {
  stroke: var(--ele-grid, #EEE);
  stroke-width: 1px;
  shape-rendering: crispEdges;
}

.elevation-control .grid path {
  stroke-width: 0;
}

.elevation-control .axis text,
.elevation-control .legend text,
.elevation-control .point text {
  fill: #000;
  font-weight: 700;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 2px
}

.elevation-control .y.axis text {
  text-anchor: end;
}

.elevation-control .area {
  fill: var(--ele-area, #4682B4);
  stroke: var(--ele-stroke, #000);
  stroke-width: 1.2;
  paint-order: stroke fill;
}

.elevation-control .horizontal-drag-line {
  cursor: row-resize;
  stroke: transparent;
  stroke-dasharray: 5;
  stroke-width: 1.1;
}

.elevation-control .active .horizontal-drag-line {
  stroke: #000;
}

.elevation-control .horizontal-drag-label {
  fill: #000;
  font-weight: 700;
  paint-order: stroke;
  stroke: #FFF;
  stroke-width: 2px;
}

.elevation-control .ruler {
  color: #000;
  cursor: row-resize;
}

.elevation-control .mouse-focus-line {
  stroke: #000;
  stroke-width: 1;
}

.elevation-control .mouse-focus-label-rect {
  fill: #000;
  fill-opacity: 0.75;
  stroke-width: 1;
  stroke: #444;
}

.elevation-control .mouse-focus-label-text {
  fill: #FFF;
  font-size: 10px;
}

.elevation-control .brush .overlay {
  cursor: unset;
}

.elevation-control .brush .selection {
  fill: var(--ele-brush, rgba(23, 74, 117, 0.4));
  stroke: none;
  fill-opacity: unset;
}

.elevation-summary {
  font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
  font-size: 12px;
  margin: var(--ele-sum-margin, 0 auto);
  text-shadow: var(--ele-sum-shadow, 1px 0 0 #FFF, -1px 0 0 #FFF, 0 1px 0 #FFF, 0 -1px 0 #FFF, 1px 1px #FFF, -1px -1px 0 #FFF, 1px -1px 0 #FFF, -1px 1px 0 #FFF);
}

.elevation-summary>span:not(:last-child):after {
  content: var(--ele-sum-sep, '');
}

.multiline-summary>span {
  display: block;
}

.multiline-summary .download {
  float: right;
  margin-top: -3em;
  margin-right: 2em;
  font-weight: bold;
  font-size: 1.2em;
}

.elevation-summary .summaryvalue {
  font-weight: bold;
}

.elevation-toggle-icon {
  background-color: #fff;
  right: 5px;
  top: 5px;
  height: var(--ele-toggle-size, 36px);
  width: var(--ele-toggle-size, 36px);
  cursor: pointer;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  display: inline-block;
  position: var(--ele-toggle-pos, relative);
}

.elevation-toggle-icon:before {
  content: '\2716';
  display: var(--ele-close-btn, none);
  color: #000;
  width: 100%;
  line-height: 20px;
  text-align: center;
  font-weight: bold;
  font-size: 15px;
}

.leaflet-elevation-pane .height-focus,
.leaflet-overlay-pane .height-focus {
  stroke: #000;
  fill: var(--ele-circle, var(--ele-area, #FFF));
}

.leaflet-elevation-pane .height-focus.line,
.leaflet-overlay-pane .height-focus.line {
  stroke-width: 2;
}

.leaflet-elevation-pane .height-focus-label,
.leaflet-overlay-pane .height-focus-label {
  font-size: 12px;
  font-weight: 600;
  fill: #000;
  paint-order: stroke;
  stroke: #FFF;
  stroke-width: 2px;
}

.elevation-waypoint-icon:before,
.elevation-position-icon:before {
  content: "";
  width: 100%;
  height: 100%;
  display: inline-block;
  background: var(--ele-marker) no-repeat center center / contain;
}

.elevation-polyline {
  stroke: var(--ele-poly, var(--ele-area, #000));
  filter: drop-shadow(1px 1px 0 #FFF) drop-shadow(-1px -1px 0 #FFF) drop-shadow(1px -1px 0 #FFF) drop-shadow(-1px 1px 0 #FFF);
}

/* CHART STATES /////////////////////////////////////////////////// */

.elevation-detached {
  font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
  height: auto;
  width: 100%;
  position: relative;
  z-index: 0;
}

.elevation-detached .area {
  fill-opacity: var(--ele-alpha, 0.8);
}

.elevation-detached.elevation-collapsed .elevation-summary {
  display: block;
}

.elevation-detached.elevation-collapsed .elevation-toggle-icon {
  top: 5px;
  right: 9px;
  bottom: 5px;
  margin: auto;
}

.elevation-control.elevation-collapsed > * {
  display: none;
}

.elevation-control.elevation-collapsed > .elevation-toggle-icon {
  display: inline-block;
}

.elevation-detached {
  --ele-sum-margin: 12px 35px;
  --ele-sum-shadow: none;
  --ele-toggle-pos: absolute;
}

.elevation-expanded {
  --ele-close-btn: inline-block;
  --ele-toggle-bg: none;
  --ele-toggle-pos: absolute;
  --ele-toggle-size: 20px;
}

.inline-summary {
  --ele-sum-sep: "\0020\2014\0020";
}

.elevation-waypoint-icon {
  --ele-marker: url(../images/elevation-pushpin.svg);
}

.elevation-position-icon {
  --ele-marker: url(../images/elevation-position.svg);
}

/* LIME THEME ///////////////////////////////////////////////////// */

.lime-theme {
  --ele-bg: rgba(156, 194, 34, 0.2);
  --ele-axis: #566B13;
  --ele-area: #9CC222;
  --ele-grid: #CCC;
  --ele-brush: rgba(99, 126, 11, 0.4);
  --ele-poly: #566B13;
  --ele-line: #70ab00;
}

/* STEELBLUE THEME //////////////////////////////////////////////// */

.steelblue-theme {
  --ele-axis: #0D1821;
  --ele-area: #4682B4;
  --ele-brush: rgba(23, 74, 117, 0.4);
  --ele-line: #174A75;
}

/* PURPLE THEME /////////////////////////////////////////////////// */

.purple-theme {
  --ele-bg: rgba(115, 44, 123, 0.2);
  --ele-area: #732C7B;
  --ele-brush: rgba(74, 14, 80, 0.4);
  --ele-line: #732c7b;
}

/* YELLOW THEME /////////////////////////////////////////////////// */

.yellow-theme {
  --ele-area: #FF0;
}

/* RED THEME ////////////////////////////////////////////////////// */

.red-theme {
  --ele-area: #F00;
}

/* MAGENTA THEME ////////////////////////////////////////////////// */

.magenta-theme {
  --ele-bg: rgba(255, 255, 255, 0.47);
  --ele-area: #FF005E;
}

/* LIGHTBLUE THEME //////////////////////////////////////////////// */

.lightblue-theme {
  --ele-area: #3366CC;
  --ele-alpha: 0.45;
  --ele-stroke: #4682B4;
  --ele-circle: #fff;
  --ele-line: #000;
}

.elevation-detached.lightblue-theme .area {
  stroke: #3366CC;
}

/* leaflet-distance-markers */

.dist-marker {
  font-size: 0.5rem;
  border: 1px solid #777;
  border-radius: 10px;
  text-align: center;
  color: #000;
  background: #fff;
}

	#spinnerOverlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.7);
		display: none; /* Hidden by default */
		justify-content: center;
		align-items: center;
		z-index: 9999; /* Ensure it is on top */
	}
	.spinner {
		border: 16px solid #f3f3f3;
		border-top: 16px solid green;
		border-radius: 50%;
		width: 120px;
		height: 120px;
		animation: spin 2s linear infinite;
	}
	@keyframes spin {
		0% { transform: rotate(0deg); }
		100% { transform: rotate(360deg); }
	}
