*, *::before, *::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
  font-family: 'Trebuchet MS', Arial, sans-serif;
}


nav {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 1rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
}

.nav-btn {
  padding: 10px 20px;
  background-color: #14532d;
  color: white;
  border-radius: 20px;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 0.9rem;
  margin-left: auto;
}

.nav-btn:hover {
  background-color: #166534;
  transform: scale(1.05);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

html {
  scroll-behavior: smooth;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

#rating-filter,
#toggle-filters {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  font-size: 0.8rem;
  height: 20px;
}

.hidden-filter {
  display: none;
}

.weather-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  color: white;
  margin-top: 5px;
}

.nav-list {
  list-style-type: none;
  display: flex;
}

body {
  background-color: #fff;
}

.bakgrundsvideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.framsida {
  position: relative;
  text-align: center;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.bakgrundsvideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.framsida h1 {
  font-size: 4rem;
  margin-bottom: 5px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.framsida h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.discovernowbtn {
  padding: 20px 30px;
  font-size: 1.5rem;
  color: #fff;
  background-color: #14532d;
  text-decoration: none;
  border-radius: 30px;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.discovernowbtn:hover {
  background-color: #166534;
  transform: scale(1.05);
}

.scroll-down-indicator {
  text-align: center;
  margin-top: 1rem;
}

.scroll-down-indicator {
  text-align: center;
  margin-top: 1.5rem;
}

.scroll-down-indicator img {
  width: 32px;
  height: auto;
  display: inline-block;
  animation: bounce 2s infinite;
  opacity: 0.8;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(6px);
  }
  60% {
    transform: translateY(3px);
  }
}

#golfkarta {
  width: 80%;
  max-width: 1000px;
  margin-bottom: 60px;
  height: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 12px;
  padding: 1rem;
}

#map {
  height: 80vh;
  width: 80%;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 1;
  border: 3px solid black;
}

#search-container {
  position: absolute;
  top: px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 230px;
  height: 200px;
  margin-top: 10px;
  font-family: 'Trebuchet MS', sans-serif;
  min-height: auto;
  height: auto;
  transition: height 0.3s ease;
}

#search-container input[type="text"],
#search-container input[type="range"] {
  width: 95%;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}

#search-btn {
  background-color: #14532d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
}

#search-btn:hover {
  background-color: #166534;
}

input[type="range"] {
  width: 100%;
}

#location-input {
  padding: 6px;
  width: 50%;
}

#distance-select {
  width: 60px;
  font-size: 0.7rem;
}

#info-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 20px;
}

#main-title {
  color: white;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 1.8rem;
}

#info-sektionen {
  font-size: 1.3rem;
  line-height: 1.3;
  max-width: 600px;
  text-align: center;
  color: white;
  border-radius: 10px;
  padding: 10px;
}

#nederdel {
  padding: 2rem 1rem;
  background-color: black;
  color: white;
  width: 100%;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.6;
  font-family: system-ui, sans-serif;
}

.andrasida {
  background-color: #14532d;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

#loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
}

.spinner {
  border: 6px solid #ccc;
  border-top: 6px solid #14532d;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

#greenquestlogo {
  height: 60px;
}

#route-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  transition: right 0.3s ease-in-out;
  overflow-y: hidden;
  display: none;
}

#route-panel.open {
  right: 0;
  display: block;
}

#route-panel-inner {
  padding: 1rem;
  font-family: 'Trebuchet MS', sans-serif;
}

#route-panel h3 {
  margin-bottom: 1rem;
}

#route-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

#route-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #ccc;
}

.route-count {
  display: inline-block;
  color: white;
  font-size: 0.90rem;
  font-weight: bold;
  line-height: 1;
  padding: 2px;
  vertical-align: top;
}

#close-panel {
  background-color: #14532d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

#route-feedback {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #166534;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-family: 'Trebuchet MS', sans-serif;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 3000;
}

#route-feedback.show {
  opacity: 1;
}

#route-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#route-popup-inner {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.popup-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.popup-add-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 20px;
}

.popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #14532d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background-color 0.3s ease;
  width: 250px;
}

.popup-btn:hover {
  background-color: #166534;
}

.info-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  font-size: 0.75rem;
  line-height: 1;
}

#route-popup-map {
  height: 300px;
  width: 100%;
}

#route-summary {
  font-size: 1rem;
}

.route-item {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: #f0f0f0;
  border-radius: 8px;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-item:active {
  cursor: grabbing;
}

.remove-course {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.remove-course img.remove-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  pointer-events: auto;
  display: block;
}

.remove-course:hover img.remove-icon {
  opacity: 1;
}

.remove-course:hover {
  background-color: rgba(255, 0, 0, 0.1);
}

#star {
  width: 12px;
}

#effort {
  width: 12px;
}

#clock {
  width: 12px;
}

#search {
  width: 12px;
}

#temprature {
  width: 12px;
}

#calender {
  width: 12px;
}

#car {
  width: 12px;
}

#search-container {
  opacity: 1;
  transition: opacity 0.4s ease;
}

#search-container.hidden {
  opacity: 0;
  pointer-events: none;
}

#search-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#search-toggle.visible {
  opacity: 0.85;
  pointer-events: auto;
}

#search-toggle:hover {
  opacity: 1;
}

#search-toggle img {
  width: 36px;
  height: 36px;
  filter: brightness(0) saturate(100%);
  animation: floatUpDown 1.8s ease-in-out infinite;
}

@media screen and (max-width: 620px) {



  .leaflet-popup-content .popup-content {
    max-height: 30vh;
    max-width: 40vh;
    overflow-y: auto;
  }
  nav {
    height: auto;
    min-height: 50px;
    padding: 0 0.5rem;
  }
  .nav-container {
    flex-wrap: wrap;
  }
  .nav-list li a {
    display: block;
    padding: 0.5rem 0.75rem;
  }
  #greenquestlogo {
    height: 40px;
  }
  .nav-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .framsida h1 {
    font-size: 2rem;
  }
  .framsida h2 {
    font-size: 0.9rem;
  }
  .discovernowbtn {
    font-size: 1rem;
    padding: 12px 20px;
  }
  .scroll-down-indicator {
    margin-top: 1rem;
  }
  #info-sektionen {
    font-size: 1rem;
  }
  #main-title {
    font-size: 1.5rem;
  }
  .andrasida {
    background-attachment: scroll;
  }
  #search-container {
    top: 15px;
    width: 40%;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  #route-panel {
    width: 100%;
    overflow-y: auto;
  }
  #route-popup-inner {
    width: 95%;
    max-width: 95%;
  }
  #golfkarta,
  #map {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  #map {
    height: 70vh;
    width: 70vh;
  }
  body, html {
    overflow-x: hidden;
  }
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
}
