/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}

  /* Auth & Social Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    border: 2px solid var(--primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(139, 107, 158, 0.3);
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.7);
    color: white;
    font-size: 1em;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
}

.user-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(139, 107, 158, 0.1);
    border-radius: 8px;
    margin-top: 10px;
}


.nearby-panel {
    position: fixed !important;
    top: 20px !important; /* Changed from 50% to 20px from top */
    left: 50% !important;
    transform: translateX(-50%) !important; /* Remove vertical translation */
    width: 95% !important;
    max-width: 450px !important;
    max-height: 80vh !important; /* Increased height */
    height: auto !important;
    z-index: 10001 !important;
    background: #2D1B3D !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7) !important;
    border: 2px solid #8B6B9E !important;
    display: none !important;
    overflow: hidden !important;
    flex-direction: column !important;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 107, 158, 0.3);
    background: rgba(43, 33, 60, 0.9);
    margin: 0;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: #FFD166;
    font-weight: bold;
}

.nearby-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: calc(80vh - 60px); /* Account for header */
    background: rgba(26, 26, 46, 0.9);
}

/* Close button positioning */
#closeNearbyPanel {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(255, 107, 107, 0.2) !important;
    border: none !important;
    color: #FF6B6B !important;
    font-size: 1.2em !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10002 !important;
}

/* Make sure the main app container doesn't affect the modal */
.app-container {
    position: relative;
    z-index: 1;
}

.nearby-relic-item:hover {
    background: rgba(43, 33, 60, 0.9);
    transform: translateY(-2px);
}

/* Ensure the overlay covers everything properly */
#overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.8) !important;
    z-index: 10000 !important;
    display: none !important;
}
#closeNearbyPanel:hover {
    background: rgba(255, 107, 107, 0.4) !important;
}

/* Make sure the list items are properly spaced */
.nearby-relic-item {
    background: rgba(43, 33, 60, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(139, 107, 158, 0.3);
    transition: all 0.3s ease;
}

.nearby-relic-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important; /* Changed to flex-start */
    margin-bottom: 4px !important;
    gap: 8px !important;
    flex-wrap: wrap !important; /* Allow wrapping */
}

.nearby-relic-user {
    font-size: 0.75em !important;
    color: #8B6B9E !important;
    font-weight: bold !important;
    flex: 1 !important;
    min-width: 60% !important; /* Ensure user info takes space */
}

.nearby-relic-distance {
    font-size: 0.7em !important;
    color: #FFD166 !important;
    background: rgba(255, 209, 102, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Add map pin button */
.map-pin-btn {
    background: rgba(107, 139, 158, 0.3) !important;
    border: none !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.7em !important;
    margin-left: 5px !important;
}

.map-pin-btn:hover {
    background: rgba(107, 139, 158, 0.5) !important;
}


.nearby-relic-title {
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
    font-size: 0.95em;
    line-height: 1.2;
}

.nearby-relic-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #888;
    margin-bottom: 8px;
}

.nearby-relic-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.social-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: rgba(139, 107, 158, 0.3);
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
}

.social-btn:hover {
    background: rgba(139, 107, 158, 0.5);
}

.play-btn {
    background: rgba(107, 139, 158, 0.4);
}

.play-btn:hover {
    background: rgba(107, 139, 158, 0.6);
}

.like-btn {
    background: rgba(217, 83, 79, 0.3);
}

.like-btn:hover, .like-btn.liked {
    background: rgba(217, 83, 79, 0.6);
}

/* Close button */
.close-btn {
    background: none;
    border: none;
    color: #FF6B6B;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Empty state */
.empty-state {
    text-align: center;
    color: #888;
    padding: 20px;
    font-style: italic;
}

/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #1a1a2e;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #8B6B9E;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	background: #2d1b3d;
	}
