:root {
	--safe-area-top: env(safe-area-inset-top, 0px);
}

html, body {
	margin: 0;
	padding: 0;
	background: #F5F5F7;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: black;
	-webkit-user-select: none;
	user-select: none;
	cursor: default;
	-webkit-touch-callout: none;
}

.hide, .hidden {
	display: none !important;
}

.fade-hide {
	transition: opacity 0.5s ease-in-out;
	opacity: 0;
}

#passkeylist div div {
	overflow-wrap: break-word;
}

#passkeylist .removepasskeylink {
	font-size: 18px;
	color: darkred;
}

#passkeylist .active-passkey {
	background: rgb(215, 238, 215);
}

#passkeylist .active-passkey-message {
	font-weight: bold;
	display: block;
	font-size: 20px;
	margin-bottom: 8px;
	color: rgb(0, 125, 0);
}

.error-msg,
.error-msg p {
	color: #FF3B30 !important;
	background: rgb(255, 190, 190) !important;
}

.red, .destructive {
	color: darkred;
}

.text-selectable, .leaflet-popup, #about p span {
	-webkit-user-select: text;
	user-select: text;
	cursor: text;
}

.qrcode {
	-webkit-user-select: all;
	user-select: all;
	-webkit-touch-callout: initial;
}

.bottom-spacer {
	margin-bottom: 15px;
}

.tab-bar-spacer {
	height: calc(80px + env(safe-area-inset-bottom));
	display: none;
}

.loader {
    display: none;
    width: 100px;
    height: 100px;
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
	margin-top: 15px;
}

#main-loader {
	position: absolute;
	top: 0;
	right: 20px;
	width: 25px;
	height: 25px;
}

#refresh-button {
	position: absolute;
	font-size: 75px;
	top: -12px;
	right: 30px;
	color: rgb(96, 96, 96);
	transform: rotate(270deg);
}

#previous-location-loader, #events-loader {
	display: block;
	backdrop-filter: blur(5px);
	position: absolute;
	right: 5vw;
	height: 45px;
	width: 45px;
}

#main-loading {
	display: block;
	backdrop-filter: blur(5px);
	position: absolute;
	right: 5vw;
	height: 45px;
	width: 45px;
}

div#geofence-editor {
	display: none;
}

#lastupdateraw {
	display: block;
}
        
@keyframes spin {
	0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
            
            
#map {
	/*min-height: 500px;*/
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1px;
	z-index: 1;
}

.leaflet-container {
  border-radius: 12px;
}

.leaflet-control a {
	-webkit-touch-callout: none;
}

#loadingdiv {
  position: absolute;
  top: 10px;                /* distance from top */
  left: 50%;                /* centre horizontally */
  transform: translateX(-50%);
  animation: fadeAnim 0.1s;
  font-weight: bold;
  font-size: 24px;
  backdrop-filter: blur(8px);
}

#loadingdiv.error-msg {
	right: inherit;
}



.animatedhide {
	animation: reversefadeAnim 0.1s !important;
	animation-fill-mode: forwards !important;
}

p {
	font-size: 22px;
	margin: 8px;
}

div {
/* 	animation: fadeAnim 1s; */
}

p,
div.group,
div#notification-bar div#notification-text, p {
	border: 1px solid #D1D1D6;
	padding: 15px;
	background: #FFFFFF;
	margin: 8px;
	font-size: 18px;
	border-radius: 28px;
}

div#about p {
	font-size: 22px;
}

h1 {
	text-align: center;
	background: #FFFFFF;
	margin: 0;
	padding: 16px;
	color: #1C1C1E;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	font-family: Helvetica Neue;
	min-height: 72px;
	box-sizing: border-box;
	border-bottom: 1px solid #D1D1D6;
}

p#currentlocationtext {
   display: none !important;
}

p, form, div, label, input, button {
	text-align: center;
	display: block;
	margin: auto;
	color: black;
}

span#mfa-status {
	font-weight: bold;
}

#remove-geofence-button {
	color: #c50303;
}

label {
	font-size: 35px;
	margin: 8px;
}

input, select {
	font-size: 28px;
	border-radius: 5px;
	border: 1px solid #D1D1D6;
	transition: border 1s ease;
	height: 60px;
	background: #F5F5F7;
}

input {
	width: 75%;
}

select {
	width: 95%;
}

input:focus {
	border: 1px solid #007AFF;
	outline: none;
}

