/* CSS Load Test - this comment should appear in Safari dev tools if new CSS is loaded */
/* Version: 2025-06-09-01 */

/* 
 * Base Styles
 */
* {
  margin: 0;
  padding: 0;
  font-family: "Raleway", sans-serif;
  user-select: none;
}

body {
  user-select: none;
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  /* Prevent text zoom on mobile devices */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Allow touch events to propagate but prevent default scrolling/zooming */
  touch-action: kinetic-pan-x kinetic-pan-y;
  -webkit-touch-callout: touch-action;
  -webkit-user-select: drag;
}

/* Canvas specific touch handling */
canvas {
  touch-action: manipulation;
  /* Prevent ALL default touch behaviors on canvas */
  -webkit-touch-callout: touch-action;
  -webkit-user-select: none;
  user-select: none;
  /* Ensure canvas can receive events */
  pointer-events: auto;
  /* Ensure canvas is interactive */
  cursor: grab;
  /* Ensure canvas is behind UI but can receive events */
  position: relative;
  z-index: 1;
}

canvas:active {
  /* cursor: grabbing; */
}

/* 
 * Mobile-First Responsive Design
 */

/* Mobile Breakpoints */
@media screen and (max-width: 768px) {

  /* Hide the sidebar on small screens initially */
  .facilities-container {
    position: fixed !important;
    left: -250px !important;
    transition: left 0.3s ease !important;
    z-index: 5000 !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
  }

  .facilities-container.mobile-open {
    left: 5px !important;
  }

  /* Mobile toggle button - moved to bottom */
  .mobile-facilities-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 6000;
    background: rgba(231, 231, 231, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 70px;
    height: 50px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    padding: 4px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .mobile-facilities-toggle:hover {
    background: rgba(236, 236, 236, 0.8);
    transform: scale(1.05);
  }

  .mobile-facilities-toggle:active,
  .mobile-facilities-toggle.active {
    background: rgba(213, 213, 213, 0.9);
    transform: scale(0.95);
  }

  /* Touch-specific styles for mobile toggle */
  .mobile-facilities-toggle {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }

  /* Overlay for mobile sidebar */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    display: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .mobile-overlay.active {
    display: block;
  }

  /* Top controls for mobile */
  .top-controls-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(calc(-100% - env(safe-area-inset-top, 0px))) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px 24px !important;
    gap: 16px !important;
    box-sizing: border-box !important;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0s linear 0.35s !important;
    opacity: 0 !important;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 20px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4) !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  .top-controls-container.open {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0s !important;
  }

  .control-section .radius-input-row,
  .control-section .zip-input-row {
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .control-section input[type="number"],
  .control-section input[type="text"] {
    flex: 1 !important;
    padding: 12px !important;
    font-size: 16px !important;
    min-height: 24px !important;
    box-sizing: border-box !important;
    max-width: none !important;
  }

  .control-section button {
    flex-shrink: 0 !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    min-height: 48px !important;
    min-width: 80px !important;
    max-width: 100px !important;
    box-sizing: border-box !important;
  }

  /* Position Target button mobile styles removed - no longer needed */

  /* Adjust facility items for touch */
  .facility-item {
    margin: 4px 0 !important;
    min-height: 48px !important;
  }

  .facility-summary {
    padding: 12px !important;
    min-height: 24px !important;
  }

  .facility-name {
    font-size: 15px !important;
  }

  /* Larger touch targets for controls */
  #radius-input,
  #zip-input {
    padding: 12px 10px !important;
    font-size: 16px !important;
    min-height: 24px !important;
    /* Force enable text selection and input on mobile */
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    /* Ensure proper touch behavior */
    touch-action: manipulation !important;
    /* Ensure inputs can receive focus */
    cursor: text !important;
  }

  #radius-submit,
  #zip-submit {
    padding: 12px 16px !important;
    font-size: 16px !important;
    min-height: 48px !important;
    min-width: 60px !important;
  }

  /* Popups for mobile */
  .popup-mobile {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    border-radius: 12px 12px 0 0 !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s ease !important;
  }

  .popup-mobile.active {
    transform: translateY(0) !important;
  }

  .popup-content {
    max-height: 60vh !important;
    overflow-y: auto !important;
  }

  /* Welcome screen adjustments for mobile */
  .welcome-card {
    width: 95% !important;
    max-width: none !important;
    margin: 10px !important;
  }

  .welcome-card .features {
    grid-template-columns: 1fr !important;
  }

  .contact-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
  }

  .contact-icon {
    margin-right: 8px;
  }

  .contact-control {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
    padding-top: 10px;
  }

  .contact-control .contact-title {
    color: white;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
  }

  .contact-control .email-link {
    color: #4da6ff;
    text-decoration: none;
  }

  .contact-control .email-link:hover {
    text-decoration: underline;
  }

  .contact-control .contact-row {
    color: white;
    margin-bottom: 4px;
    font-size: 13px;
  }

  .contact-control .contact-row:last-child {
    margin-bottom: 0;
  }
}

