/* ─── Reset & Base ───────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body {
  background-color: #0daade0f; /* very light blue */
  color: #000;
  padding-top: 0; /* Remove padding since header now has proper spacing */
}

/* ─── Header ────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 20px; /* Further reduced padding */
  margin-bottom: 0px; /* Remove margin */
  margin-top: 0px; /* Remove margin */
  position: relative;
  flex-wrap: wrap; /* Allow wrapping when needed */
  gap: 8px; /* Further reduced gap */
  min-width: 0;
  background: #f1fafd; /* Match the listings container background exactly */
  border-bottom: none; /* Remove the gray border */
}
.left-section {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px; /* Further reduced gap */
  margin-left: 2px; /* Further reduced margin */
  flex-shrink: 0; /* Prevent logo from shrinking */
}
.right-section {
  display: flex;
  align-items: center;
  gap: 6px; /* Further reduced gap */
  min-width: 0;
  flex-shrink: 1;
  justify-content: flex-end;
  margin-right: 2px; /* Further reduced margin */
  flex-wrap: wrap; /* Allow wrapping to new rows if needed */
  row-gap: 4px; /* Further reduced gap */
}

.logo-icon {
  width: 140px; /* Slightly smaller logo */
  height: 42px; /* Proportional height */
  object-fit: contain;
  margin: 0; /* Remove existing margin, let container handle spacing */
  padding: 0;
}
.logo {
  font-size: 1.08em;
  font-style: italic;
  color: #10ACDC;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0; /* Never shrink */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  line-height: 1;
  margin-left: 12px;
}

.logo-main {
  white-space: nowrap;
}

.logo-beta {
  font-size: 1em;
  color: #0eabdf;
  white-space: nowrap;
}

/* Sign-in - Specific Styles Only */
/* Dimensions and layout are handled by .auth-btn-base */
.sign-in-btn {
  background: #0eabdf;
  color: #fff;
  border: none; /* Specific override if needed, though base has border: 2px solid transparent might be better */
}
.sign-in-btn:hover {
  background: #3ca4f0;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px; /* Keep gap for spacing email and button */
}
.user-email {
  font-size: .95em;
  font-weight: 500;
  color: #014a8a;
}

/* Sign-out text link style - REMOVE IF NOT USED ELSEWHERE */
/* This is likely unused for the button now */
/*
.sign-out {
  font-size: .95em;
  font-weight: 500;
  min-width:60px;
  min-height:40px;
  color: #0eabdf;
  text-decoration: none;
}
.sign-out:hover {
  text-decoration: underline;
}
*/

/* Hamburger */
.hamburger {
  margin-left: 0;
  margin-right: 0;
  order: 2;
  flex-shrink: 1;
  width: 40px;
  height: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer; /* Add cursor */
}
.hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  max-width: 30px;
  margin: 0;
  background: #000;
  border-radius: 2px;
  transition: transform .3s, opacity .3s, background .3s;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg); /* Adjusted transform */
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg); /* Adjusted transform */
}
.hamburger:hover span {
  background: #014a8a;
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 60px; /* Adjust as needed based on header height */
  right: 24px;
  background: #fff;
  padding: 8px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  list-style: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  width: 180px;
  z-index: 1000;
  display: none; /* Controlled by JS */
}
.dropdown-menu.show { /* Add class via JS to show */
  display: block;
}
.dropdown-menu li+li {
  border-top: 1px solid #eee;
}
.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #000000;
  font-weight: 500;
}
.dropdown-menu a:hover {
  background: #f0f4ff;
}

/* ─── Catchphrase ───────────────────────────────────────── */
.catchphrase {
  text-align: center;
  padding: 0px 20px 10px;
}
.catchphrase-text {
  font-size: 1.8em;
  font-weight: 500;
  line-height: 1.4;
  color: #333; /* Slightly darker text */
}
.highlight, .hidden-listings {
  font-weight: 700;
  color: #0eabdf;
}

/* ─── Search Section ───────────────────────────────────── */
.search-section {
  display: flex;
  justify-content: center;
  padding-top: 0px; /* Remove padding */
  padding-bottom: 0px; /* Remove padding */
  margin-top: 0px; /* Remove margin */
  margin-bottom: 8px; /* Reduced margin */
}
.search-container {
  display: flex;
  gap: 12px; /* Consistent gap with header */
  width: 100%;
  max-width: 800px;
  align-items: stretch;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  row-gap: 8px; /* Gap between wrapped rows */
}
.search-input-container {
  flex: 2 1 0%;
  min-width: 0;
  display: flex;
  position: relative; /* Needed for autocomplete positioning */
}
.search-buttons-row {
  flex: 1 1 0%;
  display: flex;
  flex-direction: row;
  gap: 12px; /* Consistent gap */
  align-items: stretch;
  min-width: 0;
  flex-wrap: nowrap; /* Prevent button wrapping - keep on same row */
  flex-shrink: 0; /* Prevent shrinking */
}
.filter-btn, .search-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 0; /* Let flexbox determine width */
}

/* Multiselect */
.multiselect-search-wrapper {
  background-color: #fff;
  color: #111;
  border: 1px solid #ccc;
  min-height: 46px; /* Reverted to original height */
  display: flex;
  align-items: center;
  padding: 6px 8px; /* Reverted to original padding */
  font-size: 1em;
  border-radius: 6px;
  cursor: text;
  gap: 6px;
  flex-wrap: wrap; /* Allow chips to wrap */
  width: 100%; /* Take full width of container */
}

.selected-state-chip,
.selected-postcodes-chips {
  display: contents; /* Use contents to avoid extra div */
}

.state-chip-inline,
.postcode-chip-inline {
  display: inline-flex;
  align-items: center;
  background-color: #e0e0e0;
  padding: 4px 8px;
  border-radius: 16px; /* More pill-shaped */
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  margin: 2px 0; /* Add slight margin for wrapping */
}

.state-chip-inline span,
.postcode-chip-inline span {
  margin-right: 6px;
}

.state-chip-remove,
.postcode-chip-remove {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px; /* Center the 'x' */
  text-align: center;
  border-radius: 50%;
  background-color: #aaa;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.state-chip-remove:hover,
.postcode-chip-remove:hover {
  background-color: #888;
}

#search-input-inner,
#states-input-inner {
  flex-grow: 1;
  border: none;
  outline: none;
  padding: 6px; /* Reverted to original padding */
  font-size: 1em;
  background-color: transparent;
  width: 50px; /* Minimum width before growing */
  height: 30px; /* Reverted to original height */
  align-self: center; /* Center vertically within the wrapper */
  color: #111; /* Changed from #fff for visibility on white background */
}

#search-input-inner::placeholder,
#states-input-inner::placeholder {
  color: #bbb;
}

/* Autocomplete */
.autocomplete-list {
  list-style: none;
  position: absolute;
  top: calc(100% + 4px); /* Position below the input wrapper */
  left: 0;
  width: 100%; /* Match the input container width */
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin: 0;
  padding: 0;
  display: none; /* Controlled by JS */
}
.autocomplete-list.show { /* Added class for JS control */
    display: block;
}
.autocomplete-list li {
  padding: 10px 14px;
  cursor: pointer;
}
.autocomplete-list li:hover {
  background: #f0f4ff;
}
.autocomplete-list li.highlighted {
  background: #e6f7ff;
  color: #0eabdf;
}

.search-btn, .filter-btn, .clear-btn {
  padding: 12px 20px; /* Reverted to original padding */
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  height: 46px; /* Reverted to original height to match input wrapper */
  min-width: 80px; /* Set a minimum width */
  align-self: stretch; /* Make buttons stretch */
  white-space: nowrap; /* Prevent text wrapping */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em; /* Added for consistency */
  transition: background 0.2s, color 0.2s, border-color 0.2s; /* Added transition */
}
.search-btn {
  background: #0eabdf;
  color: #fff;
  border: 2px solid #0eabdf; /* Add border for consistency */
}
.search-btn:hover {
    background: #0b8fbd; /* Slightly darken on hover */
    border-color: #0b8fbd;
}

.clear-btn,
.filter-btn {
  background: #fff;
  border: 2px solid #0eabdf;
  color: #0eabdf;
}
.clear-btn:hover,
.filter-btn:hover {
  background: #f0f9fc; /* Light blue background on hover */
}

.filter-btn.filtered {
  background: #fff;
  color: #E0540D !important;
  border: 2px solid #E0540D !important;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(224,84,13,0.18), 0 2px 8px rgba(224,84,13,0.10);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.filter-btn.filtered:hover,
.filter-btn.filtered:focus {
  background: #fff4ee;
  color: #E0540D;
  border-color: #E0540D;
  box-shadow: 0 0 0 3px rgba(224,84,13,0.18), 0 2px 8px rgba(224,84,13,0.10);
}

/* ─── Map ──────────────────────────────────────────────── */
#map {
  width: 100%;
  height: 500px; /* Default height, adjusted in map-listings-row */
  position: relative; /* Needed for absolute positioning of controls */
}