.previous-marker {
	filter: hue-rotate(120deg);
}

#previous-locations-container {
	display: none;
}

.logtab {
	display: none;
	background: #f5f5f5;
	padding: 2px;
	border-radius: 8px;
	margin: 8px;
	border: 1px solid #D1D1D6;
	min-height: 200px;
}

.logtab.show {
	display: block;
}

#button-container, #button-container button {
	display: flex;
}

#button-container button {
	flex: 1;
	justify-content: center;
	color: black;
	background: rgb(241, 241, 241);
	margin: 5px;
	transition: background 0.5s ease;
}

#button-container button:hover {
	background: #fcfcfc;
}

#button-container .log-tab-button {
	transition: background 0.5s ease;
}

#button-container .log-tab-button.selected {
	font-weight: bold;
	background: rgba(255, 255, 255, 0.62) !important;
}

.event-log-entry {
  margin: 0 auto 12px auto; 
  padding: 12px;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-timestamp {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.event-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827; 
  margin-bottom: 6px;
}

.event-message {
  font-size: 0.95rem; 
  color: #374151; 
  line-height: 1.5;
}

.event-log-entry div {
	padding: 5px;
	text-align: left;
	font-size: 18px;
}

.event-log-entry div.event-timestamp {
	font-weight: bold;
}

.event-log-entry div.event-message {
	margin-left: 15px;
}

.event-log-entry div.event-title {
	text-decoration: underline;
}
 
button, select, a.fancy {
	outline: none;
	border: 1px solid #D1D1D6;
	padding: 8px;
	font-size: 35px;
	border-radius: 8px;
	background: #FFFFFF;
	margin-top: 8px;
	cursor: pointer;
	color: #0052ac;
}

a.fancy {
	display: block;
	margin: 15px;
	text-decoration: none;
	
}

table {
	width: 95%;
	table-layout: fixed;
    word-wrap: break-word;
    color: #1C1C1E;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin: auto;
    border: 1px solid #e9e9e9;
    padding: 4px;
    margin: 10px auto;
}

table tr th, table tr td {
	padding: 8px;
	word-wrap: break-word;
    word-break: break-word;
}

table thead {
	background: #F5F5F7;
	color: #1C1C1E;
}

table tbody tr {
	background: #FFFFFF;
	cursor: pointer;
	transition: background 0.5s ease;
	padding: 12px;
}

table tbody tr:nth-child(odd) {
	background: #FAFAFA;
}

table tbody tr:hover {
	background: #E5E5EA;
}

a {
	color: #6b8e96;
}

#tab-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 5px rgba(187, 187, 187, 0.1);
    z-index: 1000;
	margin-bottom: 7px;
	border-radius: 28px;
	padding: 4px;
	transform: translateZ(0);
    will-change: transform;
}

@keyframes fadeAnim {
	from { opacity: 0; backdrop-filter: blur(5px); }
	to { opacity: 1; backdrop-filter: blur(5px); }
}

@keyframes reversefadeAnim {
	from { opacity: 1; backdrop-filter: blur(5px); }
	to { opacity: 0; backdrop-filter: blur(5px); }
}

@keyframes fade-out-and-in {
	0% { opacity: 1; }
	50% { opacity: 0; }
	100% { opacity: 1; }
}

.do-fade {
	animation: fade-out-and-in 0.5s;
}

.tab {
	display: none;
}

.tab:not(#map-tab) {
	width: 97%;
	margin: auto;
}

.tab.show,
.logtab.show {
	display: block;
	animation: fadeAnim 0.2s ease;
}

.tab-button {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 14px;
    color: #555;
    background: none;
    border: none;
    outline: none;
    transition: color 0.3s ease-in-out, background 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 28px;
    text-shadow: 0 0 2px rgba(111, 111, 111, 0.5);
}

@media (hover: hover) {
	.tab-button:hover {
		background-color: rgba(248, 248, 248, 0.4);
	}
}

.tab-button.selected {
    /*color: #007AFF;*/
/*     background: rgb(230, 230, 230); */
    font-weight: bold;
	background: rgba(198, 198, 198, 0.4) !important;
	color: #007AFF;
}

.tab-button.selected i {
	/*filter: invert(9%) sepia(90%) saturate(2000%) hue-rotate(210deg) brightness(105%) contrast(105%);
	text-shadow: 0 0 2px rgba(85, 170, 255, 0.5);*/
	filter: invert(9%) sepia(80%) saturate(3916%) hue-rotate(201deg) brightness(82%) contrast(94%);
}