.leaflet-bar a {
	background-color: #2d1b3d;
	border-bottom: 1px solid #8B6B9E;
	color: #F0E6F6;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #3d2b4d;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #2d1b3d;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #F0E6F6;
	background: #2d1b3d;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(images/marker-icon.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #8B6B9E;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(45, 27, 61, 0.8);
	color: #F0E6F6;
	text-shadow: 1px 1px #000;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #8B6B9E;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #8B6B9E;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: #2d1b3d;
	color: #F0E6F6;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #2d1b3d;
	border: 1px solid #8B6B9E;
	border-radius: 3px;
	color: #F0E6F6;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #2d1b3d;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #2d1b3d;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #2d1b3d;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #2d1b3d;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}

/* Custom App Styles */
:root {
  --primary: #8B6B9E;
  --secondary: #6B8B9E;
  --accent: #9E8B6B;
  --background: linear-gradient(135deg, #2D1B3D 0%, #1E2A3A 100%);
  --card-bg: rgba(255, 255, 255, 0.08);
  --text: #F0E6F6;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --glow: 0 0 10px rgba(139, 107, 158, 0.5);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 107, 158, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(139, 107, 158, 0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(139, 107, 158, 0.7)); }
  50% { filter: drop-shadow(0 0 15px rgba(139, 107, 158, 0.9)); }
}

@keyframes alertPulse {
  0%, 100% { transform: scale(1); background-color: var(--primary); }
  50% { transform: scale(1.1); background-color: #ff6b6b; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes move-wave {
  0% {
    left: -600px;
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes wave-distort {
  0%, 100% {
    clip-path: polygon(0% 50%, 5% 45%, 10% 60%, 15% 35%, 20% 70%, 25% 40%, 30% 65%, 35% 30%, 40% 75%, 45% 45%, 50% 55%, 55% 60%, 60% 35%, 65% 80%, 70% 25%, 75% 85%, 80% 50%, 85% 65%, 90% 40%, 95% 70%, 100% 50%);
  }
  50% {
    clip-path: polygon(0% 50%, 5% 55%, 10% 40%, 15% 65%, 20% 30%, 25% 60%, 30% 35%, 35% 70%, 40% 25%, 45% 55%, 50% 45%, 55% 40%, 60% 65%, 65% 20%, 70% 75%, 75% 35%, 80% 50%, 85% 45%, 90% 60%, 95% 30%, 100% 50%);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-image: url('bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 27, 61, 0.6);
  z-index: -1;
}

.app-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  gap: 15px;
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}

.header {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  text-align: center;
  margin-bottom: 10px;
  animation: slideIn 0.8s ease-out;
  width: 100%;
}

h1 {
  font-size: 2.2em;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(139, 107, 158, 0.7);
  margin: 5px 0;
  letter-spacing: 1px;
  animation: float 3s ease-in-out infinite;
  font-weight: 300;
}

.subtitle {
  font-size: 1em;
  color: #b0a8b9;
  margin: 0;
  text-align: center;
  font-style: italic;
}

.map-area {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0 auto;
  border-radius: 15px;
  overflow: hidden;
  background: rgba(30, 42, 58, 0.7);
  box-shadow: var(--shadow);
  border: 1px solid rgba(139, 107, 158, 0.3);
  animation: slideIn 0.8s ease-out 0.2s both;
  scroll-margin-top: 20px;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

.alert-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary);
  animation: alertPulse 2s infinite;
  z-index: 1000;
  display: none;
}

.alert-indicator.active {
  display: block;
}

.status-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  animation: slideIn 0.8s ease-out 0.4s both;
}

#gpsStatus, #message, #debugStatus {
  font-size: 0.9em;
  margin: 0;
  padding: 10px;
  background: var(--card-bg);
  border-radius: 10px;
  text-align: center;
  width: 100%;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

#message.success {
  color: #a8d8a8;
  background: rgba(168, 216, 168, 0.1);
  border: 1px solid rgba(168, 216, 168, 0.3);
}

#message.error {
  color: #e6a8a8;
  background: rgba(230, 168, 168, 0.1);
  border: 1px solid rgba(230, 168, 168, 0.3);
}

#message.warning {
  color: var(--accent);
  background: rgba(158, 139, 107, 0.1);
  border: 1px solid rgba(158, 139, 107, 0.3);
}

.tracking-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  animation: slideIn 0.8s ease-out 0.6s both;
}

button, a.footer-link {
  margin: 3px;
  font-size: 0.9em;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  touch-action: manipulation;
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

button::before, a.footer-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before, a.footer-link:hover::before {
  left: 100%;
}

button:hover, a.footer-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.primary-btn {
  padding: 15px 30px;
  font-size: 1.2em;
  background: var(--primary);
  color: #f5f0f7;
  border: 2px solid #9d85ab;
  box-shadow: 0 4px 15px rgba(139, 107, 158, 0.5);
  border-radius: 50px;
  font-weight: bold;
  letter-spacing: 1px;
}

.primary-btn:hover {
  background: #9d85ab;
}

.primary-btn.active {
  background: var(--secondary);
  box-shadow: 0 4px 15px rgba(107, 139, 158, 0.5);
  border-color: #7d9bab;
}

.primary-btn.active:hover {
  background: #7d9bab;
}

.secondary-btn {
  padding: 10px 18px;
  background: var(--secondary);
  color: #f5f0f7;
  border-radius: 8px;
}

.secondary-btn:hover {
  background: #7d9bab;
}

.accent-btn {
  padding: 10px 18px;
  background: var(--accent);
  color: #f5f0f7;
  border-radius: 8px;
}

.accent-btn:hover {
  background: #b39d7d;
}

/* RECORD BUTTON - Full Width (80% of container) */
#recordRelic {
  width: 80%;
  max-width: 400px;
  height: 80px;
  border-radius: 40px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: none;
  background: linear-gradient(135deg, #d9534f, #c9302c);
  color: white;
  font-size: 1.4em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 25px rgba(217, 83, 79, 0.5);
  font-weight: 600;
  margin: 0 auto;
}

#recordRelic.recording {
  background: linear-gradient(135deg, #5cb85c, #449d44);
  box-shadow: 0 5px 25px rgba(92, 184, 92, 0.5);
  animation: pulse 1.5s infinite;
}

#recordRelic:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 30px rgba(217, 83, 79, 0.6);
}

