html, body {
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

h2, p, a, img {
  margin: 0;
  padding: 0;
}

#main {
  height: 100%;
  display: flex;
}

#side {
  flex-direction: column;
  width: 500px;
  padding: 20px;
  display: flex;
}

#side-profile {
  flex-direction: column;
  width: 600px;
  padding: 20px;
  display: flex;
}

#map {
  flex: 1;
}

#code {
  font-size: 12px;
}

#cards {
  gap: 20px;
  width: 100%;
  display: none;
}

#card {
  border: 1px solid #d3d3d3;
  border-radius: 5px;
  width: 80%;
  text-decoration: none;
}

#previous, #next {
  cursor: pointer;
  background-color: #000;
  border-style: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: auto 0;
  padding: 5px 10px;
}

#previous[disabled], #next[disabled] {
  cursor: unset;
  background-color: #d3d3d3;
}

#previous {
  transform: rotate(180deg);
}

.card-img {
  object-fit: cover;
  vertical-align: top;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  width: 100%;
  height: 240px;
}

.card-info {
  color: #000;
  flex-direction: column;
  justify-content: space-between;
  display: flex;
}

.card-properties {
  grid-column-gap: 6px;
  grid-row-gap: 6px;
  grid-template-columns: repeat(2, 1fr);
  display: grid;
}

.card-properties pre {
  margin: 0;
}

.card-facts {
  width: 100%;
  height: 60px;
  display: flex;
}

.fact {
  color: #000;
  border-top: 1px solid #d3d3d3;
  justify-content: center;
  align-items: center;
  width: 25%;
  height: 60px;
  font-size: 14px;
  display: flex;
}

.fact:not(:first-child) {
  border-left: 1px solid #d3d3d3;
}

#save, #new_line, #delete_line {
  cursor: pointer;
  background-color: #fbc200;
  border-style: none;
  border-radius: 5px;
  width: 100%;
  margin-top: 40px;
  padding: 5px 10px;
}

#new_line, #delete_line {
  width: initial;
}

#load-hiking, #import-gpx-kml {
  gap: 5px;
  width: 100%;
  margin-top: 15px;
  display: flex;
}

#gpx-kml-file {
  background-color: #eee;
  flex: 1;
}

#hiking-uuid {
  flex: 1;
}

#distance-info {
  margin-top: 5px;
  font-size: small;
}

h2 {
  margin-top: 30px;
  font-size: medium;
}

#filter-input {
  margin-top: 10px;
}

.hiking-facts, #stopovers .stopover {
  border: 1px solid #ccc;
  margin: 4px 0;
  padding: 10px;
}

#stopovers .stopover:hover {
  background-color: #f9f9f9;
}

#filters {
  padding-bottom: 40px;
}

.hiking-facts, .stopover {
  border: 1px solid #ccc;
  margin: 12px;
  padding: 6px;
}

.hiking-facts > *, .stopover > * {
  padding: 6px;
}

.hiking-facts label, .stopover .features label {
  display: block;
}

.statistics-container {
  flex-direction: column;
  display: flex;
}

.statistics-container > button {
  height: 100%;
}

.modal {
  z-index: 1;
  background-color: #fff;
  border: 1px solid #888;
  margin-top: 30px;
  padding: 20px;
  display: none;
  position: absolute;
}

.modal.show {
  display: block;
}

.btns-container {
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  display: flex;
}

.btns-container > * {
  height: 40px;
}

.btns-container > #save {
  width: auto;
  margin: 0;
}

.hiking-facts-header {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

#results {
  overflow-y: auto;
}

@media (width <= 950px) {
  #main {
    flex-direction: column-reverse;
    height: 100%;
  }

  #map {
    height: 70%;
  }

  #side, #side-profile {
    box-sizing: border-box;
    width: 100%;
    height: 30%;
  }

  #cards {
    width: 100%;
    padding-bottom: 40px;
    position: relative;
  }

  #card {
    width: 100%;
  }

  #previous {
    position: absolute;
    top: 25%;
    left: 10px;
  }

  #next {
    position: absolute;
    top: 25%;
    right: 10px;
  }

  .btns-container {
    flex-wrap: wrap;
    padding-bottom: 20px;
  }

  .hiking-facts, .stopover {
    margin: 0;
  }
}

.result-header {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.result-title-line {
  justify-content: space-between;
  align-items: top;
  display: flex;
}

.result-basic-info {
  color: #666;
  align-items: center;
  gap: 15px;
  font-size: .9em;
  display: flex;
}

.result-uuid {
  background-color: #f5f5f5;
  border-radius: 3px;
  width: fit-content;
  padding: 2px 6px;
  font-family: monospace;
  font-size: .85em;
}

.result-type {
  color: #bd9202;
  background-color: #f7e7b0;
  border-radius: 12px;
  width: fit-content;
  padding: 2px 8px;
  font-size: .8em;
  font-weight: 500;
}

.result-item-checkbox {
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  border: 2px solid #fbc200;
  border-radius: 3px;
  width: 16px;
  height: 16px;
  position: relative;
}

.result-item-checkbox:checked {
  background-color: #fbc200;
}

.result-item-checkbox:checked:after {
  content: "✓";
  color: #333;
  font-size: 12px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

input[type="checkbox"]:not(.result-item-checkbox) {
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  border: 2px solid #fbc200;
  border-radius: 3px;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  position: relative;
}

input[type="checkbox"]:not(.result-item-checkbox):checked {
  background-color: #fbc200;
}

input[type="checkbox"]:not(.result-item-checkbox):checked:after {
  content: "✓";
  color: #333;
  font-size: 10px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.result-checkbox {
  margin: 8px 0;
}

.toggle-details {
  color: #495057;
  cursor: pointer;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: .9em;
  transition: background-color .2s, border-color .2s;
}

.toggle-details:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.result-details {
  border-top: 1px solid #eee;
  margin-top: 10px;
  padding-top: 10px;
}

.result-details p {
  margin: 5px 0;
  font-size: .9em;
}

.result-description {
  margin: 10px 0;
}

.result-description p {
  color: #555;
  line-height: 1.4;
}

.result-filters {
  margin-top: 10px;
}

.filter-item {
  margin: 3px 0;
  font-size: .85em;
  display: flex;
}

.filter-item span:first-child {
  color: #666;
  min-width: 120px;
}

.filter-value {
  color: #333;
  font-weight: bold;
}
