* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f7f8f6;
  margin: 0;
  padding: 0;
  color: #4a5d4a;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
}

.map-section {
  flex: 1;
  background: #e8ebe8;
}

#map {
  width: 100%;
  height: 100%;
  background: #e8ebe8; /* Fallback background */
}

.search-section {
  width: 400px;
  background: white;
  border-left: 1px solid #e0e6e0;
  overflow-y: auto;
  overflow-x: hidden;
}

.search-panel {
  padding: 20px;
}

h1 {
  color: #3a4a3a;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 600;
}

.search-section {
  background: #f9faf9;
  border-radius: 2px;
  padding: 20px;
  margin-bottom: 20px;
}

label {
  font-weight: 500;
  color: #4a5d4a;
  margin-bottom: 4px;
  display: block;
  font-size: 14px;
}

input[type='text'] {
  padding: 12px;
  border: 1px solid #d0d6d0;
  border-radius: 2px;
  font-size: 16px;
  width: 100%;
  transition: border-color 0.2s ease;
  background: white;
}

input[type='text']:focus {
  outline: none;
  border-color: #6b8e6b;
  box-shadow: 0 0 0 2px rgba(107, 142, 107, 0.1);
}

input[type='number'] {
  padding: 8px;
  border: 1px solid #d0d6d0;
  border-radius: 2px;
  font-size: 16px;
  max-width: 80px;
  transition: border-color 0.2s ease;
  background: white;
}

input[type='number']:focus {
  outline: none;
  border-color: #6b8e6b;
  box-shadow: 0 0 0 2px rgba(107, 142, 107, 0.1);
}

input[type='submit'] {
  background: #6b8e6b;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

input[type='submit']:hover {
  background: #5a7a5a;
}

input[type='submit']:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 12px;
  margin-top: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  margin-bottom: 6px;
  font-size: 13px;
}

select {
  padding: 10px;
  border: 1px solid #d0d6d0;
  border-radius: 2px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #6b8e6b;
  box-shadow: 0 0 0 2px rgba(107, 142, 107, 0.1);
  box-shadow: 0 0 0 2px rgba(107, 142, 107, 0.3);
}


.input-group {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 15px;
}

.error-message {
  color: #8b6b47;
  text-align: center;
  display: none;
  background: #f9f6f2;
  border-radius: 2px;
  padding: 8px;
  margin: 15px 0;
  font-size: 14px;
}

.error-message:not(:empty) {
  display: block;
}

.hidden {
  display: none;
}

#results {
  margin-top: 20px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#results h2 {
  color: #3a4a3a;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.clear-search {
  background: transparent;
  border: 1px solid #d0d6d0;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  color: #5a6a5a;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.clear-search:hover {
  background: #f7f8f6;
  border-color: #6b8e6b;
  color: #3a4a3a;
}

/* Welcome/Landing Section */
.welcome-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e6e0;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.welcome-header h2 {
  color: #3a4a3a;
  font-size: 1.3rem;
  margin: 0;
  font-weight: 600;
}

.toggle-help {
  background: transparent;
  border: 1px solid #d0d6d0;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  color: #5a6a5a;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 2px;
}

/* Larger button on mobile */
@media (max-width: 768px) {
  .toggle-help {
    padding: 4px 12px;
    font-size: 1.2rem;
  }
}

.toggle-help:hover {
  background: #f7f8f6;
  border-color: #6b8e6b;
  color: #3a4a3a;
}

.toggle-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
}

.welcome-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.welcome-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.welcome-intro {
  color: #5a6a5a;
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.feature-item {
  background: #f7f8f6;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e0e6e0;
}

.feature-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.feature-item h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: #3a4a3a;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.85rem;
  color: #5a6a5a;
  margin: 0;
  line-height: 1.4;
}

.quick-examples {
  margin-top: 16px;
  margin-bottom: 16px;
}

.quick-examples h3 {
  font-size: 0.95rem;
  color: #3a4a3a;
  margin-bottom: 12px;
  font-weight: 600;
}

.example-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-tag {
  background: white;
  border: 1px solid #6b8e6b;
  color: #6b8e6b;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.example-tag:hover {
  background: #6b8e6b;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(107, 142, 107, 0.3);
}

.tips-section {
  background: #f7f8f6;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid #e0e6e0;
}