#recordRelic.recording:hover {
  box-shadow: 0 7px 30px rgba(92, 184, 92, 0.6);
}

.record-icon {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
}

.record-icon.stop {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 3px;
}

.btn-text {
  font-weight: 600;
  font-size: 1.1em;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideIn 0.8s ease-out 0.8s both;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card h2 {
  color: var(--secondary);
  text-shadow: 0 0 5px rgba(107, 139, 158, 0.5);
  margin: 0 0 10px 0;
  text-align: center;
  font-size: 1.3em;
  font-weight: 400;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-label {
  flex: 1;
  font-size: 0.9em;
}

.settings-value {
  font-weight: bold;
  color: var(--primary);
  margin: 0 10px;
}

.relics-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}

.relics-list::-webkit-scrollbar {
  width: 5px;
}

.relics-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.relics-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.relic-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 3px solid var(--primary);
}

.relic-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.relic-info {
  flex: 1;
}

.relic-title {
  font-weight: 500;
  margin-bottom: 5px;
  color: #e0d4e9;
}

.main-title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 1.2em;
  font-weight: bold;
  font-variant: small-caps;
  letter-spacing: 1px;
  color: #3e2723;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.relic-details {
  font-size: 0.8em;
  color: #b0a8b9;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.relic-time {
  font-weight: bold;
  color: #e0d4e9;
}

.relic-location {
  font-style: italic;
  color: #b0a8b9;
}

.relic-actions {
  display: flex;
  gap: 5px;
}