.tab-button i {
    font-size: 24px;
    margin-bottom: 4px;
}

#displayfor {
	margin-bottom: 5px;
	display: none;
}

.leaflet-control-toggle {
	background-color: white;
	padding: 10px;
	border-radius: 4px;
	box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.65);
	font-family: Arial, sans-serif;
}

.leaflet-control-attribution {
	z-index: 2;
}

.toggle-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 18px;
	margin: auto;
}

.toggle-switch input {
	display: none;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: 0.4s;
	border-radius: 25px;
}

.slider:before {
	position: absolute;
	content: "";
	height: 14px;
	width: 18px;
	left: 2px;
	bottom: 2px;
	background-color: white;
	transition: 0.4s;
	border-radius: 50%;
}

input:checked + .slider {
	background-color: #4CAF50;
}

input:checked + .slider:before {
	transform: translateX(20px);
}

.leaflet-popup-content, .leaflet-control-toggle, .leaflet-popup-content-wrapper, p, button, div#tab-buttons, .leaflet-control-zoom, .leaflet-control-zoom a, .leaflet-popup-tip {
	background: none !important;
	border-radius: 28px !important;
	backdrop-filter: blur(5px);
}

.leaflet-popup, .leaflet-popup-content-wrapper {
	background-color: rgba(255, 255, 255, 0.5) !important;
	border-radius: 28px;
}

.leaflet-popup-tip {
	border-radius: inherit !important;
}

.leaflet-container a.leaflet-popup-close-button {
	margin-right: 8px;
	margin-top: 5px;
	padding: 5px;
	border: 1px solid rgb(209, 209, 209);
	border-radius: 28px;
	backdrop-filter: blur(5px);
	font-size: 20px;
	color: rgb(140, 140, 140);
}

.leaflet-control-zoom {
	border-width: 1px !important;
}

@media (prefers-color-scheme: dark) {
	html, body, h1, #loadingdiv, #loadingdiv p, div.group, div.group div, #tab-buttons, h2, p, form, label, input, button, .leaflet-popup, .leaflet-popup-content-wrapper, .leaflet-popup-content, .leaflet-popup-tip, .leaflet-control-toggle {
		background: #1C1C1E;
		color: white;
	}
	
	.leaflet-popup, .leaflet-popup-content-wrapper, .leaflet-popup-content, .leaflet-popup-tip, .leaflet-control-toggle {
		background: none !important;
	}
	
	#passkeylist .active-passkey {
		background: rgba(10, 27, 10, 1);
	}
	
	#passkeylist .removepasskeylink {
		color: rgb(255, 149, 149);
	}
	
	h1 {
		border-bottom-color: #3f3f3f;
	}
	
	.logtab {
		background: rgb(23, 23, 23);
	}
	
	#button-container .log-tab-button {
		background: rgb(52, 52, 52);
		color: white;
	}
	
	#button-container .log-tab-button:hover {
		background: rgba(87, 87, 87, 0.62) !important;
		color: white;
	}
	
	#button-container .log-tab-button.selected {
		background: rgba(99, 99, 99, 0.62) !important;
	}
	
	.event-log-entry {
		background: #282828;
	}
	
	.event-timestamp {
		color: #9ca3af;
	}
	
	.event-title {
		color: #f3f4f6;
	}
	  
	.event-message {
		color: #d1d5db;
	}
	
	table thead {
		background: #4d4d4d;
		color: white;
	}
	
	table tbody tr:nth-child(odd) {
		background: #5c5c5c;
	}
	
	table tbody tr {
		background: #747474;
		color: white;
	}
	
	table tbody tr:hover {
		background: #2d2d2d;
	}
	
	div#about p {
		background: #262626;
	}
	
	#tab-buttons {
		border-top-color: black;
	}
	
	.tab-button {
		color: white;
	}
	
	.tab-button.selected {
		background-color: rgba(221, 221, 221, 0.4) !important;
		color: #acd4ff;
	}
	
	@media (hover: hover) {
		.tab-button:hover {
			background-color: #2c2c2c;
		}
	}
	
	p, div.group {
		border-color: #575757;
	}
	
	button, select, a.fancy {
		background: #535358;
		color: white;
	}
}