.tips-section h3 {
  font-size: 0.95rem;
  color: #3a4a3a;
  margin: 0 0 12px;
  font-weight: 600;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tips-list li {
  font-size: 0.85rem;
  color: #5a6a5a;
  line-height: 1.5;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
}

.tips-list li:hover {
  box-shadow: none;
  transform: none;
}

.tips-list kbd {
  background: white;
  border: 1px solid #d0d6d0;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: 'Monaco', 'Menlo', monospace;
  color: #3a4a3a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

li {
  background: white;
  border-radius: 2px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  border-left: 3px solid #6b8e6b;
  overflow: hidden;
  word-wrap: break-word;
}

li:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

h3 {
  margin: 0 0 6px;
  color: #3a4a3a;
  font-size: 1.1rem;
  font-weight: 600;
}

li p {
  color: #5a6a5a;
  margin: 6px 0;
  line-height: 1.4;
  font-size: 14px;
}

li a {
  color: #6b8e6b;
  text-decoration: none;
  font-size: 14px;
}

li a:hover {
  color: #5a7a5a;
  text-decoration: underline;
}

address {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8ebe8;
  color: #5a6a5a;
  font-style: normal;
  font-size: 13px;
}

/* Search result highlights */
.search-result-item {
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.search-result-item:hover {
  background-color: #f0f4f0;
}

.search-result-item.highlighted {
  background-color: #e8f5e8 !important;
  border-left: 4px solid #6b8e6b !important;
}

/* Marker highlights */
.highlighted-marker {
  transform: scale(1.2);
  z-index: 1000;
}

/* Alerts styling */
.alerts-container h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

/* override mapbox popup default styling */
.mapboxgl-popup-content {
  padding: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.mapboxgl-popup-content-wrapper {
  padding: 0 !important;
}

/* custom popup styling */
.custom-popup .mapboxgl-popup-content {
  padding: 20px !important;
  border-radius: 8px !important;
  width: 350px !important;
  max-width: 350px !important;
  max-height: 400px !important;
  overflow-y: auto;
}

.custom-popup .mapboxgl-popup-content-wrapper {
  padding: 0 !important;
}

/* popup header styling */
.custom-popup h3 {
  margin: 0 0 12px 0;
  color: #3a4a3a;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid #6b8e6b;
  padding-bottom: 6px;
}

/* alerts styling */
.alerts-container {
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  /* padding: 0px 4px 4px 4px; */
  width: 100%;
  box-sizing: border-box;
  position: relative;
  /* border-radius: 8px; */
  z-index: 1;
}

.alert-item {
  margin-bottom: 10px;
  /* border-radius: 4px; */
  border-left: 4px solid;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.alert-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.alert-header:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.alert-category {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  background-color: rgba(0, 0, 0, 0.1);
}

.alert-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  word-wrap: break-word;
}

.alert-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  font-weight: bold;
  color: #666;
}

.alert-content {
  padding: 0 10px 10px 10px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.alert-description {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.4;
  color: #666;
}

.alert-link {
  font-size: 12px;
  color: #3b82f6;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.alert-link:hover {
  text-decoration: underline;
}

/* category colors */
.alert-item.danger .alert-header {
  background-color: #fdf2f2;
  border-left-color: #dc2626;
}

.alert-item.park-closure .alert-header {
  background-color: #fef3c7;
  border-left-color: #f59e0b;
}

.alert-item.caution .alert-header {
  background-color: #fefce8;
  border-left-color: #eab308;
}

.alert-item.information .alert-header {
  background-color: #eff6ff;
  border-left-color: #3b82f6;
}

/* tab menu styling */
.tab-menu {
  display: flex;
  border-bottom: 1px solid #e0e6e0;
  margin-bottom: 15px;
  /* border-radius: 8px; */
}

.tab {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  color: #333;
  background-color: #f5f5f5;
}

.tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

.tab-content {
  min-height: 100px;
  width: 100%;
}

/* hide mapbox branding */
.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-attrib {
  display: none !important;
}

/* make tab menu sticky with proper height */
.tab-menu {
  position: sticky !important;
  top: 0 !important;
  background: white !important;
  z-index: 10 !important;
  border-bottom: 1px solid #e0e6e0 !important;
  margin: 0 !important;
  padding: 8px 15px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  min-height: 40px !important;
}

/* ensure alerts container starts below sticky nav */
.alerts-container {
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  /* padding: 0px 15px 15px 15px; */
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  margin-top: 0 !important;
}

/* add top padding to alerts list to account for sticky nav */
.alerts-list {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ensure first alert has proper spacing */
.alert-item:first-child {
  margin-top: 0 !important;
}

/* mobile responsive styles for map layout */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: 100vh;
  }
  .map-section {
    height: 50vh;
    min-height: 300px;
    flex-shrink: 0;
  }
  #map {
    height: 100%;
    min-height: 300px;
  }
  .search-section {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e0e6e0;
    flex: 1;
    overflow-y: auto;
  }
  .search-panel {
    padding: 15px;
  }
  h1 {
    font-size: 1.3rem;
  }

  /* mobile popup styling */
  .custom-popup .mapboxgl-popup-content {
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 200px !important;
  }

  .alerts-container {
    max-height: 150px !important;
    /* padding: 0px 10px 10px 10px !important; */
  }

  .tab-menu {
    flex-wrap: wrap;
    gap: 2px;
  }

  .tab {
    padding: 6px 8px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
  }

  .alert-item {
    margin-bottom: 6px !important;
  }

  .alert-header {
    padding: 6px !important;
  }

  .alert-title {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  .alert-description {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 480px) {
  .map-section {
    height: 40vh;
    min-height: 250px;
  }
  .search-panel {
    padding: 12px;
  }
  h1 {
    font-size: 1.2rem;
  }

  /* even smaller mobile popup */
  .custom-popup .mapboxgl-popup-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 180px !important;
  }

  .alerts-container {
    max-height: 130px !important;
    /* padding: 0px 8px 8px 8px !important; */
  }

  .tab {
    padding: 4px 6px;
    font-size: 11px;
  }

  /* mobile sticky tabs */
  .tab-menu {
    padding: 0 8px !important;
  }

  /* mobile park submenu */
  .park-submenu {
    flex-wrap: wrap;
    gap: 4px;
  }

  .submenu-btn {
    padding: 4px 6px;
    font-size: 11px;
    flex: 1;
    min-width: 0;
  }

  .park-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .zoom-btn {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .park-content {
    max-height: 200px;
  }

  .thing-meta {
    flex-direction: column;
    gap: 6px;
  }

  .meta-item {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* mobile popup styling */
  .custom-popup .mapboxgl-popup-content {
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 300px !important;
    padding: 15px !important;
  }
}

/* park submenu styling */
.park-header {
  border-bottom: 1px solid #e0e6e0;
  margin-bottom: 15px;
  padding-bottom: 10px;
}

.park-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 15px;
}

.zoom-btn {
  background: transparent;
  border: 1px solid #d0d6d0;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.zoom-btn:hover {
  background: #f5f5f5;
  border-color: #6b8e6b;
  color: #6b8e6b;
}

.park-submenu {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.submenu-btn {
  background: #f5f5f5;
  border: 1px solid #d0d6d0;
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submenu-btn:hover {
  background: #e8ebe8;
  color: #333;
}

.submenu-btn.active {
  background: #6b8e6b;
  color: white;
  border-color: #6b8e6b;
}

.park-content {
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

/* prevent images from causing horizontal scroll */
.park-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
  border-radius: 4px;
}

.park-content.hidden {
  display: none;
}

/* custom scrollbar for park content */
.park-content::-webkit-scrollbar {
  width: 6px;
}

.park-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.park-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.park-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* things to do styling */
.things-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.thing-item {
  background: white;
  border-radius: 4px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e6e0;
}

.thing-title {
  margin: 0 0 8px 0;
  color: #3a4a3a;
  font-size: 1rem;
  font-weight: 600;
}

.thing-description {
  margin: 0 0 8px 0;
  color: #5a6a5a;
  font-size: 14px;
  line-height: 1.4;
}

.thing-details {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

.thing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.meta-item {
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 3px;
}

/* news date styling */
.news-date {
  font-size: 12px;
  color: #666;
  margin: 8px 0 0 0;
  font-style: italic;
}

/* smaller mobile screens */
@media (max-width: 480px) {
  .park-submenu {
    flex-direction: column;
    gap: 2px;
  }

  .submenu-btn {
    padding: 6px 8px;
    font-size: 10px;
    text-align: center;
  }

  .park-content {
    max-height: 150px;
  }

  .custom-popup .mapboxgl-popup-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 250px !important;
    padding: 12px !important;
  }
}