/* ─── Listings Grid / Sidebar ────────────────────────────────────── */
/* Base styles removed, handled by map-listings-row */
/* .property-listings {
  padding: 30px;
} */

#listings-container {
    /* Styles applied within .listings-side */
}

.property-tile {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  display: flex; /* Use flexbox for layout */
  flex-direction: column; /* Stack content vertically */
  justify-content: space-between; /* Push button to bottom */
  width: 100%; /* Ensure full width within sidebar */
  box-sizing: border-box; /* Include padding in width */
  position: relative; /* Needed for overlay positioning */
  overflow: hidden;
}
.property-tile .property-price {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1.1em;
  color: #111; /* Darker price */
}
.property-tile .new-label,
.info-box .new-label {
  background-color: #E0540D !important;
  color: #fff !important; /* Changed to white for better contrast */
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  margin-left: 8px;
  font-weight: 600;
  vertical-align: middle;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(224,84,13,0.12);
  letter-spacing: 0.5px;
}
.property-tile .property-address {
  margin-bottom: 8px;
  color: #555;
  font-size: 0.95em; /* Slightly larger address */
}
.property-tile .property-details {
  margin-bottom: 12px;
  color: #777;
  font-size: 0.9em;
  flex-grow: 1; /* Allow details to take up space */
}
.property-tile .select-btn {
  background: #fff;
  color: #0eabdf;
  border: 2px solid #0eabdf;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  width: 55%;
  max-width: 150px;
  height: 30px; /* Reduced height */
  line-height: 26px; /* Adjust line-height for vertical center */
  text-align: center;
  margin-top: auto; /* Pushes to bottom */
  box-shadow: 0 0 0 0 rgba(224,84,13,0.18), 0 2px 8px rgba(224,84,13,0.10);
  align-self: flex-start; /* Align button to the left */
  padding: 0; /* Remove padding if using fixed height + line-height */
}
.property-tile .select-btn:hover,
.property-tile .select-btn:focus {
  background: #fff4ee;
  color: #E0540D;
  border-color: #E0540D;
  box-shadow: 0 0 0 3px rgba(224,84,13,0.18), 0 2px 8px rgba(224,84,13,0.10);
}
.property-tile .select-btn:disabled {
  background: #eee;
  color: #aaa;
  border-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── Modals ───────────────────────────────────────────── */
.modal {
  display: none; /* Initially hidden */
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.5); /* Semi-transparent background */
  z-index: 2000; /* High z-index */
  justify-content: center; /* Center horizontally */
  align-items: flex-start; /* Align to top */
  overflow-y: auto; /* Allow scrolling for the WHOLE modal overlay */
  padding: 40px 20px; /* Add padding for spacing from viewport edges */
}
.modal.show { /* Add class via JS to show */
    display: flex;
}
.modal-content {
  background: #fff;
  padding: 30px 28px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px; /* Max width for larger screens */
  position: relative;
  margin: auto; /* Center horizontally, auto vertically within padding */
  box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Add shadow */
  border: none; /* Remove blue rim */
  /* Removed max-height and overflow-y, handled by .modal */
}
.modal-content h2 {
  font-size: 1.6rem; /* Slightly larger heading */
  margin-bottom: 25px;
  padding-bottom: 12px;
  margin-top: 0;
  color: #333;
  border-bottom: 1px solid #eee; /* Add separator */
}
.modal-content .input-group { /* Group label and input */
    margin-bottom: 18px;
}
.modal-content label {
  display: block; /* Ensure label takes full width */
  font-weight: 500;
  margin-bottom: 8px; /* Increased spacing */
  color: #444; /* Slightly darker label */
}
.modal-content label input[type="email"], /* Target inputs within labels */
.modal-content label input[type="password"],
.modal-content label input[type="text"],
.modal-content .input-group input[type="email"], /* Target inputs in groups */
.modal-content .input-group input[type="password"],
.modal-content .input-group input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s; /* Add transition */
  margin-top: 4px; /* Add space between label and input */
  margin-bottom: 12px; 
}
.modal-content input:focus { /* General focus style */
    outline: none;
    border-color: #0eabdf;
    box-shadow: 0 0 0 3px rgba(14, 171, 223, 0.1); /* Focus indicator */
}

.modal-content button[type="submit"] {
  width: 100%;
  padding: 14px; /* Slightly more padding */
  border: none;
  background: #0eabdf;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color .25s;
}
.modal-content button[type="submit"]:hover {
  background: #0b8fbd; /* Darken on hover */
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  color: #888;
  transition: color 0.2s; /* Add transition */
}
.modal-close:hover {
  color: #333;
}

/* Link Line */
.switch-line {
  text-align: center;
  font-size: .9rem;
  margin-top: 25px;
  line-height: 1.6; /* Increased line height */
  color: #555;
}
.switch-line a {
  color: #0eabdf;
  text-decoration: none;
  font-weight: 600;
}
.switch-line a:hover {
  text-decoration: underline;
}

/* Map Markers and Effects */
.mapboxgl-marker {
  will-change: transform; /* Optimize animation */
  cursor: pointer; /* Indicate interactivity */
}

.blue-marker-container {
  position: relative;
  width: 0;
  height: 0;
  z-index: 1;
  /* Debug: Uncomment to see container boundaries */
  /* outline: 1px solid red; */
}

/* When hovered or active, bring the marker and info box to the very front */
.blue-marker-container.active,
.blue-marker-container:hover {
  z-index: 99999 !important;
}

.custom-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #E0540D !important;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transform: translate(-50%, -50%);
  z-index: 2;
  /* Debug: Uncomment to see marker boundaries */
  /* outline: 1px solid blue; */
}

.custom-marker::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(224, 84, 13, 0.3); /* Pulse in orange */
  border-radius: 50%;
  left: -12px; /* Center pulse */
  top: -12px; /* Center pulse */
  animation: pulse 2s infinite ease-in-out;
  z-index: -1; /* Ensure pulse is behind marker */
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 0.3; } /* Make pulse larger */
  100% { transform: scale(0.8); opacity: 0.7; }
}

.info-box {
  position: absolute;
  left: 50%;
  top: 100%; /* Position just below the marker */
  transform: translateX(-50%); /* Only translate X, not Y */
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  z-index: 100;
  background-color: white;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  color: #333;
  font-weight: 500;
  white-space: normal; /* Allow text wrapping */
  word-break: break-word;
  overflow: visible;
  text-overflow: unset;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  pointer-events: none; /* Invisible until hovered */
  opacity: 0;
  transition: opacity 0.2s, top 0.2s, left 0.2s, right 0.2s; /* Add transitions */
  display: flex;
  flex-direction: column;
  margin-top: -4px; /* slight upward overlap to eliminate hover gap */
  /* Debug: Uncomment to see info box boundaries */
  /* outline: 1px solid green; */
}

/* Flipping logic */
.info-box.flip-x {
  left: auto !important;
  right: 15px !important; /* Position relative to right */
}
.info-box.flip-y {
  top: -10px !important; /* Position above marker when flipped */
  transform: translateX(-50%) translateY(-100%) !important; /* Move up and flip */
}
.info-box.flip-y.flip-x { /* Adjust combined flip if needed */
    top: -10px !important;
    left: auto !important;
    right: 15px !important;
    transform: translateX(0) translateY(-100%) !important; /* Adjust transform for right positioning */
}


.info-box .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Push elements apart */
  width: 100%;
  margin-bottom: 4px; /* Space below price */
}

.info-box .price-tag {
  font-weight: bold;
  color: #111;
  font-size: 1.1em;
  margin-right: 4px; /* Space between price and label */
}

.info-box .new-label {
  margin-left: 0; /* Reset margin */
  margin-right: 0; /* Reset margin */
  flex-shrink: 0; /* Prevent label from shrinking */
}

.mapboxgl-marker:hover .info-box,
.blue-marker-container:hover .info-box {
  opacity: 1;
  pointer-events: auto; /* Allow interaction */
  top: 100%; /* Keep it below the marker */
  margin-top: -4px; /* Maintain the overlap */
}
/* Adjust hover position when flipped */
.mapboxgl-marker:hover .info-box.flip-y,
.blue-marker-container:hover .info-box.flip-y {
    top: 100% !important;
    margin-top: -4px !important;
}


/* Map Popup */
.mapboxgl-popup {
  z-index: 100001 !important; /* Ensure popup is above info-box */
  max-width: 280px !important; /* Control max width */
}

