* {
  box-sizing: border-box;
}

@font-face {
  font-family: 'Fantasque Sans Mono';
  src: url('/static/fonts/FantasqueSansMono-Regular.woff2') format('woff2'),
       url('/static/fonts/FantasqueSansMono-Regular.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */
       url('/static/fonts/FantasqueSansMono-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('/static/fonts/FantasqueSansMono-Regular.svg#FantasqueSansMono-Regular') format('svg'); /* Chrome < 4, Legacy iOS */
  font-weight: 400;
  font-style: normal;
}

html, body {
  margin: 0;
  padding: 0;
  background: #222;
  font-size: 0.85em;
  font-family: 'Fantasque Sans Mono', monospace;
  color: #fff;
}

#stage {
  display: flex;
}

#listing {
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
}
#listing li {
  font-size: 2em;
  margin-bottom: 1em;
}

#overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 20;
}
#intro {
  margin: 2em auto;
  max-width: 480px;
  background: #fff;
  color: #000;
  padding: 1em 2em;
  max-height: 80vh;
  overflow-y: scroll;
}
#intro li {
  list-style-type: disc;
  margin: 0.5em 0 0 1em;
}
.help li {
  list-style-type: none !important;
  margin: 0.5em 0 0 0 !important;
}
#intro ul {
  margin-bottom: 2em;
}
#intro button {
  display: block;
  margin: 0.5em auto 0;
}
#intro a, #intro a:visited {
  color: blue;
}

#map {
  height: 100vh;
  flex: 1;
}

#bar {
  height: 100vh;
  width: 320px;
  background: #222;
  color: #fff;
  display: flex;
  flex-direction: column;
}
#log {
  flex: 1;
  overflow-y: scroll;
}
.logs {
  display: none;
}
.logs.selected {
  display: block;
}
#log-tabs {
  display: none;
  /* display: flex; */
  margin-bottom: 0.5em;
}
.log-tab {
  flex: 1;
  text-align: center;
  padding: 0.25em;
  background: #3c3c3c;
  color: #989898;
  cursor: pointer;
}
.log-tab.selected {
  background: #222222;
  color: #fff;
}
#pinned-log {
  display: none;
  position: relative;
  border-bottom: 1px solid #444;
}
#pinned-log-text {
  padding: 1em;
}
#pinned-hide {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  cursor: pointer;
  font-size: 1.2em;
}
#pinned-hide:hover {
  text-decoration: underline;
}

.no-log {
  text-align: center;
  padding: 1em 0.5em;
  display: none;
}
#info {
  font-size: 0.8em;
  padding: 0 1em 0.25em 1em;
  border-top: 1px solid #444;
}
#info div {
  margin: 0.7em 0px;
}
#info #info-body img,
#intro-info img {
  vertical-align: middle;
  max-height: 32px;
}
#info #info-toggle {
  margin: 0;
  line-height: 1;
  text-align: center;
  padding: 0.25em 0;
  color: #ccc;
  cursor: pointer;
}
#info #info-toggle:hover {
  background: #333;
}
a, a:visited {
  color: #aaa;
}

#add {
  text-decoration: underline;
  color: #43CC70;
  cursor: pointer;
}

#append {
  position: fixed;
  bottom: 1em;
  left: 1em;
  display: none;
  min-width: 280px;
  z-index: 10;
  border: 1px solid black;
}
#append-tabs {
  display: flex;
}
.append-tab {
  flex: 1;
  padding: 0.5em;
  text-align: center;
  background: #EAE6E0;
  color: #969696;
  cursor: pointer;
}
.append-tab.selected {
  background: #fff;
  color: #000;
}
#append-form {
  background: #fff;
  color: #000;
  padding: 0.5em;
}
#append-form input {
  display: block;
  width: 100%;
  margin: 0.5em 0 0 0;
}
#append-form input[type=file] {
  width: auto;
  display: inline-block;
}
#append-form input[type=submit] {
  margin-bottom: 0.5em;
}
#append-form label {
  display: inline-block;
}
#location-search-field {
  display: flex;
}
#location-search-field input {
  flex: 1;
  margin-bottom: 0;
}
#location-search {
  cursor: pointer;
  padding: 0.35em;
  margin-top: 0.5em;
}
#coord-results {
  color: #000;
  font-size: 0.8em;
  margin: 0.5em 0;
}
#coord-results li {
  cursor: pointer;
}
#coord-results .selected {
  color: blue;
}
#coordinates {
  font-size: 0.6em;
  border: none;
  margin-top: 0;
  /* Debugging */
  /* display: none !important; */
}
#coordinates-type {
  display: flex;
  justify-content: space-between;
}
#coordinates-type ul {
  display: inline-block;
}
#coordinates-type li {
  display: inline-block;
  cursor: pointer;
}
#coordinates-type li:hover {
  text-decoration: underline;
}
#coordinates-type li.selected {
  font-weight: bold;
  text-decoration: underline;
}
#coordinates-type--hint {
  font-size: 0.7em;
  line-height: 1.5;
}
#coordinates-type--hint div {
  display: none;
  margin-left: 1.5em;
}
#coordinates-type--hint div.selected {
  display: block;
}

#show-help {
  text-align: right;
  font-size: 0.75em;
  text-decoration: underline;
  cursor: pointer;
  color: #000;
}
.extra-info {
  display: flex;
}
.hint {
  display: none;
  font-size: 0.8em;
  flex: 1;
}

