/* Global Reset */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
}

#map {
  margin-top: 80px; /* Matches header height */
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: 1;
}

/* Intro Overlay */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;

  /* Add background image */
  background-image: url('worldfair.jpg'); /* make sure path is correct */
  background-size: cover;
  background-position: center;
}

/* Use a semi-transparent overlay for opacity effect */
#intro-overlay::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.25); /* adjust darkness/lightness */
  z-index: -1;
}

.intro-content {
  background: white;
  max-width: 600px;
  width: 100%;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

#close-intro {
  margin-top: 20px;
  padding: 10px 16px;
  font-size: 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Legend Panel */
#legend-panel {
  position: absolute;
  top: 110px;
  left: 10px;
  z-index: 10;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Collapsed state */
#legend-panel.collapsed #legend-wrapper {
  max-height: 0px; /* show header only */
  overflow: hidden;
}

/* Legend Wrapper */
#legend-wrapper {
   flex-grow: 1;  /* Let it grow with content */
  overflow-y: auto;
}

/* Legend Header */
.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  padding: 10px;
}

#legend-handle {
  width: 40px;
  height: 5px;
  background: #ccc;
  border-radius: 3px;
  margin: 8px auto;
}

.legend-header button {
  background: #007bff;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

#legend-header-search {
  padding: 10px;
  background: inherit;
  flex-shrink: 0; /* don't shrink */
}

/* Search Bar */
#address-search {
  margin: 0 10px 10px 10px;
}

#search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
}


/* Legend Content fills the rest */
/* This is the scrollable area */
/* THIS is the important change */
#legend-content {
  flex-grow: 1;        /* take all remaining space */
  overflow-y: auto;    /* enable scrolling */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}

/* Toggle Button */
#legend-toggle {
  background: #007bff;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#legend-toggle:hover {
  background: #333;
}

/* Category & Items */
.legend-category {
  margin-bottom: 12px;
}

.legend-category h4 {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.legend-category .arrow {
  margin-right: 6px;
}

.legend-org-list {
  list-style: none;
  padding-left: 16px;
  margin: 6px 0 0 0;
}

.legend-org-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 3px 0;
  cursor: pointer;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-org-list li.highlight {
  background-color: #f0f8ff;
  transition: background-color 0.3s;
}

 
.logo {
  max-height: 100px;
  margin: 10px;
  display: inline-block;
}

/* Info Box (New Positioning) */
#map-guide-overlay {
   position: fixed;
  bottom: 20px;
  right: 20px;
  width: 420px;         /* wider */
  max-height: 60vh;
  background: rgba(255, 255, 255, 0.97);
  display: none;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  overflow-y: auto;
}




.map-guide-content {
background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

#map-guide-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  color: #333;
}

#site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 10px 20px;
  z-index: 1001;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
}

#fth-logo {
  height: 80px;
  margin-right: 12px;
}

#site-header h1 {
  font-size: 48px;
  margin: 0;
  font-family: 'Arial';
}

/* Info Button Positioning */
#info-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

#info-button:hover {
  background: #eee;
}


.marker-label {
  pointer-events: none;
  font-family: Arial, Helvetica, sans-serif;
}


@media (max-width: 600px) {
  #site-header h1 {
    font-size: 32px !important;
    line-height: 1.2;
  }
}

@media (max-width: 600px) {
#fth-logo {
  height: 80px;
  margin-right: 12px;
}
}

@media (max-width: 600px) {
  #legend-handle {
    background: #999;
  }
}

@media (max-width: 600px) {
  #legend-panel {
    position: fixed !important;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 25vh;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.95);
    padding: 10px;
    z-index: 1000;
    transition: max-height 0.3s ease;
  }
}

/* Responsive Design */
@media (max-width: 600px) {

  #legend-panel.collapsed {
   max-height: 60px; /* collapse to just header */
  }

  #legend-panel.expanded {
    max-height: 70vh; /* expanded height */
  }

  #legend-wrapper {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #legend-content {
       max-height: calc(25vh - 60px); /* fit content */
  }

  #search-input {
    font-size: 1rem;
    padding: 8px;
  }


#intro-overlay {
   position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.97);
    z-index: 10000;
    display: block; /* Allow natural flow instead of flex centering */
    overflow-y: auto; /* Enable scrolling */
    padding: 20px;
}

.intro-content {
  background: white;
    max-width: 550px;
    width: 100%;
    padding: 20px;
    border-radius: 8px;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    margin: 40px auto; /* Center horizontally with margin */
}

#info-button {
  position: static;       /* remove fixed positioning */
  margin-left: auto;      /* push to the far right */
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

#map-guide-overlay {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 12px 12px 0 0;
    padding: 15px;
    overflow-y: auto;
}

  #map-guide-overlay h2, 
  #map-guide-overlay p {
    font-size: 14px;
  }

}

.mapboxgl-ctrl-top-right {
  top: 15px;
  right: 10px;
}

@media (max-width: 600px) {
  .mapboxgl-ctrl-top-right {
    top: 60px;
    right: 10px;
    z-index: 1000;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}