.mapboxgl-popup-content {
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: 'Poppins', sans-serif; /* Ensure consistent font */
  font-size: 0.9rem;
  color: #333;
}
.mapboxgl-popup-content h4 { /* Style popup title */
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #0eabdf;
}
.mapboxgl-popup-content p {
    margin: 4px 0;
    line-height: 1.4;
}
.mapboxgl-popup-content a {
    color: #0eabdf;
    text-decoration: none;
    font-weight: 500;
}
.mapboxgl-popup-content a:hover {
    text-decoration: underline;
}
.mapboxgl-popup-close-button { /* Style close button */
    font-size: 1.5rem;
    padding: 0 5px;
    color: #888;
    position: absolute; /* Ensure positioning */
    top: 5px;
    right: 5px;
}
.mapboxgl-popup-close-button:hover {
    color: #333;
    background: none; /* Remove default background */
}

/* Filter Modal Specific Styles */
.filter-modal-content { /* Specific class for filter modal */
  padding: 32px !important; /* Ensure specific padding */
  display: flex;
  flex-direction: column;
  max-width: 650px; /* Slightly narrower max-width for filters */
}

#filter-form {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Reduced gap between form elements */
  /* Removed overflow-y, handled by .modal */
}

.filter-group {
  margin-bottom: 20px; /* Consistent spacing */
  width: 100%;
}

.filter-group label {
  display: block;
  font-weight: 600; /* Bolder labels */
  margin-bottom: 10px; /* More space below label */
  font-size: 0.95rem;
  color: #333;
}

/* Bed/Bath/Parking specific styles */
.filter-group-rooms label {
  margin-bottom: 6px; /* Less space for dropdown labels */
}

.number-input { /* If used for bed/bath/parking */
  display: flex;
  gap: 10px;
}

.number-input input {
  width: calc(50% - 5px);
  padding: 10px 12px; /* Consistent padding */
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
  gap: 12px;
  padding: 8px 0;
  width: 100%;
}

.checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #f8f8f8;
  border-radius: 6px;
  transition: background-color 0.2s;
  cursor: pointer; /* Make label clickable */
  font-weight: 400; /* Normal weight for options */
  gap: 8px; /* Space between checkbox and text */
  font-size: 14px; /* Ensure consistent font size */
  color: #333; /* Ensure text color */
}

.checkbox-label:hover {
  background: #f0f0f0;
}

/* Custom Checkbox Styling */
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
    position: relative;
    background-color: white;
    vertical-align: middle; /* Align checkbox vertically */
}

/* Checked state */
.checkbox-label input[type="checkbox"]:checked {
    background-color: #0eabdf;
    border-color: #0eabdf;
}

/* Create checkmark using pseudo-element */
.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Hover state */
.checkbox-label input[type="checkbox"]:hover {
    border-color: #999; /* Subtle hover */
}
.checkbox-label input[type="checkbox"]:checked:hover {
    border-color: #0eabdf; /* Keep border color when checked and hovered */
}


.checkbox-label span {
    line-height: 1.3; /* Improve text wrapping */
    flex-grow: 1; /* Allow text to take remaining space */
}

/* Filter Row Adjustments */
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Default to 2 columns */
  gap: 24px; /* Slightly more gap */
  width: 100%;
  margin-bottom: 16px; /* Consistent bottom margin */
  align-items: start; /* Align items to the top */
}

/* Room Details Row Specifics */
.filter-row.rooms-row {
  grid-template-columns: repeat(3, 1fr); /* Force 3 equal columns */
  gap: 16px; /* Adjust gap for 3 columns */
}
.filter-group-rooms {
  min-width: 0; /* Allow shrinking */
  width: 100%;
}

/* Form Controls Base Styles */
.filter-select,
.date-picker {
  width: 100%;
  height: 45px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E"); /* Basic dropdown arrow */
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
  line-height: 1.5; /* Ensure text vertical alignment */
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #333; /* Default text color */
}

/* Add placeholder color styling for date picker */
.date-picker:invalid { /* Style when no date is selected */
    color: #999;
}
.date-picker::-webkit-datetime-edit-text,
.date-picker::-webkit-datetime-edit-month-field,
.date-picker::-webkit-datetime-edit-day-field,
.date-picker::-webkit-datetime-edit-year-field {
  /* Style individual parts if needed when invalid */
}
.date-picker::-webkit-input-placeholder { /* Standard placeholder styling */
    color: #999;
}
.date-picker:-moz-placeholder { /* Firefox */
    color: #999;
    opacity: 1;
}
.date-picker::-moz-placeholder { /* Firefox */
    color: #999;
    opacity: 1;
}
.date-picker:-ms-input-placeholder { /* Edge */
    color: #999;
}
.date-picker::-ms-input-placeholder { /* IE */
    color: #999;
}

/* Style the date picker when a date is selected */
.date-picker:valid {
  color: #333; /* Dark text for selected date */
}

.filter-select:focus,
.date-picker:focus {
  outline: none;
  border-color: #0eabdf;
  box-shadow: 0 0 0 3px rgba(14, 171, 223, 0.1); /* Focus indicator */
}

/* States Multiselect */
.states-multiselect-wrapper { /* Container for the state multiselect input+dropdown */
  position: relative;
  width: 100%;
}

#states-multiselect-wrapper.multiselect-search-wrapper { /* Apply base multiselect styles */
    min-height: 45px; /* Match other inputs */
    border-color: #ccc; /* Ensure consistent border */
    color: #333; /* Ensure text color */
}
#states-multiselect-wrapper.multiselect-search-wrapper:focus-within { /* Focus state for wrapper */
    border-color: #0eabdf;
    box-shadow: 0 0 0 3px rgba(14, 171, 223, 0.1);
}


.states-dropdown { /* Specific dropdown for states */
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px; /* Match other dropdowns */
  margin-top: 0px; /* Align directly below */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 2010; /* Ensure above other modal content */
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0; /* Add padding */
  display: none; /* Controlled by JS */
}
.states-dropdown.show {
    display: block;
}

.state-option {
  padding: 10px 14px; /* Consistent padding */
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  color: #333; /* Ensure text color */
}

.state-option:hover {
  background-color: #f0f4ff; /* Match autocomplete hover */
}

#states-input-inner.states-input { /* Be specific */
  border: none;
  outline: none;
  padding: 4px;
  font-size: 14px;
  flex: 1;
  min-width: 80px; /* Allow shrinking */
  background: transparent;
  color: #333; /* Default text color */
  height: auto; /* Allow height to be determined by content */
  align-self: center; /* Re-center vertically */
}
#states-input-inner.states-input::placeholder {
    color: #999; /* Ensure placeholder color */
}


/* Filter Actions (Buttons) */
.filter-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px; /* More padding */
  border-top: 1px solid #eee;
  width: 100%; /* Ensure full width */
}

/* Filter Modal Button Styles */
.filter-modal-btn {
  height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1; /* Make buttons share space equally */
  min-width: 80px; /* Ensure minimum width */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent; /* Base border */
  white-space: nowrap; /* Prevent wrapping */
}

/* Clear button style */
.filter-modal-btn.clear-btn {
  background: white;
  border-color: #0eabdf;
  color: #0eabdf;
}

.filter-modal-btn.clear-btn:hover {
  background: #f0f9fc; /* Light blue hover */
  border-color: #0b8fbd; /* Darker border on hover */
  color: #0b8fbd; /* Darker text on hover */
}

/* Search button style */
.filter-modal-btn.search-btn {
  background: #0eabdf;
  border-color: #0eabdf;
  color: white;
}

.filter-modal-btn.search-btn:hover {
  background: #0b8fbd; /* Darken on hover */
  border-color: #0b8fbd;
}


/* Price Range Slider */
.price-input .price-field { /* Legacy? Check if used */
  display: flex;
  margin-bottom: 22px;
  margin-top: 22px;
}

.price-field span { /* Legacy? Check if used */
  margin-right: 10px;
  margin-top: 6px;
  font-size: 17px;
}

.price-field input { /* Legacy? Check if used */
  flex: 1;
  height: 35px;
  font-size: 15px;
  font-family: "DM Sans", sans-serif;
  border-radius: 9px;
  text-align: center;
  border: 0px;
  background: #e4e4e4;
}

/* Container for slider + inputs */
.price-slider-container {
  padding: 10px 5px 0px 5px; /* Adjust padding */
  width: 100%;
}

.price-inputs {
  display: flex;
  justify-content: space-between;
  margin-top: 15px; /* Space between slider and inputs */
  gap: 20px;
}

.price-inputs input {
  width: calc(50% - 10px);
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  background: #f8f8f8;
  font-weight: 500; /* Make price values stand out */
  color: #333;
}
.price-inputs input:focus { /* Add focus style */
    outline: none;
    border-color: #aaa;
}


/* noUiSlider Customization */
#price-range-slider { /* Target the specific slider */
  margin-top: 10px; /* Space above slider */
}