#error {
  background: red;
  color: #fff;
  padding: 0.25em 0.5em;
  font-size: 0.8em;
  display: none;
}
#status {
  background: #303030;
  color: #fff;
  padding: 0.25em 0.5em;
  font-size: 0.8em;
  display: none;
}

#auth-status {
  background: red;
  color: #fff;
  padding: 1.25em 1.5em;
  font-size: 0.8em;
  display: none;
  position: fixed;
  top: 20px;
  height: auto;
  width: 100%;
  text-align: center;
  width: 30%;
  left: 50%;
  margin-left: -15%;
}

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

select {
  width: 100%;
}

.marker {
  background-color: red;
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  cursor: pointer;
  color: #000;
  font-size: 1.75em;
}
.marker-preview {
  width: 16px;
  height: 16px;
  background-color: yellow;
  border: 4px solid black;
  pointer-events: none;
}
.marker-camera {
  background-color: transparent;
  width: 18px;
  height: 18px;
  background-image: url('/static/camera.png');
  background-size: cover;
}
.marker-helicopter {
  background-color: transparent;
  width: 28px;
  height: 28px;
  background-image: url('/static/helicopter.png');
  background-size: cover;
}

.logitem {
  display: flex;
  padding: 0.5em 1em;
}
.logitem-log {
  flex: 1;
}
.logitem-when {
  font-size: 0.8em;
  text-decoration: underline;
}
.logitem-meta {
  font-size: 0.8em;
}
.logitem-coords {
  display: none;
  font-size: 0.7em;
  border: none;
  background: none;
  color: yellow;
  width: 100%;
}
.logitem-text-input,
.logitem-label-input,
.logitem-location-input,
.logitem-location-edit-cancel {
  display: none;
}
.logitem-label-input {
  margin-right: 5em;
}
.logitem-label-edit-cancel {
  padding: 0.75em 0.5em;
}
.logitem-location-input {
  font-size: 0.8em;
}
.logitem .delete-log {
  display: none;
  cursor: pointer;
}
.logitem[data-permit=true] .delete-log {
  display: block;
}
.logitem[data-permit=true]:hover {
  background: #2f2f2f;
}

.popup-location {
  font-size: 0.8em;
  text-decoration: underline;
  line-height: 1.2;
}
.popup-label {
  font-size: 0.9em;
  line-height: 1.1;
  background: #222222;
  color: #fff;
  padding: 0.25em;
  display: inline-block;
  border-radius: 0.2em;
  margin: 0.25em 0;
}
.popup-when {
  font-size: 0.9em;
  line-height: 1;
}
.popup-log h3 {
  margin: 0;
  font-weight: normal;
}
.popup-log {
  margin-bottom: 1em;
}
.popup-log:last-child {
  margin-bottom: 0;
}
.popup-log img {
  max-width: 100%;
}

.mapboxgl-popup-content {
  color: #000;
  max-height: 50vh;
  overflow-y: auto;
}

#toggles > div {
  display: inline-block;
  padding: 2px;
  border: 1px solid #414141;
  margin: 0.25em 0;
}
#toggles input {
  margin: 0;
  vertical-align: middle;
}

#panel {
  max-width: 640px;
  margin: 0 auto;
}
#panel h2 {
	margin: 1em 0;
	border-top: 1px solid #fcb;
	padding-top: 1em;
}
#panel #key {
  display: block;
  margin: 1em auto;
}
#panel #manage-keys {
  text-align: center;
}
#panel #keys {
  padding: 2em;
}
#panel .key-prime {
  color: #ffcb00;
}
#panel #manage-labels {
  text-align: center;
}
#panel #labels {
  padding: 0 2em 2em 2em;
}
#panel #labels .hidden {
  opacity: 0.25;
}
#panel #icon,
#panel .edit-label-icon {
  width: 2em;
  text-align: center;
}
#panel .edit-label-icon {
  margin-right: 0.5em;
  border: none;
  border-bottom: 1px solid #303030;
  background: #282828;
}
#panel-main {
  display: none;
}
.hide-label {
  margin: 0 0.5em;
  display: inline-block;
}
.revoke-key {
  margin-left: 0.5em;
  display: inline-block;
}
#pinned {
  width: 50%;
  display: block;
  margin: 3em auto 1em auto;
  min-height: 100px;
  padding: 0.5em;
}
#panel-logs #logs {
  padding: 2em;
}
#panel-logs #logs li p {
	text-indent: -1.5em;
	padding-left: 1em;
	margin: 0 0 0.5em;
}
#panel-logs h4 {
  text-align: center;
  margin: 2em 0 0 0;
  border-top: 1px solid #fcb;
  padding-top: 2em;
  color: #43CC70;
}
.actions {
  text-align: center;
}
.action {
  cursor: pointer;
  text-align: center;
  color: #888;
}
.action:hover {
  color: #43CC70;
}
.actions .action {
  color: #fff;
  margin: 0 0.5em;
  border-bottom: 1px solid #fff;
}
.actions .action:hover {
  color: #fff;
  border-bottom: 1px solid #43CC70;
}
#panel-errors {
  display: none;
  background: red;
  color: #fff;
  text-align: center;
  width: 100%;
  padding: 0.5em 1em;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}
#set-pinned-status {
  text-align: center;
}

#legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.mapboxgl-popup-content img {
  max-height: 50vh;
}

@media only screen and (max-width: 680px) {
  #stage {
    display: block;
  }
  #map {
    height: 50vh;
  }
  #bar {
    width: 100%;
    max-width: 100%;
    height: 50vh;
  }
  #log {
    width: 100%;
  }

  .mapboxgl-popup-content img {
    max-height: 30vh;
  }
}
