body {
  font-family: 'proxima-nova-condensed', sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  /* Ensure the body takes up the full viewport height */
  width: 100vw;
  /* Full screen width */
  overflow: hidden;
  /* Prevent scrolling */
}

* {
  box-sizing: border-box;
}

#map {
  height: 100vh;
  /* Full screen height */
  width: 100vw;
  /* Full screen width */
  position: absolute;
  /* Ensure the map covers the entire screen */
  top: 0;
  left: 0;
}

#floating-box {
  position: absolute;
  top: 5%;
  left: 5%;

  width: 30%;
  /* Roughly one-third of the screen */
  background: rgba(255, 255, 255, 0.9);
  /* Semi-transparent white background */
  border-radius: 12px;
  /* Rounded corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  /* Subtle shadow for depth */
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-height: 90%;
  /* Prevent the box from exceeding the viewport height */
  overflow: hidden;
  /* Hide overflowing content */
}

#floating-box.long {
  bottom: 5%;
  /* Extend the box further down when in 'long' mode */
}

#results {
  flex: 1;
  /* Take up remaining space in the churches container */
  overflow-y: auto;
  /* Enable vertical scrolling */
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f9f9f9;
  max-height: 100%;
  /* Ensure it doesn't exceed the churches container height */
}

#churches {
  /* display: flex; */

  flex-direction: column;
  flex: 1;
  /* Take up remaining space in the floating box */
  overflow: hidden;
  /* Ensure content stays within the churches container */
}

#search-bar {
  display: flex;
  flex-wrap: wrap; /* Allow the button to wrap below the input field on smaller screens */
  gap: 0.5em;
}



#search-input {
  flex: 1; /* Make the input field take up available space */
  min-width: 50%; /* Prevent the input from overflowing */
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1.2em; /* Increase font size for better readability */
}

button {
  padding: 0.5em 1em;
  border: none;
  background: #007BFF;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2em; /* Increase font size for better readability */
}

button:hover {
  background: #0056b3;
}

.church-card {
  margin-bottom: 1em;
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
}

.church-card h3 {
  margin: 0 0 0.5em 0;
}

.church-card p {
  margin: 0.2em 0;
}

#map-type-buttons {
  position: absolute;
  bottom: 5%;
  left: 5%;
  display: flex;
  gap: 0.5em;
  z-index: 1000;
  /* Ensure the buttons appear above the map */
}

#map-type-buttons button {
  padding: 0.5em 1em;
  border: none;
  background: #007BFF;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

#map-type-buttons button:hover {
  background: #0056b3;
}

.mode {
  display: none;
  /* Hide all modes by default */
}

.mode.active {
  display: flex;
  /* Use flex to allow child elements to adjust properly */
  flex-direction: column;
  /* Stack child elements vertically */
  flex: 1;
  /* Take up available space in the parent container */
}

#mode-buttons {
  /*margin top .5em*/
  margin: 0.5em 0 0 0;
  display: flex;
  gap: 0.5em;
  justify-content: space-between;
}

#mode-buttons button {
  /* padding: 0.5em 1em; */
  border: none;
  background: #007BFF;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

#mode-buttons button:hover {
  background: #0056b3;
}

button.map-type-button {
  display: flex;
  gap: 0.5em;
  padding: 0.3em 0.6em;
  /* Reduce padding to make buttons narrower */
  border: none;
  background: #007BFF;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  margin: .2em;
  width: fit-content;
  min-width: 60px;
  /* Optional: Set a minimum width for consistency */
}

.map-type-button button:hover {
  background: #0056b3;
}

h2 {
  margin-top: 0; /* Remove upper margin */
  margin-bottom: 0; /* Remove lower margin */
}



/* Responsive styles for mobile */
@media (max-width: 768px) {
  #map {
    height: 50vh;
    /* Map takes up the top half of the screen */
  }

  #floating-box {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    height: 50%;
    /* Floating box takes up the bottom half of the screen */
    border-radius: 12px 12px 0 0;
    /* Rounded corners at the top */
    overflow-y: auto;
    /* Allow scrolling within the floating box */
    padding: 1em;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    /* Shadow at the top */
  }

  #results {
    max-height: calc(100% - 4em);
    padding: 0.5em;
    overflow-y: auto;
    /* Ensure results fit within the floating box */
  }

  #mode-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 1em;
  }

  .church-card {
    margin: 0.5em 0; /* Add vertical spacing between cards */
    width: 100%;
    padding: 1em;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
  }

  .church-card h3 {
    margin: 0 0 0.5em 0;
  }

  .church-card p {
    margin: 0.2em 0;
  }
}