.noUi-target {
    border: none !important; /* Remove default border */
    background: #e0e0e0 !important; /* Lighter track color */
    box-shadow: none !important;
    height: 4px !important; /* Thinner slider */
    /* padding-left: 25px !important; */ /* Remove padding, handles offset it */
}
.noUi-connect {
  background: #0eabdf !important; /* Blue connect bar */
}

.noUi-handle {
  border: 1px solid #0eabdf !important; /* Blue border */
  background: #ffffff !important;
  border-radius: 50% !important;
  cursor: grab !important; /* Indicate draggable */
  width: 20px !important; /* Slightly smaller handle */
  height: 20px !important;
  right: -10px !important; /* Center handle on bar (width/2) */
  top: -8px !important; /* Center handle vertically */
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important; /* Add shadow */
}
.noUi-handle:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(14, 171, 223, 0.2) !important; /* Focus indicator */
}
.noUi-handle:active {
    cursor: grabbing !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3) !important; /* Larger shadow when active */
}

.noUi-handle:before,
.noUi-handle:after {
  display: none !important; /* Remove pseudo-elements */
}


/* Utility Classes */
.mb-24 {
  margin-bottom: 24px;
}

.p-16 {
  padding: 16px;
}


/* Map + Listings Row Layout */
.map-listings-row {
  display: flex; /* Enable flexbox for side-by-side layout */
  flex-direction: row;
  width: 100%;
  height: calc(100vh - 120px); /* More accurate header height calculation */
  overflow: hidden; /* Prevent any scrolling at container level */
  position: relative;
  gap: 0;
  margin-bottom: 0;
  border-top: 1px solid #e0e0e0; /* Separator line */
  transition: all 0.3s ease; /* Smooth transition for layout changes */
}

/* Default state: folded on desktop */
.map-listings-row {
  /* Default to folded state */
}

/* Map side - always fills available space */
.map-side {
  flex: 1 1 100% !important; /* Map takes full width by default */
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  position: relative;
  height: 100% !important; /* Always fill parent height */
  transition: flex 0.3s ease, width 0.3s ease; /* Smooth transition for width changes */
}

/* When listings are unfolded, map takes normal space */
.map-listings-row.listings-unfolded .map-side {
  flex: 3 1 60% !important;
  max-width: calc(100% - 420px) !important;
}

/* Map element - always fills its container */
#map { /* Styles within map-side */
  width: 100%;
  height: 100% !important; /* Always fill parent height */
  min-height: 0; /* Override previous min-height */
}

.listings-side {
  flex: 0 0 0 !important; /* Collapse the listings panel by default */
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0; /* Override min-width */
  background: #f8f9fa; /* Lighter background for contrast */
  border-left: none; /* No border when collapsed */
  height: 100%;
  overflow: hidden; /* Hide content that overflows */
  padding: 0; /* Remove padding, add to container */
  display: flex;
  flex-direction: column;
  transition: flex 0.3s ease, width 0.3s ease, opacity 0.3s ease; /* Smooth transition for width and opacity */
  opacity: 0; /* Fade out content by default */
  /* Hide scrollbar for Chrome, Safari and Opera */
  &::-webkit-scrollbar {
    display: none;
  }
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* When listings are unfolded, show them normally */
.map-listings-row.listings-unfolded .listings-side {
  flex: 1 1 40% !important;
  max-width: 420px !important;
  min-width: 320px; /* Restore minimum width */
  opacity: 1;
  overflow-y: auto;
  border-left: 1px solid #e0e0e0;
}

#listings-container { /* Container within listings-side */
  display: flex;
  flex-direction: column;
  gap: 12px; /* Space between tiles */
  padding: 16px; /* Padding inside the sidebar */
  flex-grow: 1;
  background-color: #f1fafd; /* Allow container to grow */
}

/* Placeholder text */
#listings-container p {
  text-align: center;
  color: #555;
  padding: 20px;
  font-size: 0.9em;
}


/* Base Authentication Button Styles */
/* This MUST come after initial button styles to override */
.auth-btn-base {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 1em;
  width: 90px;      /* Fixed width */
  height: 46px;      /* Match search/filter button height */
  padding: 0;        /* Remove padding - use flex alignment */
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s; /* Consolidated transitions */
  box-sizing: border-box; /* Include border in width/height */
  border: 2px solid transparent; /* Base border to reserve space */
  text-align: center; /* Ensure text is centered */
  line-height: 1; /* Ensure text is centered vertically if flex alignment fails */
  flex-shrink: 0; /* Prevent button from shrinking */
}

/* Sign-in Specific Styles (applied over base) */
.sign-in-btn.auth-btn-base {
  background: #0eabdf;
  color: #fff;
  border-color: #0eabdf; /* Match background */
}
.sign-in-btn.auth-btn-base:hover {
  background: #0b8fbd;
  border-color: #0b8fbd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Add subtle hover shadow */
}

/* Sign-out Button Specific Styles */
/* Dimensions and layout are handled by .auth-btn-base */
.sign-out-btn.auth-btn-base {
  background: #fff;
  color: #0eabdf;
  border: 2px solid #0eabdf; /* Specific border */
}
.sign-out-btn.auth-btn-base:hover {
  background: #f0f9fc;
  color: #0b8fbd; /* Darker text */
  border-color: #0b8fbd; /* Darker border */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Add subtle hover shadow */
}


/* ─── Responsive Adjustments ──────────────────────────────── */

/* Larger Tablets / Smaller Laptops */
@media (max-width: 1024px) {
    .map-listings-row {
        height: calc(100vh - 130px); /* Adjust height */
    }
    .listings-side {
        min-width: 280px; /* Allow slightly narrower sidebar */
        flex-basis: 35%; /* Adjust flex basis */
    }
    .map-side {
        flex-basis: 65%; /* Adjust flex basis */
    }
}


/* Tablets and smaller */
@media (max-width: 900px) {
  /* Stack map and listings */
  .map-listings-row {
    flex-direction: column;
    height: auto; /* Allow height to be determined by content */
    min-height: 0; /* Reset min-height */
  }
  .map-side {
    width: 100%;
    height: 350px; /* Fixed height for map on mobile */
    flex-basis: auto; /* Reset flex basis */
  }
  #map { /* Ensure map fills its container */
    height: 100%;
    min-height: 0;
  }
  .listings-side {
    width: 100%;
    min-width: 0;
    max-width: 100%; /* Allow full width */
    height: auto; /* Auto height */
    max-height: 50vh; /* Limit height to prevent excessive scrolling */
    border-left: none;
    border-top: 1px solid #e0e0e0;
    flex-basis: auto; /* Reset flex basis */
  }
  #listings-container {
    padding: 12px; /* Adjust padding */
  }

  /* Responsive Filter Form */
  .filter-row {
      grid-template-columns: 1fr; /* Stack filter groups */
      gap: 16px; /* Adjust gap */
  }
  .filter-row.rooms-row {
      grid-template-columns: 1fr; /* Stack rooms too */
  }
  .price-inputs {
      flex-direction: column; /* Stack price inputs */
      gap: 10px; /* Adjust gap */
      margin-top: 15px; /* Adjust space */
  }
  .price-inputs input {
      width: 100%; /* Make inputs full width when stacked */
  }
  .filter-actions {
      flex-direction: column; /* Stack action buttons */
      gap: 12px; /* Adjust gap */
      margin-top: 24px; /* Adjust space */
  }
  .filter-modal-btn { /* Ensure buttons take full width */
      width: 100%;
      flex: none; /* Reset flex grow/shrink */
  }
  .checkbox-group {
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Adjust min width */
  }
}


/* Medium Screens (Tablets) */
@media (max-width: 768px) {
    header {
        padding: 14px 20px; /* Maintain good top/bottom padding */
        margin-top: 6px; /* Slightly reduced top margin */
        gap: 10px; /* Slightly reduced gap */
    }
    .logo {
        font-size: 1.6em;
    }
    .catchphrase-text {
        font-size: 1.6em;
    }
    .search-container {
        flex-direction: row; /* Keep search/filter in a row */
        align-items: stretch;
        max-width: 100%;
        gap: 10px; /* Maintain consistent spacing */
    }
    .search-buttons-row {
        gap: 10px; /* Consistent spacing */
        flex-wrap: nowrap; /* Keep buttons on same row */
    }
    .search-btn, .filter-btn {
        min-width: 60px;
        font-size: 0.95em;
        padding: 0 10px; /* Adjust padding */
    }

    .modal-content {
        width: 98%; /* Make wider on mobile */
        max-width: none; /* Remove max-width constraint on mobile */
        padding: 25px 20px;
    }
    .filter-modal-content {
        padding: 28px 24px !important;
        width: 98%; /* Make filter modal wider too */
        max-width: none; /* Remove max-width constraint */
    }

}