/* Large mobile devices */
@media screen and (max-width: 480px) {
  .facilities-container {
    width: 280px !important;
    left: -280px !important;
  }

  .facilities-container.mobile-open {
    left: 0 !important;
  }

  .mobile-facilities-toggle {
    width: 65px;
    height: 55px;
    font-size: 28px;
  }

  /* Adjust feature grid for very small screens */
  .facility-features {
    flex-direction: column !important;
    gap: 5px !important;
  }

  /* Smaller text for very small screens */
  .facility-details {
    font-size: 19px !important;
  }
}

/* Touch-friendly improvements for all devices */
@media (pointer: coarse) {

  /* Increase touch targets */
  .facility-item {
    min-height: 52px;
  }

  .popup-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  /* Make scrollbars wider on touch devices */
  .facilities-list::-webkit-scrollbar {
    width: 12px;
  }

  .facility-details::-webkit-scrollbar {
    width: 10px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  /* Crisp borders and shadows */
  .facilities-container {
    border: 0.5px solid rgba(255, 255, 255, 0.2);
  }

  .facility-item {
    border: 0.5px solid rgba(255, 255, 255, 0.432);
  }
}

/* 
 * Utility Classes for Repeated Styles
 */
.email-link {
  color: #4da6ff;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10000;
}

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

.contact-icon {
  margin-right: 8px;
}

.contact-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.popup-header {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  padding: 12px 15px;
  border-radius: 8px 8px 0 0;
  position: relative;
  border-bottom: 2px solid #4da6ff;
}

.popup-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  padding-right: 30px;
}

.popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.popup-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.popup-content {
  padding: 15px;
  background: rgba(60, 60, 60, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 8px 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.4;
  max-height: 300px;
  overflow-y: auto;
}

/* 
 * Typography
 */
.raleway_headline {
  font-family: "Raleway", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

.lexend_table {
  font-family: "Raleway", serif;
  font-optical-sizing: auto;
  font-weight: 420;
  font-style: normal;
}

/* 
 * Layout Containers
 */
.mainContain {
  user-select: none;
  font-family: "Raleway", sans-serif;
  overflow: none;
  top: 0;
  left: 0;
  width: 100%;
  color: rgb(95, 95, 95);
}

.listContainer {
  height: 100vh;
  width: auto;
  position: relative;
}

.mapContainer {
  user-select: none;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

canvas {
  user-select: none;
  position: absolute;
  /* pointer-events: none; */
  /* REMOVED: This was blocking all canvas interactions! */
  top: 0;
  left: 0;
  z-index: 2;
  /* Increased from 1 to be above facility list */
}

/* Force override for input functionality */
input[type="number"],
input[type="text"] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  touch-action: manipulation !important;
  pointer-events: auto !important;
  cursor: text !important;
  position: relative !important;
  z-index: 1000 !important;
}

/* Ensure control sections allow text selection */
.radius-control,
.zip-control {
  margin-bottom: 15px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
}

.radius-display,
.zip-display {
  font-size: 14px;
  margin-bottom: 5px;
  color: white;
}

.radius-input-row,
.zip-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

#radius-input,
#zip-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  box-sizing: border-box;
  /* Ensure inputs are visible and interactive */
  opacity: 1;
  pointer-events: auto;
  min-width: 100px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Force enable text selection and input */
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  /* Ensure proper touch behavior */
  /* touch-action: touch-action !important; */
  /* Ensure inputs can receive focus */
  outline: none;
  cursor: text;
}

#radius-input:focus,
#zip-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(230, 32, 41, 0.3);
  outline: none;
}

#radius-input:hover,
#zip-input:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

#radius-submit,
#zip-submit {
  background: #4a4a4a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 60px;
}

#radius-submit:hover,
#zip-submit:hover {
  background: #5a5a5a;
}

/* Force Safari compatibility - higher specificity rules */
.facilities-header-section .zip-input-row,
.facilities-header-section .radius-input-row {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.facilities-header-section #radius-submit,
.facilities-header-section #zip-submit {
  background: #4a4a4a !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 6px !important;
  color: white !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  min-width: 60px !important;
}

/* 
 * Map-locked Popup 
 */
#map-locked-popup {
  transition: left 0.1s, top 0.1s;
}

#map-locked-popup .facility-features {
  margin-top: 10px;
}

#map-locked-popup a:hover {
  text-decoration: underline;
}