.relic-btn {
  padding: 6px 10px;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.relic-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.relic-btn.play {
  background: rgba(107, 139, 158, 0.3);
}

.relic-btn.play:hover {
  background: rgba(107, 139, 158, 0.5);
}

.relic-btn.stop {
  background: rgba(217, 83, 79, 0.3);
}

.relic-btn.stop:hover {
  background: rgba(217, 83, 79, 0.5);
}

.relic-btn.pause {
  background: rgba(255, 193, 7, 0.3);
}

.relic-btn.pause:hover {
  background: rgba(255, 193, 7, 0.5);
}

.relic-btn.show-on-map {
  background: rgba(139, 107, 158, 0.3);
}

.relic-btn.show-on-map:hover {
  background: rgba(139, 107, 158, 0.5);
}

.relic-btn.download {
  background: rgba(139, 107, 158, 0.3);
}

.relic-btn.download:hover {
  background: rgba(139, 107, 158, 0.5);
}

.relic-btn.rename {
  background: rgba(255, 255, 255, 0.1);
}

.relic-btn.rename:hover {
  background: rgba(255, 255, 255, 0.2);
}

.relic-btn.delete {
  background: rgba(217, 83, 79, 0.3);
}

.relic-btn.delete:hover {
  background: rgba(217, 83, 79, 0.5);
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: #b0a8b9;
  font-style: italic;
}

.footer {
  padding: 15px 0;
  display: flex;
  gap: 15px;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  animation: slideIn 0.8s ease-out 1s both;
}

.radar-view, .map-view {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.map-view {
  display: none;
}

.radar-view.active {
  display: block;
}

.map-view.active {
  display: block;
}

.controls.card {
  background: rgba(139, 107, 158, 0.1);
  border: 1px solid rgba(139, 107, 158, 0.3);
  box-shadow: inset 0 0 30px rgba(139, 107, 158, 0.1), 0 4px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.primary-controls {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 5px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.control-group {
  margin-bottom: 20px;
}

.control-group h3 {
  color: var(--secondary);
  font-size: 0.9em;
  font-weight: 600;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.control-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.control-buttons .secondary-btn {
  padding: 10px 12px;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  min-height: 60px;
}

.control-buttons .secondary-btn .icon {
  font-size: 1.2em;
  margin-bottom: 2px;
}

.danger-zone {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(217, 83, 79, 0.3);
}

.danger-zone h3 {
  color: #d9534f;
}

.danger-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #d9534f, #c9302c);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(217, 83, 79, 0.3);
}

.danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 83, 79, 0.5);
  background: linear-gradient(135deg, #c9302c, #a52824);
}

.settings-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.setting-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text);
}

.setting-label .icon {
  margin-right: 8px;
  font-size: 1.1em;
}

.setting-value {
  color: var(--primary);
  font-weight: bold;
  font-size: 0.9em;
}

.setting-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.setting-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.background-waves {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.wave-path {
  position: absolute;
  height: 40px;
  opacity: 0.15;
  animation: move-wave 25s infinite linear, wave-distort 8s infinite ease-in-out;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  mask: linear-gradient(90deg, transparent, white, transparent);
  -webkit-mask: linear-gradient(90deg, transparent, white, transparent);
}

.wave-path:nth-child(1) {
  top: 20%;
  width: 300px;
  animation-duration: 30s;
  animation-delay: 0s;
  transform: rotate(5deg);
  clip-path: polygon(0% 50%, 5% 45%, 10% 60%, 15% 35%, 20% 70%, 25% 40%, 30% 65%, 35% 30%, 40% 75%, 45% 45%, 50% 55%, 55% 60%, 60% 35%, 65% 80%, 70% 25%, 75% 85%, 80% 50%, 85% 65%, 90% 40%, 95% 70%, 100% 50%);
}

.wave-path:nth-child(2) {
  top: 50%;
  width: 400px;
  animation-duration: 35s;
  animation-delay: 8s;
  transform: rotate(-8deg);
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  clip-path: polygon(0% 50%, 4% 60%, 8% 30%, 12% 80%, 16% 20%, 20% 90%, 24% 40%, 28% 70%, 32% 25%, 36% 85%, 40% 35%, 44% 65%, 48% 45%, 52% 55%, 56% 50%, 60% 60%, 64% 35%, 68% 75%, 72% 30%, 76% 80%, 80% 50%, 84% 65%, 88% 40%, 92% 70%, 96% 45%, 100% 50%);
}

.wave-path:nth-child(3) {
  top: 70%;
  width: 350px;
  animation-duration: 40s;
  animation-delay: 15s;
  transform: rotate(12deg);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  clip-path: polygon(0% 50%, 3% 35%, 6% 75%, 9% 25%, 12% 85%, 15% 45%, 18% 65%, 21% 30%, 24% 80%, 27% 50%, 30% 60%, 33% 40%, 36% 70%, 39% 35%, 42% 75%, 45% 55%, 48% 45%, 51% 65%, 54% 30%, 57% 85%, 60% 40%, 63% 60%, 66% 50%, 69% 70%, 72% 25%, 75% 90%, 78% 35%, 81% 65%, 84% 45%, 87% 75%, 90% 30%, 93% 80%, 96% 50%, 100% 50%);
}

.wave-path:nth-child(4) {
  top: 30%;
  width: 250px;
  animation-duration: 28s;
  animation-delay: 5s;
  transform: rotate(-15deg);
  clip-path: polygon(0% 50%, 8% 30%, 16% 80%, 24% 20%, 32% 70%, 40% 40%, 48% 60%, 56% 35%, 64% 75%, 72% 45%, 80% 55%, 88% 50%, 96% 65%, 100% 50%);
}

.wave-path:nth-child(5) {
  top: 10%;
  width: 500px;
  animation-duration: 45s;
  animation-delay: 20s;
  transform: rotate(3deg);
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  clip-path: polygon(0% 50%, 2% 40%, 4% 70%, 6% 30%, 8% 80%, 10% 25%, 12% 85%, 14% 35%, 16% 75%, 18% 45%, 20% 65%, 22% 40%, 24% 70%, 26% 30%, 28% 80%, 30% 50%, 32% 60%, 34% 35%, 36% 75%, 38% 45%, 40% 55%, 42% 50%, 44% 65%, 46% 35%, 48% 85%, 50% 40%, 52% 70%, 54% 30%, 56% 75%, 58% 50%, 60% 60%, 62% 40%, 64% 65%, 66% 35%, 68% 80%, 70% 45%, 72% 55%, 74% 50%, 76% 70%, 78% 25%, 80% 90%, 82% 35%, 84% 65%, 86% 45%, 88% 75%, 90% 30%, 92% 85%, 94% 40%, 96% 60%, 98% 50%, 100% 50%);
}

.relic-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(26, 26, 46, 0.7);
  border-radius: 8px;
  margin: 10px 0;
  font-size: 0.9em;
  min-height: 20px;
}

#gpsStatus {
  flex: 1;
  color: #8B6B9E;
  font-weight: bold;
}

