/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100..900&display=swap");

/* Define root variables for consistent theming */
:root {
  --text-color: rgb(255, 0, 0);
  --background-color: #d2c6b0ff;
  --card-background-color: #45589c;
  --shadow-color: #243244ff;
  --content-width: 60%;
  --text-color-main: #282828;
  --h3-color-text: #d2c6b0ff;
  --hover-background-color: #b79a5c;
  --main-font: "Noto Sans Thai", sans-serif;
  --secondary-font: "IBM Plex Sans Thai", sans-serif;
}

/* Apply general styles to all elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--main-font), sans-serif;
}

/* Style the body and HTML elements */
body,
html {
  height: 100%;
  overflow: hidden;
}

/* Define styles for the map container */
#map {
  height: 100vh;
  width: 100%;
}

/* Style for anchor tags */
a {
  color: var(--h3-color-text);
  text-decoration: none;
}

/* Style the description box */
#description {
  position: absolute;
  bottom: 20px; /* Move to the bottom-left corner */
  left: 20px; /* Adjust as needed */
  z-index: 999;
  background: var(--shadow-color); /* Changed background color */
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 300px; /* Reduce width */
  font-size: 14px;
  opacity: 0.8; /* Reduce opacity */
  display: flex;
  flex-direction: column;
  gap: 10px; /* Add space between elements */
}

/* Define styles for the headings in the description box */
#description h2 {
  margin: 0 0 5px 0;
  font-size: 26px;
  color: var(--background-color);
}

/* Define styles for the paragraphs and unordered lists in the description box */
#description p,
#description ul {
  margin: 5px 0;
  font-size: 14px;
}

#toggle-button {
  margin-top: 10px;
  padding: 5px 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px; /* Adjust font size for visibility */
  color: white; /* Adjust text color as needed */
  background-color: #6a8394ff;
  border-radius: 5px; /* Optional: Add border radius */
}

#toggle-button:hover {
  opacity: 0.8;
}

/* Define styles for the logo */
#logo {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 1000;
  width: 10px;
}

/* Define styles for the leaflet popup content */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--shadow-color); /* Changed background color */
  color: white;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
  opacity: 0.7;
}

/* Define styles for the header containing images */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: absolute;
  bottom: 50px;
  right: 15px; /* Adjust as necessary */
  z-index: 1000;
}

/* Define styles for the header images */
.header-img {
  max-width: 50px; /* Adjust as necessary */
  height: auto;
}

/* Responsive styles for screens up to 768px wide */
@media (max-width: 768px) {
  #description {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    background: var(--shadow-color);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 300px;
    font-size: 14px;
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .info.legend {
    bottom: 10px; /* Adjusted to keep it at the bottom */
    left: 10px; /* Adjusted to keep it to the left */
    font-size: 16px; /* Adjusted font size for better readability */
  }
}

/* Responsive styles for screens up to 480px wide */
@media (max-width: 480px) {
  #description {
    font-size: 9px !important;
    width: calc(100% - 70px);
    max-width: 150px;
    left: 10px;
    max-height: fit-content;
    gap: 0px;
  }
  #credit {
    display: none;
  }

  .header-img {
    max-width: 40px;
    bottom: -30px;
    right: 3px;
    position: absolute;
  }
  #toggle-button {
    margin-top: 10px;
    padding: 5px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: white;
    background-color: #6a8394ff;
    border-radius: 5px;
  }
  #province-filter {
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    font-size: 12px !important;
    z-index: 1000;
  }
}
/* Style for the credit section */
#credit {
  position: absolute;
  bottom: 20px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 1000; /* Ensure it appears above other content */
  opacity: 0.7;
}

#credit p {
  margin: 0;
  font-size: 12px;
}

/* Style for the province filter dropdown */
#province-filter {
  margin-top: 10px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  font-size: 14px;
  z-index: 1000; /* Ensure it appears above other content */
}

#province-filter {
  font-family: var(--main-font);
}

#credit :hover {
  background-color: #45589c;
  color: white;
}

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