.facility-marker {
  cursor: pointer;
}

/* 
 * Facility List Container Structure
 * Note: Container and header styles are set inline in JavaScript for better control
 */

/* Facility List Scrollbar */
.facilities-list::-webkit-scrollbar {
  width: 8px;
}

.facilities-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.facilities-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.facilities-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 10, 10, 0.3);
}

/* Ensure facilities list fills available space properly */
.facilities-list {
  /* Remove any default height constraints */
  height: auto;
  max-height: none;
}

/* Facility Items */
.facility-item {
  box-shadow: 0 2px 4px rgba(209, 7, 7, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(50, 50, 50, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin: 3px 0;
  border-radius: 6px;
  overflow: visible;
  position: relative;
}

.facility-item:hover {
  border-color: rgb(255, 255, 255);
}

.facility-item.expanded {
  box-shadow: 0 4px 8px rgba(255, 100, 0, 0.4);
  z-index: 10;
}

.facility-item.outside-radius {
  border-left: 3px solid #FFFFFF;
}

.facility-item.outside-radius .facility-summary {
  background: rgba(89, 50, 50, 0.95);
}

/* Facility Summary */
.facility-summary {
  font-family: 'Raleway', sans-serif;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  background: rgba(177, 177, 177, 0.28);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  align-items: center;
  color: white;
}

.facility-name {
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 500;
  width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facility-score {
  font-size: 12px;
  font-weight: 600;
  width: 30%;
  text-align: right;
}

/* Facility Details */
.facility-details {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, padding 0.3s ease-in-out;
  background: rgba(98, 98, 98, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 0 15px;
}

.facility-item.expanded .facility-details {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 15px;
  border-top: 1px solid rgb(255, 255, 255);
}

/* Detail Scrollbar */
.facility-details::-webkit-scrollbar {
  width: 6px;
}

.facility-details::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.facility-details::-webkit-scrollbar-thumb {
  background: rgb(223, 223, 223);
  border-radius: 3px;
}

.facility-details::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 216, 216, 0.5);
}

/* Feature styles */
.facility-features {
  display: flex;
  flex-direction: row;
  gap: 200px;
}

.facility-features div {
  display: flex;
  font-family: 'Raleway', sans-serif;
  font-size: 12px;
  align-items: center;
  gap: 3px;
}

/* Status Indicators */
.greenHL {
  color: #90EE90;
  font-size: 10px;
  font-weight: 10;
}

.redHL {
  color: #FF6666;
  font-size: 10px;
  font-weight: 600;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(200px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.facility-item.new {
  animation: slideIn 0.7s ease forwards;
}

/* Safari-specific fixes for button alignment and container sizing */
@supports (-webkit-appearance: none) {

  /* Safari-specific flexbox fixes */
  .radius-input,
  .zip-input {
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    -webkit-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
  }

  #radius-input,
  #zip-input {
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    -webkit-flex: 1 1 auto !important;
    flex: 1 1 auto !important;
  }

  #radius-submit,
  #zip-submit {
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    -webkit-flex: 0 0 auto !important;
    flex: 0 0 auto !important;
    min-width: auto !important;
    width: auto !important;
    white-space: nowrap !important;
  }

  /* Force Safari to respect container boundaries */
  .facilities-header-section {
    overflow: hidden !important;
  }

  .radius-control,
  .zip-control {
    overflow: hidden !important;
    max-width: 100% !important;
  }
}

/* Additional Safari flexbox compatibility */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

  /* This targets WebKit browsers (Safari, older Chrome) */
  .zip-input input[type="text"],
  .radius-input input[type="number"] {
    width: auto !important;
    flex-basis: 0 !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
  }

  .zip-input button,
  .radius-input button {
    flex-basis: auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    max-width: none !important;
  }
}

/* Bottom unified button layout */
.bottom-button-bank {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 5500;
}

.filters-toggle-button {
  background: rgba(30, 30, 30, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  user-select: none;
  /* -webkit-user-select: none; */
  -webkit-tap-highlight-color: transparent;
  min-width: 80px;
  height: 50px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.filters-toggle-button:hover {
  background: rgba(30, 30, 30, 0.6);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.filters-toggle-button.active {
  background: rgba(74, 144, 226, 0.8);
  border-color: rgba(74, 144, 226, 0.9);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.filters-toggle-button:active {
  transform: scale(0.95);
}

/* Controls Toggle Button - Similar to filters but different position */
.controls-toggle-button {
  background: rgba(30, 30, 30, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: 'Raleway', sans-serif;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 80px;
  height: 50px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9000;
  pointer-events: auto;
}

.controls-toggle-button:hover {
  background: rgba(30, 30, 30, 0.6);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.controls-toggle-button.active {
  background: rgba(74, 144, 226, 0.8);
  border-color: rgba(74, 144, 226, 0.9);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.controls-toggle-button:active {
  transform: scale(0.95);
}

.filters-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 30, 30, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px 12px 0 0;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 6000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.filters-tray.open {
  transform: translateY(0);
}

.filters-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-tray-title {
  color: white;
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.filters-tray-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.filters-tray-close:hover {
  color: white;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.filter-option {
  background: rgba(50, 50, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.filter-option:hover {
  background: rgba(70, 70, 70, 0.8);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.filter-option.active {
  background: rgba(74, 144, 226, 0.8);
  border-color: rgba(74, 144, 226, 1);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.filter-option:active {
  transform: scale(0.95);
}

/* Hide the original feature checkboxes panel */
#feature-checkboxes {
  display: none !important;
}

/* Adjust target placement button to work with new layout */
.target-placement-btn {
  bottom: 20px !important;
  right: 20px !important;
  left: auto !important;
  transform: none !important;
  width: 70px !important;
  height: 50px !important;
  border-radius: 8px !important;
  padding: 12px 20px !important;
  min-width: 70px !important;
}

/* Adjust hamburger button spacing */
.mobile-facilities-toggle {
  bottom: 20px;
  left: 20px;
  z-index: 6000;
  background: rgba(229, 229, 229, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  width: 70px;
  height: 50px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  padding: 4px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Top Controls Container - Hidden by default, will be toggled */
.top-controls-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 9100;
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0 0 12px 12px;
  padding: 20px 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 900px;
  width: min(90vw, 900px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(calc(-100% - 24px));
  transition: transform 0.35s ease, opacity 0.35s ease, visibility 0s linear 0.35s;
  max-height: calc(90vh - 20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
  visibility: hidden;
}

.controls-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  display: none;
  transition: opacity 0.3s ease;
}

.controls-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.top-controls-container.open {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto;
  visibility: visible;
  transition: transform 0.35s ease, opacity 0.35s ease, visibility 0s;
}

.control-section {
  font-family: 'Raleway', sans-serif;
  color: white;
  width: 100%;
  box-sizing: border-box;
  background: rgba(60, 60, 60, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
}

.control-section .radius-display,
.control-section .zip-display {
  color: white;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
}


/* New: input/button row for controls */
.control-section .radius-input-row,
.control-section .zip-input-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.control-section input[type="number"],
.control-section input[type="text"] {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  /* Ensure inputs are interactive */
  pointer-events: auto;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.control-section input[type="number"]:focus,
.control-section input[type="text"]:focus {
  outline: none;
  border-color: #e62029;
  box-shadow: 0 0 0 2px rgba(230, 32, 41, 0.2);
}

.control-section input::placeholder {
  color: rgba(234, 234, 234, 0.5);
}

.control-section button {
  background: #dcdcdc;
  border: none;
  border-radius: 6px;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  min-width: 60px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.control-section button:hover {
  background: #5a5a5a;
}

.control-section button:active {
  transform: scale(0.95);
}

/* Position Target button styles removed - no longer needed */

/* Mobile Facility Panel Styles */
#mobile-facility-panel {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: white;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

#mobile-facility-panel button {
  font-family: inherit;
  outline: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

#mobile-facility-panel button:active {
  transform: scale(0.95);
}

#mobile-facility-panel .feature-tag {
  background: rgba(230, 32, 41, 0.2);
  color: #cdcdcd;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #e7e7e7;
  display: inline-block;
  margin: 2px;
}

#mobile-facility-panel .contact-button {
  background: #e62029;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  font-size: 16px;
}

#mobile-facility-panel .contact-button:hover {
  background: #d41e26;
}

#mobile-facility-panel .nav-button {
  background: rgba(230, 32, 41, 0.2);
  color: #e6e6e6;
  border: 1px solid #ececec;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

#mobile-facility-panel .nav-button:hover {
  background: rgba(230, 32, 41, 0.3);
}

#mobile-facility-panel .nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#mobile-facility-panel .close-button {
  position: absolute;
  top: 15px;
  right: 25px;
  background: none;
  border: none;
  color: #e62029;
  font-size: 24px;
  cursor: pointer;
  z-index: 10001;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobile-facility-panel .close-button:hover {
  color: #ff4444;
}

/* Smooth scrolling for mobile panel */
#mobile-facility-panel {
  scroll-behavior: smooth;
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
  #mobile-facility-panel button {
    min-height: 44px;
    /* Apple's recommended minimum touch target */
  }

  #mobile-facility-panel .nav-button {
    padding: 12px 20px;
    font-size: 16px;
  }
}