#combinedStatus {
  flex: 1;
  text-align: center; /* Center the text */
  color: #8B6B9E; /* Same color as GPS status */
  font-weight: bold; /* Same bold style */
  display: flex;
  align-items: center;
  justify-content: center; /* Center horizontally */
  gap: 10px;
}

/* Message types - keep the colors for different message types */
#combinedStatus.success { color: #5cb85c; }
#combinedStatus.error { color: #d9534f; }
#combinedStatus.warning { color: #f0ad4e; }
#combinedStatus.debug { color: #6B8B9E; font-style: italic; }
#combinedStatus.playing { color: #8B6B9E; }

/* Queue stop button */
.queue-stop-btn {
  background: rgba(217, 83, 79, 0.3);
  color: #d9534f;
  border: 1px solid #d9534f;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8em;
  cursor: pointer;
  margin-left: 10px; /* Add some space from the text */
}

.queue-stop-btn:hover {
  background: rgba(217, 83, 79, 0.5);
}

.tag-idea {
  background: linear-gradient(135deg, #8B6B9E, #7A5A8C);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tag-memory {
  background: linear-gradient(135deg, #6B8B9E, #5A7A8C);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tag-reminder {
  background: linear-gradient(135deg, #d9534f, #c9302c);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tag-instruction {
  background: linear-gradient(135deg, #9E8B6B, #8D7A5A);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag-filter-btn {
  padding: 10px 16px;
  border: 2px solid var(--primary);
  background: rgba(139, 107, 158, 0.1);
  color: var(--text);
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-filter-btn:hover {
  background: rgba(139, 107, 158, 0.2);
  transform: translateY(-2px);
}

.tag-filter-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 107, 158, 0.4);
}

.tag-filter-btn[data-tag="idea"] { border-color: #8B6B9E; }
.tag-filter-btn[data-tag="memory"] { border-color: #6B8B9E; }
.tag-filter-btn[data-tag="reminder"] { border-color: #d9534f; }
.tag-filter-btn[data-tag="nature"] { border-color: #5cb85c; }
.tag-filter-btn[data-tag="soundscape"] { border-color: #5bc0de; }
.tag-filter-btn[data-tag="instruction"] { border-color: #9E8B6B; }
.tag-filter-btn[data-tag="joy"] { border-color: #FF6B6B; }
.tag-filter-btn[data-tag="peace"] { border-color: #4ECDC4; }
.tag-filter-btn[data-tag="love"] { border-color: #FF6B9D; }
.tag-filter-btn[data-tag="date"] { border-color: #DDA0DD; }
.tag-filter-btn[data-tag="nostalgia"] { border-color: #BA55D3; }
.tag-filter-btn[data-tag="clarity"] { border-color: #00CED1; }
.tag-filter-btn[data-tag="inspiration"] { border-color: #9D50BB; }
.tag-filter-btn[data-tag="sadness"] { border-color: #6A5ACD; }
.tag-filter-btn[data-tag="offer"] { border-color: #FFD700; }
.tag-filter-btn[data-tag="must see"] { border-color: #FF6B6B; }
.tag-filter-btn[data-tag="help"] { border-color: #FF8E53; }
.tag-filter-btn[data-tag="avoid"] { border-color: #6C757D; }
.tag-filter-btn[data-tag="amazing"] { border-color: #9D50BB; }

.tag-filter-btn.active[data-tag="idea"] { background: #8B6B9E; }
.tag-filter-btn.active[data-tag="memory"] { background: #6B8B9E; }
.tag-filter-btn.active[data-tag="reminder"] { background: #d9534f; }
.tag-filter-btn.active[data-tag="nature"] { background: #5cb85c; }
.tag-filter-btn.active[data-tag="soundscape"] { background: #5bc0de; }
.tag-filter-btn.active[data-tag="instruction"] { background: #9E8B6B; }
.tag-filter-btn.active[data-tag="joy"] { background: #FF6B6B; }
.tag-filter-btn.active[data-tag="peace"] { background: #4ECDC4; }
.tag-filter-btn.active[data-tag="love"] { background: #FF6B9D; }
.tag-filter-btn.active[data-tag="date"] { background: #DDA0DD; }
.tag-filter-btn.active[data-tag="nostalgia"] { background: #BA55D3; }
.tag-filter-btn.active[data-tag="clarity"] { background: #00CED1; }
.tag-filter-btn.active[data-tag="inspiration"] { background: #9D50BB; }
.tag-filter-btn.active[data-tag="offer"] { background: #FFD700; color: black; }
.tag-filter-btn.active[data-tag="must see"] { background: #FF6B6B; color: white; }
.tag-filter-btn.active[data-tag="help"] { background: #FF8E53; color: white; }
.tag-filter-btn.active[data-tag="avoid"] { background: #6C757D; color: white; }
.tag-filter-btn.active[data-tag="amazing"] { background: #9D50BB; color: white; }
.tag-filter-btn.active[data-tag="sadness"] { background: #6A5ACD; }

#playbackStatus {
  font-size: 0.9em;
  margin: 0;
  padding: 8px 10px;
  background: rgba(107, 139, 158, 0.2);
  border-radius: 10px;
  text-align: center;
  width: 100%;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(107, 139, 158, 0.3);
  display: none;
}

#playbackStatus.playing {
  display: block;
  color: #a8d8a8;
  background: rgba(168, 216, 168, 0.1);
  border: 1px solid rgba(168, 216, 168, 0.3);
}

.queue-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.queue-stop-btn {
  background: rgba(217, 83, 79, 0.3);
  color: #e6a8a8;
  border: 1px solid rgba(217, 83, 79, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: pointer;
}

.queue-stop-btn:hover {
  background: rgba(217, 83, 79, 0.5);
}

#startTracking {
  padding: 5px 15px;
  font-size: 0.8em;
  background: var(--primary);
  color: #f5f0f7;
  border: 1px solid #9d85ab;
  box-shadow: 0 2px 8px rgba(139, 107, 158, 0.4);
  border-radius: 20px;
  font-weight: 600;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#startTracking:hover {
  background: #9d85ab;
  transform: translateY(-1px);
}

#startTracking.active {
  background: var(--secondary);
  border-color: #7d9bab;
}

.dropdown-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 15px;
  background: var(--card-bg);
}

.dropdown-header {
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
}

.dropdown-header:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-header h2 {
  margin: 0;
  font-size: 1.2em;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
  color: var(--primary);
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

/* Make Utilities dropdown scrollable */
.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height;
}

.dropdown-content.open {
    max-height: 400px; /* Reduced from 500px for mobile */
    overflow-y: auto; /* Add scrolling */
    padding: 0 15px 15px 15px; /* Add padding for scrollbar */
}

/* Custom scrollbar for dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 4px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.dropdown-content .control-group {
  margin-bottom: 20px;
}

.dropdown-content .control-group:last-child {
  margin-bottom: 0;
}

.leaflet-control-attribution {
  display: none !important;
}

.relic-marker {
  background: var(--primary);
  border: 2px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 10px rgba(139, 107, 158, 0.7);
}

.relic-marker.nearby {
  animation: pulse 1.5s infinite;
  background: #ff6b6b;
}

.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 46, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 15px;
}

.loading-spinner {
  color: var(--text);
  font-size: 1em;
  padding: 10px 20px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--primary);
}

.mix-tags .tag-filter-btn {
  padding: 6px 12px;
  font-size: 0.8em;
  margin: 2px;
}

#mixStatus.creating {
  background: rgba(107, 139, 158, 0.2);
  border: 1px solid rgba(107, 139, 158, 0.5);
}

#mixStatus.ready {
  background: rgba(92, 184, 92, 0.2);
  border: 1px solid rgba(92, 184, 92, 0.5);
}

.mix-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.9em;
}

.mix-preview-item .relic-title {
  flex: 1;
  margin-right: 10px;
}

.mix-preview-item .relic-duration {
  color: #b0a8b9;
  font-size: 0.8em;
}

@media (max-width: 600px) {
  .app-container {
    padding: 10px;
    gap: 10px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .map-area {
    height: 250px;
  }
  
  .primary-btn {
    padding: 12px 24px;
    font-size: 1em;
  }
  
  .card {
    padding: 10px;
  }
  
  .relic-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .relic-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .control-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #recordRelic {
    width: 90%;
    height: 70px;
    font-size: 1.2em;
    gap: 12px;
  }
  
  .btn-text {
    font-size: 1em;
  }
  
  .control-buttons .secondary-btn {
    min-height: 55px;
    font-size: 0.8em;
  }
  
  .setting-item {
    padding: 12px;
  }
  
  .setting-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .setting-value {
    align-self: flex-end;
  }
}

@media (max-width: 400px) {
  .control-buttons {
    grid-template-columns: 1fr;
  }
  
  .control-buttons .secondary-btn {
    flex-direction: row;
    justify-content: flex-start;
    min-height: auto;
    padding: 12px 15px;
  }
  
  #recordRelic {
    width: 95%;
    height: 65px;
    font-size: 1.1em;
  }
}

/* NUCLEAR PANEL FIX */
#nearbyRelicsPanel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 85% !important;
    max-width: 350px !important; /* Reduced from 400px */
    max-height: 60vh !important; /* Reduced from 70vh */
    z-index: 10001 !important;
    background: #2D1B3D !important;
    border-radius: 10px !important; /* Slightly smaller radius */
    box-shadow: 0 5px 20px rgba(0,0,0,0.4) !important; /* Smaller shadow */
    border: 1px solid #8B6B9E !important; /* Thinner border */
    display: none !important;
    overflow: hidden !important;
    font-size: 0.9em !important; /* Smaller font throughout */
}

/* Move Close Button to Top-Right */
.panel-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important; /* Align to top */
    padding: 12px 15px !important;
    border-bottom: 1px solid rgba(139, 107, 158, 0.3) !important;
    background: rgba(43, 33, 60, 0.9) !important;
    margin: 0 !important;
    min-height: auto !important;
    position: relative !important; /* For absolute positioning */
}

/* Make the title take full width and center it */
.panel-header h2 {
    margin: 0 !important;
    font-size: 1em !important;
    color: #FFD166 !important;
    font-weight: bold !important;
    text-align: center !important; /* Center the title */
    width: 100% !important; /* Take full width */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 30px !important; /* Add padding for the close button */
}

/* Position Close Button in Top-Right Corner */
.panel-header .close-btn {
    position: absolute !important;
    top: 8px !important; /* Position from top */
    right: 10px !important; /* Position from right */
    background: none !important;
    border: none !important;
    color: #FF6B6B !important;
    font-size: 1.1em !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important; /* Ensure it's above other elements */
}

.panel-header .close-btn:hover {
    background: rgba(255, 107, 107, 0.1) !important;
}

/* Remove any flex properties from close button */
.panel-header .close-btn {
    flex: none !important;
    order: 2 !important; /* Ensure it's after the title */
}


#overlay {
    all: unset !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.95) !important;
    z-index: 2147483646 !important;
    display: none !important;
}

/* When panel should be visible */
#nearbyRelicsPanel[style*="display: flex"],
#nearbyRelicsPanel[style*="display: block"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Recording warning state */
.record-btn.warning {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53) !important;
    animation: pulse-warning 1s infinite;
}

@keyframes pulse-warning {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Recording timer text */
.record-btn .btn-text {
    font-size: 0.9em;
}

/* Stop button style */
.stop-btn {
    background: rgba(217, 83, 79, 0.6) !important;
}

.stop-btn:hover {
    background: rgba(217, 83, 79, 0.8) !important;
}

/* Privacy indicators */
.relic-privacy {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 8px;
}

.relic-privacy.public {
    background: rgba(107, 139, 158, 0.3);
    color: #6B8B9E;
    border: 1px solid #6B8B9E;
}

.relic-privacy.private {
    background: rgba(139, 107, 158, 0.3);
    color: #8B6B9E;
    border: 1px solid #8B6B9E;
}

/* Privacy toggle button */
.relic-btn.privacy-toggle {
    background: rgba(139, 107, 158, 0.2);
}

.relic-btn.privacy-toggle:hover {
    background: rgba(139, 107, 158, 0.4);
}

/* Auto-delete indicator */
.relic-auto-delete {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65em;
    background: rgba(255, 107, 107, 0.2);
    color: #FF6B6B;
    border: 1px solid #FF6B6B;
    margin-left: 5px;
}

/* Different delete button styles for public vs private */
.relic-btn.delete {
    background: rgba(217, 83, 79, 0.3);
}

.relic-btn.delete:hover {
    background: rgba(217, 83, 79, 0.5);
}

/* Social Mode Button States */
#toggleSocialMode {
    transition: all 0.3s ease;
}

#toggleSocialMode.on {
    background: rgba(107, 139, 158, 0.4) !important;
    border: 1px solid #6B8B9E !important;
    color: #6B8B9E !important;
}

#toggleSocialMode.off {
    background: rgba(139, 107, 158, 0.3) !important;
    border: 1px solid #8B6B9E !important;
    color: #8B6B9E !important;
}

/* Android WebView specific fixes */
@media (max-width: 480px) {
    /* Control buttons container */
    .control-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Secondary buttons */
    .secondary-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 10px 12px !important;
        font-size: 14px !important;
        margin: 2px 0 !important;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Primary buttons */
    .primary-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin: 4px 0 !important;
    }
    
    /* Settings controls */
    .settings-controls {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .setting-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 8px 4px !important;
    }
    
    .setting-label {
        font-size: 14px !important;
        padding: 6px 4px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .setting-slider {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 8px 0 !important;
    }
    
    .setting-value {
        font-size: 12px !important;
        min-width: 60px !important;
    }
    
    /* Card padding adjustments */
    .card {
        padding: 12px !important;
        margin: 8px 4px !important;
    }
    
    .card h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    .card h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    /* Control group spacing */
    .control-group {
        margin-bottom: 16px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Social controls specific */
    #findNearbyRelics,
    #toggleSocialMode {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Audio controls */
    #soundToggle {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Utilities dropdown */
    .dropdown-content {
        padding: 8px !important;
    }
    
    .dropdown-content .control-buttons {
        gap: 6px !important;
    }
    
    /* Make sure buttons don't overflow */
    button {
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

/* Additional mobile-specific fixes */
@media (max-width: 360px) {
    .secondary-btn {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
    
    .primary-btn {
        font-size: 15px !important;
        padding: 10px 14px !important;
    }
    
    .setting-label {
        font-size: 13px !important;
    }
}

/* Force WebView to respect viewport */
.app-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

/* Ensure all containers don't overflow */
.primary-controls,
.control-group,
.card.controls {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

.nearby-relic-coords {
    font-size: 0.7em;
    color: #888;
    margin: 5px 0;
    font-family: monospace;
}

/* Panel header actions */
.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Map view button */
.map-view-btn {
    background: rgba(107, 139, 158, 0.3) !important;
    border: 1px solid #6B8B9E !important;
    color: #6B8B9E !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 0.8em !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.3s ease !important;
}

.map-view-btn:hover {
    background: rgba(107, 139, 158, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* Mobile optimization for the new button */
@media (max-width: 480px) {
    .panel-header-actions {
        gap: 6px;
    }
    
    .map-view-btn {
        padding: 5px 8px !important;
        font-size: 0.75em !important;
    }
    
    .map-view-btn .icon {
        font-size: 0.9em;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .map-view-btn {
        padding: 4px 6px !important;
        font-size: 0.7em !important;
    }
    
    .map-view-btn span:not(.icon) {
        display: none; /* Hide text on very small screens */
    }
}

/* Danger buttons in Utilities dropdown */
.danger-btn {
    padding: 12px 16px !important; /* Increased padding for mobile */
    background: linear-gradient(135deg, #d9534f, #c9302c) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(217, 83, 79, 0.3) !important;
    width: 100% !important; /* Full width on mobile */
    margin: 8px 0 !important; /* Add spacing between buttons */
    font-size: 14px !important; /* Ensure readable font size */
    min-height: 44px !important; /* Minimum touch target size */
}

.danger-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(217, 83, 79, 0.5) !important;
    background: linear-gradient(135deg, #c9302c, #a52824) !important;
}

/* Specific styling for the three red buttons */
#utilitiesDropdown .danger-btn {
    background: linear-gradient(135deg, #d9534f, #c9302c) !important;
    border-left: 4px solid #ff6b6b !important;
}

/* Make sure control buttons in utilities are properly spaced */
#utilitiesDropdown .control-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
}

#utilitiesDropdown .control-group {
    margin-bottom: 20px !important;
    width: 100% !important;
}

#utilitiesDropdown .control-group:last-child {
    margin-bottom: 0 !important;
}

/* Mobile-specific utilities panel fixes */
@media (max-width: 600px) {
    .dropdown-card {
        margin-bottom: 10px;
    }
    
    .dropdown-header {
        padding: 15px 18px;
    }
    
    .dropdown-header h2 {
        font-size: 1.1em;
    }
    
    .dropdown-content.open {
        max-height: 350px; /* Smaller max-height on mobile */
        padding: 0 12px 12px 12px;
    }
    
    /* Ensure danger buttons are visible and properly sized on mobile */
    .danger-btn {
        padding: 14px 16px !important; /* Even larger padding for mobile */
        font-size: 15px !important;
        min-height: 48px !important;
    }
    
    /* Stack control buttons vertically in utilities */
    #utilitiesDropdown .control-buttons {
        grid-template-columns: 1fr !important; /* Single column on mobile */
        gap: 12px !important;
    }
    
    /* Make sure all buttons in utilities are full width */
    #utilitiesDropdown .secondary-btn,
    #utilitiesDropdown .danger-btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Better spacing for control groups in utilities */
    #utilitiesDropdown .control-group {
        margin-bottom: 25px !important;
    }
    
    #utilitiesDropdown .control-group:last-child {
        margin-bottom: 15px !important;
    }
}

/* Very small screen adjustments */
@media (max-width: 360px) {
    .dropdown-content.open {
        max-height: 300px;
    }
    
    .danger-btn {
        padding: 12px 14px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .dropdown-header {
        padding: 12px 15px;
    }
    
    .dropdown-header h2 {
        font-size: 1em;
    }
}

.like-btn.liked {
    background: rgba(217, 83, 79, 0.6) !important;
    color: white !important;
    font-weight: bold;
}