/* Adjust header layout for slightly smaller screens */
@media (max-width: 700px) {
    header {
        padding: 12px 16px; /* Maintain good top/bottom padding */
        margin-top: 4px; /* Reduced top margin */
        gap: 8px; /* Maintain minimum spacing */
    }
    .left-section {
        gap: 8px;
        flex-shrink: 1; /* Allow left section to shrink slightly if needed */
        min-width: 0; /* Ensure shrinking works */
        margin-left: 4px; /* Reduced margin for smaller screens */
    }
    .right-section {
        gap: 8px; /* Maintain minimum spacing */
        margin-right: 4px; /* Reduced margin for smaller screens */
        flex-wrap: wrap; /* Ensure wrapping on smaller screens */
        row-gap: 6px; /* Gap between wrapped rows */
    }

    /* Hamburger adjustments */
    .hamburger {
        width: 32px;
        height: 22px;
        margin-left: 4px; /* Add space between hamburger and other elements */
    }
    .hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); } /* Adjust hamburger animation */
    .hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .logo-icon {
      width: 153px;
      height: 46px;
      margin-top: 6px; /* Reduced top margin */
    }
    .logo {
        font-size: 1.8em; /* Slightly smaller logo text */
        margin-top: 6px; /* Reduced top margin */
    }

    /* Hide user email on small screens */
    .user-info span#user-email {
        display: none;
    }

    /* NOTE: No changes to .sign-in-btn or .sign-out-btn here */
    /* Their size is fixed by .auth-btn-base */

    /* Adjust dropdown position */
    .dropdown-menu {
        top: 55px; /* Adjust based on new header height */
        right: 15px;
    }
    
    /* Ensure search container maintains spacing */
    .search-container {
        gap: 8px; /* Maintain minimum spacing */
    }
    .search-buttons-row {
        gap: 8px; /* Maintain minimum spacing */
        flex-wrap: nowrap; /* Keep buttons on same row */
    }
}


/* Stack search input and buttons row */
@media (max-width: 600px) {
  .search-container {
    flex-direction: column;
    gap: 8px; /* Maintain minimum spacing */
  }
  .search-input-container {
    width: 100%;
    flex: none; /* Reset flex */
  }
  .search-buttons-row {
    width: 100%;
    flex: none; /* Reset flex */
    gap: 8px; /* Maintain minimum spacing */
    flex-wrap: nowrap; /* Keep buttons on same row */
    flex-direction: row; /* Ensure horizontal layout */
  }
  .filter-btn, .search-btn {
    flex: 1 1 50%; /* Each button takes 50% */
    width: auto; /* Let flex determine width */
    min-width: 0; /* Remove min-width */
    font-size: 0.9em; /* Slightly smaller font */
  }

  /* Responsive Filter Form Rooms Row */
   .filter-row.rooms-row {
      grid-template-columns: 1fr; /* Stack vertically on very small screens */
      gap: 12px;
  }
}


/* Small Screens (Mobiles) */
@media (max-width: 480px) {
    header {
        flex-direction: row; /* Keep everything on the same row */
        align-items: center;
        justify-content: space-between;
        padding: 20px 12px; /* Increased top/bottom padding to 20px */
        margin-top: 30px;
        gap: 8px; /* Maintain minimum spacing between sections */
    }
    
    /* Make modals wider on mobile */
    .modal-content {
        width: 100%; /* Full width on mobile */
        max-width: none;
        padding: 20px 16px; /* Slightly reduced padding for mobile */
        margin: 10px; /* Add small margin for visual separation */
    }
    .filter-modal-content {
        width: 100%; /* Full width on mobile */
        max-width: none;
        padding: 24px 20px !important; /* Adjusted padding for mobile */
        margin: 10px; /* Add small margin for visual separation */
    }
    .left-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px; /* Maintain minimum spacing */
        margin-left: 4px; /* Reduced margin for smaller screens */
        flex-shrink: 0; /* Prevent logo from shrinking */
    }
    .right-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px; /* Maintain minimum spacing */
        margin-right: 4px; /* Reduced margin for smaller screens */
        flex-wrap: wrap; /* Allow wrapping if needed */
        row-gap: 6px; /* Gap between wrapped rows */
        justify-content: flex-end;
    }
    .header-search-section {
        width: 100%;
        margin-top: 8px !important;
        margin-bottom: 8px !important;
        padding: 0;
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .search-container {
        flex-direction: column;
        gap: 8px; /* Maintain minimum spacing */
        width: 100%;
        max-width: 100%;
        align-items: stretch;
    }
    .search-input-container {
        width: 100%;
        margin-bottom: 0;
    }
    .search-buttons-row {
        width: 100%;
        flex-direction: row;
        gap: 8px; /* Maintain minimum spacing */
        justify-content: stretch;
        flex-wrap: nowrap; /* Keep buttons on same row */
        flex-shrink: 0; /* Prevent shrinking */
    }
    .filter-btn, .search-btn, .auth-btn-base, .sign-in-btn, .sign-out-btn, .calendly-floating-button {
        font-size: 1em !important;
        min-width: 80px;
    }
    .dropdown-menu, .dropdown-menu a, .user-info, .hamburger {
        font-size: 0.59em !important;
    }
    .dropdown-menu {
        min-width: 120px;
    }
    .logo-icon {
        width: 120px; /* Smaller logo for mobile */
        height: 36px;  
    }
    .greeting-hover {
      font-size: 0.59em !important;
      width: 95% !important; /* Make wider on mobile */
      max-width: none !important; /* Remove max-width constraint */
      padding: 20px 16px !important; /* Reduced padding for mobile */
    }
    .search-section {
      margin-bottom: 4px !important;
    }
}

/* Very Small Screens adjustments */
@media (max-width: 360px) {
    header {
        gap: 6px; /* Minimum spacing for very small screens */
        padding: 16px 10px; /* Increased top/bottom padding for better spacing */
        margin-top: 6px; /* Match larger screens for visual consistency */
        flex-direction: row; /* Keep everything on the same row */
    }
    
    /* Make greeting hover wider on very small screens */
    .greeting-hover {
        width: 98% !important; /* Almost full width */
        max-width: none !important;
        padding: 16px 12px !important; /* Minimal padding */
        font-size: 0.9em !important; /* Slightly larger font for readability */
    }
    .logo {
        font-size: 1.2em;
    }
    .left-section {
        gap: 6px; /* Minimum spacing */
        margin-left: 2px; /* Minimal margin */
    }
    .right-section {
        gap: 6px; /* Minimum spacing */
        row-gap: 4px; /* Minimal row gap */
        flex-wrap: wrap; /* Ensure wrapping on very small screens */
        justify-content: flex-end; /* Keep buttons on the right */
    }
    .auth-btn-base {
        margin: 2px; /* Add small margin to prevent overlap */
        min-width: 70px; /* Ensure minimum button width */
    }
    .search-container {
        gap: 6px; /* Minimum spacing */
    }
    .search-buttons-row {
        gap: 6px; /* Minimum spacing */
        flex-wrap: nowrap; /* Keep buttons on same row */
        flex-direction: row; /* Ensure horizontal layout */
    }
    .search-btn, .filter-btn {
        font-size: 0.85em; /* Smallest font size */
        min-width: 70px; /* Ensure minimum button width */
    }
    .filter-modal-btn {
        font-size: 14px;
        height: 40px;
    }
    .logo-icon {
        width: 100px; /* Even smaller logo for very small screens */
        height: 30px;
    }
}

/* Extra Small Screens - Ensure minimum spacing is maintained */
@media (max-width: 320px) {
    header {
        gap: 4px; /* Absolute minimum spacing */
        padding: 14px 8px; /* Increased top/bottom padding for better spacing */
        margin-top: 4px; /* Match larger screens for visual consistency */
        flex-direction: row; /* Keep everything on the same row */
    }
    
    /* Make greeting hover full width on extra small screens */
    .greeting-hover {
        width: 100% !important; /* Full width */
        max-width: none !important;
        padding: 12px 8px !important; /* Minimal padding */
        font-size: 0.85em !important; /* Smaller font to fit content */
        margin: 10px !important; /* Small margin for visual separation */
    }
    
    .left-section {
        gap: 4px; /* Absolute minimum spacing */
        margin-left: 0; /* No margin on smallest screens */
    }
    .right-section {
        gap: 4px; /* Absolute minimum spacing */
        row-gap: 3px; /* Minimal row gap */
        justify-content: flex-end; /* Keep buttons on the right */
    }
    .search-container {
        gap: 4px; /* Absolute minimum spacing */
    }
    .search-buttons-row {
        gap: 4px; /* Absolute minimum spacing */
        flex-wrap: nowrap; /* Keep buttons on same row */
        flex-direction: row; /* Ensure horizontal layout */
    }
    .auth-btn-base {
        min-width: 60px; /* Minimum viable button width */
        height: 40px; /* Slightly smaller height */
        font-size: 0.9em; /* Smaller font */
    }
    .search-btn, .filter-btn {
        min-width: 60px; /* Minimum viable button width */
        height: 40px; /* Slightly smaller height */
        font-size: 0.8em; /* Smaller font */
    }
    .logo-icon {
        width: 80px; /* Smallest logo for extra small screens */
        height: 24px;
    }
}

/* Ensure layout recalculates if needed */
.search-buttons-row {
  display: flex; /* Reaffirm flex display */
  flex-direction: row;
  gap: 8px; /* Reaffirm gap */
  /* width: 100%; --- Handled by flex sizing */
}

.info-blur-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  backdrop-filter: blur(6px) brightness(0.8);
  background: rgba(14,42,74,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.blur-message {
  color: #fff;
  font-weight: 700;
  font-size: 1.1em;
  text-shadow: 0 2px 8px #0e2a4a;
  background: rgba(14,42,74,0.7);
  padding: 8px 18px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.listing-blur-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(14,42,74,0);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  pointer-events: all;
}

.listing-blur-overlay .blur-message {
  color: #fff;
  font-weight: 700;
  font-size: 1.1em;
  text-shadow: 0 2px 8px #0e2a4a;
  background: rgba(14,42,74,0.7);
  padding: 8px 18px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.blur-signup-btn {
  background: #fff;
  color: #0e2a4a;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1em;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14,42,74,0.10);
  transition: background 0.2s, color 0.2s;
  outline: none;
  margin: 0 auto;
  display: block;
}

.blur-signup-btn:hover, .blur-signup-btn:focus {
  background: #e6f0fa;
  color: #0e2a4a;
}

/* Remove or override .logo-icon, header, and .search-section rules in media queries that conflict with the new sizes. */
@media (max-width: 900px), (max-width: 700px), (max-width: 480px), (max-width: 360px) {
  .logo-icon {
    width: 153px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  .search-section {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (min-width: 769px) {
  header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  .left-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  .header-search-section {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 24px;
    padding: 0;
    min-width: 0;
  }
  .search-section {
    margin: 0 !important;
    padding: 0 !important;
    order: 0;
    position: static;
    z-index: 1;
  }
  .right-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  .logo {
    display: none !important;
  }
}

/* Centered greeting hover with logo and formatted text */
.greeting-hover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Dimmed background overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s;
  padding: 20px; /* Add padding to prevent running off screen */
}

.greeting-hover .modal-content {
  background: #fff; /* White background like other modals */
  color: #222;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 28px 32px 28px 32px; /* Reduced padding */
  max-width: 600px;
  font-size: 1.12em;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px; /* Reduced gap */
  text-align: center;
  max-height: 85vh; /* Reduced max height */
  overflow-y: auto;
  position: relative;
  
  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
.greeting-hover .modal-content::-webkit-scrollbar {
  display: none;
}
.greeting-hover .greeting-logo {
  width: 90px;
  height: auto;
  margin-bottom: 8px;
}
.greeting-hover .greeting-highlight {
  color: #10ACDC;
  font-weight: bold;
}
.greeting-hover .close-btn {
  background: none;
  border: none;
  color: #666; /* Gray color for better visibility */
  font-size: 2.5em; /* Much larger close button */
  font-weight: 300; /* Lighter weight for cleaner look */
  cursor: pointer;
  position: absolute;
  top: 8px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.greeting-hover .close-btn:hover {
  background: #f0f0f0; /* Light background on hover */
  color: #333; /* Darker color on hover */
}

/* Video Section Styles */
.greeting-video-section {
  width: 100%;
  margin: 16px 0; /* Reduced margin */
}

.greeting-video-section iframe {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  height: 240px; /* Reduced height for mobile */
}

/* Footer Section Styles */
.greeting-footer-section {
  width: 100%;
  margin-top: 16px; /* Reduced margin */
  padding-top: 16px; /* Reduced padding */
  border-top: 1px solid #e0e0e0;
}

.greeting-feedback-btn {
  background: #fff;
  color: #0e2a4a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95em;
  padding: 6px 16px;
  margin-top: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(14,42,74,0.08);
  white-space: nowrap;
}

.greeting-feedback-btn:hover {
  background: #e6f0fa;
  color: #0e2a4a;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-search-section, .search-section {
  margin-top: 32px !important;
  margin-bottom: 32px !important;
}

/* Property Tile Color Coding based on Update Recency */
.property-tile.recent-update {
  border-left: 4px solid #D9430D; /* Bright orange for 0-3 days */
}
.property-tile.moderate-update {
  border-left: 4px solid #9b3b07; /* Lighter brown for 3-14 days */
}
.property-tile.older-update {
  border-left: 4px solid #5F6F73; /* Darker gray for 14+ days */
}

/* Map Marker Color Coding based on Update Recency */
.custom-marker.recent-update {
  background-color: #D9430D !important; /* Bright orange for 0-3 days */
}
.custom-marker.moderate-update {
  background-color: #9b3b07 !important; /* Lighter brown for 3-14 days */
}
.custom-marker.older-update {
  background-color: #5F6F73 !important; /* Darker gray for 14+ days */
}

/* Adjust pulse animation colors to match marker colors */
.custom-marker.recent-update::after {
  background: rgba(217, 67, 13, 0.3); /* Pulse in bright orange */
}
.custom-marker.moderate-update::after {
  background: rgba(155, 59, 7, 0.3); /* Pulse in lighter brown */
}
.custom-marker.older-update::after {
  background: rgba(95, 111, 115, 0.3); /* Pulse in darker gray */
}
.custom-marker.very-old-update {
  background-color: #3a4244 !important; /* Very dark gray for 30+ days (rare) */
}
.custom-marker.very-old-update::after {
  background: rgba(58, 66, 68, 0.2); /* Pulse in very dark gray */
}

/* Property Tile very-old-update */
.property-tile.very-old-update {
  border-left: 4px solid #3a4244; /* Very dark gray for 30+ days */
}

/* Calendly Button Styles (Inline in Header) - NO FLOATING BUTTON */
.calendly-floating-button {
  position: static; /* Inline positioning in header */
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px; /* Match other buttons */
  box-shadow: 0 2px 8px rgba(243, 95, 30, 0.2);
  background: #f35f1e;
  color: #ffffff;
  padding: 0;
  border: none;
  overflow: hidden;
  width: auto;
  min-width: 120px; /* Reduced width for inline positioning */
  height: 46px; /* Match other button heights */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.9em;
}

.calendly-floating-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(243, 95, 30, 0.3);
  background: #e54d1a;
}

.calendly-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 12px;
}

.calendly-button-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.9em;
  white-space: nowrap;
  color: #ffffff;
}

/* COMPLETELY REMOVED ALL FLOATING CALENDLY BUTTON STYLES */

/* Mobile responsive adjustments for Calendly button - COMPACT SIZING */
@media (max-width: 768px) {
  .calendly-floating-button {
    min-width: 70px;
    height: 30px;
    font-size: 0.65em;
  }
  
  .calendly-button-text {
    font-size: 0.65em;
  }
  
  .calendly-button-content {
    padding: 0 3px;
  }
  
  /* Reduce all header button sizes for mobile - COMPACT */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger {
    width: 50px !important;
    height: 30px !important;
    font-size: 0.65em !important;
  }
  
  .hamburger {
    width: 20px !important;
    height: 14px !important;
  }
  
  .hamburger span {
    height: 2px;
    max-width: 16px;
  }
  
  .hamburger.active span:nth-child(1) { 
    transform: translateY(6px) rotate(45deg); 
  }
  
  .hamburger.active span:nth-child(3) { 
    transform: translateY(-6px) rotate(-45deg); 
  }
  
  /* Reduce logo size for mobile */
  .logo-icon {
    width: 80px !important;
    height: 24px !important;
  }
}

@media (max-width: 480px) {
  .calendly-floating-button {
    min-width: 60px;
    height: 28px;
    font-size: 0.6em;
  }
  
  .calendly-button-text {
    font-size: 0.6em;
  }
  
  .calendly-button-content {
    padding: 0 2px;
  }
  
  /* Further reduce button sizes for smaller mobile */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger {
    width: 45px !important;
    height: 28px !important;
    font-size: 0.6em !important;
  }
  
  .hamburger {
    width: 18px !important;
    height: 12px !important;
  }
  
  .hamburger span {
    height: 1.5px;
    max-width: 14px;
  }
  
  .hamburger.active span:nth-child(1) { 
    transform: translateY(5.5px) rotate(45deg); 
  }
  
  .hamburger.active span:nth-child(3) { 
    transform: translateY(-5.5px) rotate(-45deg); 
  }
  
  /* Smaller logo for mobile */
  .logo-icon {
    width: 70px !important;
    height: 21px !important;
  }
}

@media (max-width: 360px) {
  .calendly-floating-button {
    min-width: 50px;
    height: 26px;
    font-size: 0.55em;
  }
  
  .calendly-button-text {
    font-size: 0.55em;
  }
  
  .calendly-button-content {
    padding: 0 2px;
  }
  
  /* Even smaller buttons for very small screens */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger {
    width: 40px !important;
    height: 26px !important;
    font-size: 0.55em !important;
  }
  
  .hamburger {
    width: 16px !important;
    height: 10px !important;
  }
  
  .hamburger span {
    height: 1.5px;
    max-width: 12px;
  }
  
  .hamburger.active span:nth-child(1) { 
    transform: translateY(4.5px) rotate(45deg); 
  }
  
  .hamburger.active span:nth-child(3) { 
    transform: translateY(-4.5px) rotate(-45deg); 
  }
  
  /* Even smaller logo */
  .logo-icon {
    width: 60px !important;
    height: 18px !important;
  }
}

@media (max-width: 320px) {
  .calendly-floating-button {
    min-width: 45px;
    height: 24px;
    font-size: 0.5em;
  }
  
  .calendly-button-text {
    font-size: 0.5em;
  }
  
  .calendly-button-content {
    padding: 0 1px;
  }
  
  /* Smallest buttons for extra small screens */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger {
    width: 35px !important;
    height: 24px !important;
    font-size: 0.5em !important;
  }
  
  .hamburger {
    width: 14px !important;
    height: 8px !important;
  }
  
  .hamburger span {
    height: 1px;
    max-width: 10px;
  }
  
  .hamburger.active span:nth-child(1) { 
    transform: translateY(3.5px) rotate(45deg); 
  }
  
  .hamburger.active span:nth-child(3) { 
    transform: translateY(-3.5px) rotate(-45deg); 
  }
  
  /* Smallest logo */
  .logo-icon {
    width: 50px !important;
    height: 15px !important;
  }
}

/* Map Ribbon Overlay */
.map-side {
  position: relative; /* Ensure positioning context for ribbon */
}

.map-ribbon-container {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 120px;
  z-index: 1000;
}

.map-ribbon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 120px 120px;
  border-color: transparent transparent #585c64 transparent; /* Dark triangle */
}

.ribbon-content {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* pointer-events: none; */ /* REMOVED: This prevented hover on parent container */
}

.ribbon-inner {
  transform: rotate(-45deg) translateY(2px) translateX(5px) !important;
  text-align: center;
  color: #ffffff; /* Final white font color */
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.ribbon-text-small {
  font-size: 11px;
  display: block;
}

.ribbon-text-large {
  font-size: 15px;
  display: block;
}

/* Version tooltip styles */
.version-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  background: white;
  border: 2px solid #585c64;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10000;
  pointer-events: auto;
  width: 350px;
  max-height: 400px;
}

.map-ribbon-container:hover .version-tooltip {
  display: block;
}

.tooltip-header {
  background: #585c64;
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px 6px 0 0;
}

.tooltip-content {
  max-height: 340px;
  overflow-y: auto;
  padding: 12px 16px;
}

.area-item {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.area-item strong {
  color: #f35f1e;
  display: block;
  margin-bottom: 2px;
}

/* Scrollbar styling for tooltip */
.tooltip-content::-webkit-scrollbar {
  width: 8px;
}

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

.tooltip-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.tooltip-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile responsive adjustments for ribbon */
@media (max-width: 768px) {
  .map-ribbon-container {
    width: 100px;
    height: 100px;
  }
  
  .map-ribbon {
    border-width: 0 0 100px 100px;
  }
  
  .ribbon-content {
    bottom: 8px;
    right: 8px;
  }
  
  .ribbon-text-small {
    font-size: 11px;
  }
  
  .ribbon-text-large {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .map-ribbon-container {
    width: 80px;
    height: 80px;
  }
  
  .map-ribbon {
    border-width: 0 0 80px 80px;
  }
  
  .ribbon-content {
    bottom: 6px;
    right: 6px;
  }
  
  .ribbon-text-small {
    font-size: 10px;
  }
  
  .ribbon-text-large {
    font-size: 12px;
  }
}

/* Mobile responsive adjustments for ribbon */
@media (max-width: 768px) {
  .map-ribbon-container {
    width: 100px;
    height: 100px;
  }
  
  .map-ribbon {
    border-width: 0 0 100px 100px;
  }
  
  .ribbon-content {
    width: 100px;
    height: 100px;
  }
  
  .ribbon-inner {
    transform: rotate(-45deg) translateY(16px) translateX(1px);
  }
  
  .ribbon-text-small {
    font-size: 10px;
  }
  
  .ribbon-text-large {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .map-ribbon-container {
    width: 80px;
    height: 80px;
  }
  
  .map-ribbon {
    border-width: 0 0 80px 80px;
  }
  
  .ribbon-content {
    width: 80px;
    height: 80px;
  }
  
  .ribbon-inner {
    transform: rotate(-45deg) translateY(13px) translateX(1px);
  }
  
  .ribbon-text-small {
    font-size: 9px;
  }
  
  .ribbon-text-large {
    font-size: 11px;
  }
}

/* Map Legend Styles */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.legend-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 400;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.legend-dot.recent-dot {
  background-color: #D9430D;
}

.legend-dot.moderate-dot {
  background-color: #9b3b07;
}

.legend-dot.older-dot {
  background-color: #5F6F73;
}

/* Mobile responsive adjustments for legend */
@media (max-width: 768px) {
  .map-legend {
    bottom: 15px;
    left: 15px;
    padding: 10px 12px;
    font-size: 11px;
  }
  
  .legend-title {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .legend-item {
    margin-bottom: 4px;
  }
  
  .legend-dot {
    width: 10px;
    height: 10px;
    margin-right: 6px;
  }
}

@media (max-width: 480px) {
  .map-legend {
    bottom: 10px;
    left: 10px;
    padding: 8px 10px;
    font-size: 10px;
  }
  
  .legend-title {
    font-size: 11px;
    margin-bottom: 5px;
  }
  
  .legend-item {
    margin-bottom: 3px;
  }
  
  .legend-dot {
    width: 8px;
    height: 8px;
    margin-right: 5px;
  }
}

@media (max-width: 768px) {
  .map-listings-row {
    flex-direction: column;
    height: calc(100vh - 120px); /* More accurate header height calculation */
    overflow: hidden; /* Prevent scrolling */
  }
  
  .listings-side {
    display: none; /* Hide property cards on mobile */
  }
  
  .map-side {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important; /* Always fill parent height */
    position: relative !important;
  }
  
  #map {
    height: 100% !important;
  }
  
  /* Ensure consistent button font sizes */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger, .calendly-floating-button {
    font-size: 0.9em !important;
  }
  
  /* Reduce header size further */
  header {
    padding: 4px 16px;
    margin-bottom: 1px;
    margin-top: 1px;
    gap: 8px;
  }
  
  .logo-icon {
    width: 120px;
    height: 36px;
  }
  
  .search-container {
    gap: 8px;
  }
  
  .search-buttons-row {
    gap: 8px;
  }
  
  .search-btn, .filter-btn {
    font-size: 0.9em;
    padding: 8px 12px;
  }
  
  .modal-content {
    padding: 20px;
    max-width: 95%;
  }
  
  .filter-modal-content {
    padding: 20px;
    max-width: 95%;
    max-height: 80vh;
  }
}

@media (max-width: 480px) {
  .map-listings-row {
    flex-direction: column;
    height: calc(100vh - 120px); /* More accurate header height calculation */
    overflow: hidden; /* Prevent scrolling */
  }
  
  .listings-side {
    display: none; /* Hide property cards on mobile */
  }
  
  .map-side {
    width: 100%;
    height: calc(100vh - 100px); /* Adjust for smaller header */
  }
  
  #map {
    height: 100%;
  }
  
  header {
    gap: 6px;
    padding: 3px 12px;
    margin-bottom: 1px;
    margin-top: 1px;
    flex-direction: row;
  }
  
  .modal-content {
    padding: 16px;
    max-width: 98%;
  }
  
  .filter-modal-content {
    padding: 16px;
    max-width: 98%;
    max-height: 75vh;
  }
  
  .left-section {
    gap: 8px;
    margin-left: 2px;
  }
  
  .right-section {
    gap: 6px;
    row-gap: 4px;
    justify-content: flex-end;
  }
  
  .header-search-section {
    margin-bottom: 2px !important;
  }
  
  .search-container {
    gap: 6px;
  }
  
  .search-input-container {
    gap: 6px;
  }
  
  .search-buttons-row {
    gap: 6px;
  }
  
  .filter-btn, .search-btn, .auth-btn-base, .sign-in-btn, .sign-out-btn, .calendly-floating-button {
    font-size: 0.85em !important;
    padding: 6px 10px;
  }
  
  .dropdown-menu, .dropdown-menu a, .user-info, .hamburger {
    font-size: 0.85em !important;
  }
  
  .dropdown-menu {
    right: 8px;
  }
  
  .logo-icon {
    width: 100px;
    height: 30px;
  }
  
  .greeting-hover {
    padding: 10px;
  }
  
  .greeting-hover .modal-content {
    padding: 20px 16px;
    font-size: 0.95em;
  }
  
  .greeting-video-section iframe {
    height: 200px; /* Even smaller video on very small screens */
  }
  
  .search-section {
    margin-bottom: 2px !important;
  }
}

@media (max-width: 360px) {
  .map-listings-row {
    flex-direction: column;
    height: calc(100vh - 120px); /* More accurate header height calculation */
    overflow: hidden; /* Prevent scrolling */
  }
  
  .listings-side {
    display: none; /* Hide property cards on mobile */
  }
  
  .map-side {
    width: 100%;
    height: calc(100vh - 90px); /* Adjust for smaller header */
  }
  
  #map { /* Ensure map fills its container */
    height: 100%;
  }
  
  /* Ensure consistent button font sizes */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger, .calendly-floating-button {
    font-size: 0.65em !important;
  }
  
  /* Reduce header size further - COMPACT */
  header {
    padding: 2px 12px;
    margin-bottom: 0px;
    margin-top: 0px;
    gap: 4px;
  }
  
  .logo-icon {
    width: 80px;
    height: 24px;
  }
  
  .search-container {
    gap: 6px;
  }
  
  .search-buttons-row {
    gap: 6px;
  }
  
  .search-btn, .filter-btn {
    font-size: 0.8em;
    padding: 6px 10px;
  }
  
  .modal-content {
    padding: 20px;
    max-width: 95%;
  }
  
  .filter-modal-content {
    padding: 20px;
    max-width: 95%;
    max-height: 80vh;
  }
}

@media (max-width: 320px) {
  .map-listings-row {
    flex-direction: column;
    height: calc(100vh - 120px); /* More accurate header height calculation */
    overflow: hidden; /* Prevent scrolling */
  }
  
  .listings-side {
    display: none; /* Hide property cards on mobile */
  }
  
  .map-side {
    width: 100%;
    height: calc(100vh - 80px); /* Adjust for smaller header */
  }
  
  #map { /* Ensure map fills its container */
    height: 100%;
  }
  
  /* Ensure consistent button font sizes */
  .auth-btn-base, .sign-in-btn, .sign-out-btn, .hamburger, .calendly-floating-button {
    font-size: 0.5em !important;
  }
  
  /* Reduce header size further - COMPACT */
  header {
    padding: 1px 6px;
    margin-bottom: 0px;
    margin-top: 0px;
    gap: 3px;
  }
  
  .logo-icon {
    width: 70px;
    height: 21px;
  }
  
  .search-container {
    gap: 4px;
  }
  
  .search-buttons-row {
    gap: 4px;
  }
  
  .search-btn, .filter-btn {
    font-size: 0.75em;
    padding: 4px 6px;
    min-width: 50px;
  }
  
  .modal-content {
    padding: 16px;
    max-width: 98%;
  }
  
  .filter-modal-content {
    padding: 16px;
    max-width: 98%;
    max-height: 75vh;
  }
}

/* Mobile responsive adjustments for ribbon (768px) */
@media (max-width: 768px) {
  .map-ribbon-container { 
    width: 100px; 
    height: 100px; 
  }
  .map-ribbon { 
    border-width: 0 0 100px 100px; 
  }
  .ribbon-content { 
    width: 100px; 
    height: 100px; 
  }
  .ribbon-inner { 
    transform: rotate(-45deg) translateY(15px) translateX(0px); /* Adjusted for mobile */
  }
  .ribbon-text-small { 
    font-size: 10px; 
  }
  .ribbon-text-large { 
    font-size: 13px; 
  }
}
/* Mobile responsive adjustments for ribbon (480px) */
@media (max-width: 480px) {
  .map-ribbon-container { 
    width: 80px; 
    height: 80px; 
  }
  .map-ribbon { 
    border-width: 0 0 80px 80px; 
  }
  .ribbon-content { 
    width: 80px; 
    height: 80px; 
  }
  .ribbon-inner { 
    transform: rotate(-45deg) translateY(12px) translateX(0px); /* Adjusted for mobile */
  }
  .ribbon-text-small { 
    font-size: 9px; 
  }
  .ribbon-text-large { 
    font-size: 11px; 
  }
}

/* Hide any potential Calendly floating elements */
[data-calendly-widget],
.calendly-badge-widget,
.calendly-inline-widget {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  z-index: -9999 !important;
}

/* Ensure no floating Calendly elements */
.calendly-badge-widget {
  display: none !important;
}

/* Map Ribbon Overlay */

/* Fold/Unfold Button Styles */
.fold-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 32px;
  height: 80px;
  background: #0eabdf;
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

.fold-toggle-btn:hover {
  background: #0b8fbd;
  width: 36px;
}

.fold-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.fold-icon {
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.3s ease;
  transform: rotate(180deg); /* Default: point right (folded state) */
}

/* Button icon rotation for folded/unfolded states */
.fold-toggle-btn.folded .fold-icon {
  transform: rotate(180deg); /* Point right when folded */
}

.fold-toggle-btn.unfolded .fold-icon {
  transform: rotate(0deg); /* Point left when unfolded */
}

/* Map side expansion when listings are folded */
.map-listings-row.listings-folded .map-side {
  flex: 1 1 100% !important;
  max-width: 100% !important;
}

.map-listings-row.listings-unfolded .map-side {
  flex: 3 1 60% !important;
  max-width: calc(100% - 420px) !important;
}

/* Mobile responsive adjustments for fold button */
@media (max-width: 768px) {
  .fold-toggle-btn {
    display: none; /* Hide fold button on mobile since listings are already hidden */
  }
  
  .listings-side {
    display: none !important; /* Hide listings on mobile */
    transform: none !important; /* Reset any transforms on mobile */
  }
  
  .map-listings-row.listings-folded .map-side,
  .map-listings-row.listings-unfolded .map-side {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: calc(100vh - 120px) !important; /* More accurate header height for mobile */
    position: relative !important; /* Ensure positioning context */
  }
  
  .map-listings-row.listings-folded .listings-side,
  .map-listings-row.listings-unfolded .listings-side {
    display: none !important;
  }
  
  /* Add top spacing for header elements */
  header {
    padding-top: 8px !important;
  }
  
  .left-section {
    padding-top: 4px !important;
  }
  
  .right-section {
    padding-top: 4px !important;
  }
  
  /* Ensure map legend and version ribbon are visible at bottom */
  .map-legend {
    position: absolute !important;
    bottom: 15px !important;
    left: 15px !important;
    z-index: 1000 !important;
    background: rgba(0, 0, 0, 0.8) !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
  }
  
  .map-ribbon-container {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    z-index: 1000 !important;
  }
  
  /* Fix version text positioning within triangle - move lower and more to the right */
  .ribbon-inner {
    transform: rotate(-45deg) translateY(2px) translateX(5px) !important;
  }
  
  .ribbon-text-small {
    font-size: 8px !important;
  }
  
  .ribbon-text-large {
    font-size: 12px !important;
  }
}

/* Delete functionality styles */
.year-trigger {
    /* Completely invisible styling - no visual indication */
}

.delete-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 10000;
    display: none;
    font-size: 14px;
    min-width: 120px;
}

.delete-context-menu div {
    padding: 8px 12px;
    cursor: pointer;
    color: #d32f2f;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.delete-context-menu div:hover {
    background-color: #f5f5f5;
}

@media (max-width: 480px) {
  .map-ribbon-container { 
    bottom: 10px !important;
    right: 10px !important;
  }
  
  .map-ribbon { 
    width: 60px !important;
    height: 60px !important;
  }
  
  .ribbon-content { 
    width: 60px !important;
    height: 60px !important;
  }
  
  .ribbon-inner { 
    transform: rotate(-45deg) translateY(2px) translateX(5px) !important;
  }
  
  .ribbon-text-small { 
    font-size: 6px !important;
  }
  
  .ribbon-text-large { 
    font-size: 10px !important;
  }
  
  .map-legend {
    bottom: 10px !important;
    left: 10px !important;
    padding: 6px 10px !important;
  }
  
  .legend-title {
    font-size: 10px !important;
  }
  
  .legend-item {
    font-size: 8px !important;
    margin-bottom: 4px !important;
  }
  
  .legend-dot {
    width: 8px !important;
    height: 8px !important;
  }
}

.map-side {
  height: 100vh !important; /* Use full viewport height on mobile */
  position: relative !important;
}

.map-side {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important; /* Always fill parent height */
  position: relative !important;
}
