/* ==========================================================================
   Spark MLS - Public Pages Shared Styles
   Used by: search.html, detail.html
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-text-light: #9a9a9a;
  --color-accent: #2c5545;
  --color-accent-hover: #1e3d32;
  --color-accent-light: #e8f0ec;
  --color-border: #e5e5e5;
  --color-border-light: #f0eeea;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* --------------------------------------------------------------------------
   Base Reset & Body
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  background: var(--color-accent);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links > a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links > a:hover,
.nav-links > a.active {
  color: white;
}

/* --------------------------------------------------------------------------
   Status Badges
   -------------------------------------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.active,
.status-active {
  background: #e6f4ea;
  color: #1e7e34;
}

.status-badge.pending,
.status-pending {
  background: #fff8e6;
  color: #9a6700;
}

.status-badge.closed,
.status-closed {
  background: #e8f0fe;
  color: #1a56db;
}

.status-badge.expired,
.status-expired {
  background: #fce8e6;
  color: #c5221f;
}

.status-badge.withdrawn,
.status-withdrawn,
.status-badge.canceled,
.status-canceled {
  background: #f1f3f4;
  color: #5f6368;
}

/* Default/unknown status - hide the badge when no status */
.status-badge.status-,
.status-badge:not(.active):not(.pending):not(.closed):not(.expired):not(.withdrawn):not(.canceled) {
  display: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.btn-secondary:hover {
  background: #d4e5dc;
}

/* --------------------------------------------------------------------------
   Loading & Error States
   -------------------------------------------------------------------------- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
  padding: 60px 24px;
  color: var(--color-text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.empty-state .btn {
  margin-top: 16px;
}

.error-state {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 24px;
  border-radius: var(--radius-lg);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container-public {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-public.wide {
  max-width: 1400px;
}

/* --------------------------------------------------------------------------
   Universal Action Buttons (Analyze, Save, Compare)
   Used on: homepage carousels, search cards, saved cards, listing detail
   -------------------------------------------------------------------------- */

/* Base circular action button - NO positioning (parent handles that) */
.action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-decoration: none;
  color: var(--color-text-muted);
}

.action-btn:hover {
  background: white;
  transform: scale(1.1);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Analyze button - green on hover */
.action-btn--analyze:hover {
  background: var(--color-accent);
  color: white;
}

/* Save button - red theme */
.action-btn--save:hover {
  background: #fee2e2;
  color: #dc2626;
}

.action-btn--save.active {
  background: #dc2626;
  color: white;
}

.action-btn--save.active svg {
  fill: white;
}

/* Compare button - green theme */
.action-btn--compare:hover {
  background: var(--color-accent);
  color: white;
}

.action-btn--compare.active {
  background: var(--color-accent);
  color: white;
}

.action-btn--compare.active svg {
  fill: white;
}

.action-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn.disabled:hover {
  transform: none;
  background: rgba(255,255,255,0.95);
}

/* Share button - blue theme */
.action-btn--share:hover {
  background: #dbeafe;
  color: #2563eb;
}

.action-btn--share.active {
  background: #2563eb;
  color: white;
}

/* Message button - green theme */
.action-btn--message:hover {
  background: #dcfce7;
  color: #16a34a;
}

.action-btn--message.active {
  background: #16a34a;
  color: white;
}

/* Compare Button (Text version for detail page) */
.compare-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.compare-btn-text:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.compare-btn-text svg {
  width: 18px;
  height: 18px;
}

.compare-btn-text.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.compare-btn-text.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Floating Compare Bar */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 16px 24px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.compare-bar.visible {
  transform: translateY(0);
}

.compare-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.compare-bar-count {
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.compare-bar-count.full {
  background: var(--color-accent);
  color: white;
}

.compare-bar-items {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
}

.compare-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  min-width: 200px;
  max-width: 280px;
}

.compare-bar-item img {
  width: 50px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.compare-bar-item-info {
  flex: 1;
  min-width: 0;
}

.compare-bar-item-address {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-bar-item-price {
  font-size: 12px;
  color: var(--color-text-muted);
}

.compare-bar-item-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.compare-bar-item-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.compare-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.compare-bar-actions .btn-primary {
  white-space: nowrap;
}

.compare-bar-clear {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}

.compare-bar-clear:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* Compare bar tooltip */
.compare-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.compare-btn:hover .compare-tooltip,
.compare-btn-text:hover .compare-tooltip {
  opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .compare-bar {
    padding: 12px 16px;
  }

  .compare-bar-inner {
    flex-wrap: wrap;
  }

  .compare-bar-items {
    width: 100%;
    order: 1;
  }

  .compare-bar-item {
    min-width: 160px;
  }

  .compare-bar-actions {
    width: 100%;
    justify-content: space-between;
    order: 0;
    margin-bottom: 12px;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1a1a1a;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-10px);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-warning {
  background: #f59e0b;
  color: #1a1a1a;
}

.toast-error {
  background: #dc2626;
}

.toast-success {
  background: var(--color-accent);
}

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

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* --------------------------------------------------------------------------
   Save/Favorite Feature
   -------------------------------------------------------------------------- */

/* Save Button on Cards */
.save-btn {
  position: absolute;
  top: 12px;
  right: 52px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 5;
}

.save-btn:hover {
  background: white;
  transform: scale(1.1);
}

.save-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-text-muted);
  fill: none;
  transition: all 0.2s;
}

.save-btn.active {
  background: #dc2626;
}

.save-btn.active svg {
  stroke: white;
  fill: white;
}

.save-btn:hover:not(.active) svg {
  stroke: #dc2626;
}

/* ==========================================================================
   Search Page Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Search Hero Section
   -------------------------------------------------------------------------- */
.search-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3f2f 100%);
  overflow: hidden;
}

.search-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px;
  max-width: 800px;
  width: 100%;
}

.search-hero-title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.search-hero-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  margin-bottom: 32px;
}

.search-hero-bar {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  margin-bottom: 24px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-icon {
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  margin-left: 12px;
  flex-shrink: 0;
}

.search-hero-input {
  flex: 1;
  border: none;
  padding: 16px 12px;
  font-size: 17px;
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text);
}

.search-hero-input:focus {
  outline: none;
}

.search-hero-input::placeholder {
  color: var(--color-text-light);
}

.search-hero-btn {
  padding: 16px 32px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.search-hero-btn:hover {
  background: var(--color-accent-hover);
}

/* Search Autocomplete */
.search-hero-bar {
  position: relative;
}

.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-autocomplete.visible {
  display: block;
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--color-border-light);
}

.search-autocomplete-item:last-child {
  border-bottom: none;
}

.search-autocomplete-item:hover,
.search-autocomplete-item.highlighted {
  background: var(--color-accent-light);
}

.search-autocomplete-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.search-autocomplete-item span {
  font-size: 15px;
  color: var(--color-text);
}

.search-autocomplete-item span strong {
  color: var(--color-accent);
}

.search-autocomplete-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.quick-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.quick-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  transition: all 0.2s;
}

.quick-link:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

@media (max-width: 640px) {
  .search-hero {
    min-height: 300px;
  }

  .search-hero-title {
    font-size: 36px;
  }

  .search-hero-subtitle {
    font-size: 16px;
  }

  .search-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .search-hero-input {
    width: 100%;
    text-align: center;
  }

  .search-hero-btn {
    width: 100%;
  }

  .quick-links {
    flex-direction: column;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   Filter Bar Container (Sticky)
   -------------------------------------------------------------------------- */
.filter-bar-container {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.3s;
}

.filter-bar-container.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filter-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Filter Pills
   -------------------------------------------------------------------------- */
.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.filter-pill.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.filter-pill-group {
  display: flex;
  background: var(--color-bg);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--color-border);
}

.filter-pill-group .filter-pill {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 17px;
}

.filter-pill-group .filter-pill:hover {
  background: var(--color-surface);
}

.filter-pill-group .filter-pill.active {
  background: var(--color-accent);
  color: white;
}

/* Property type filter group - slightly different styling */
.filter-type-group {
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
}

.filter-type-group .filter-pill {
  font-size: 13px;
  padding: 6px 12px;
}

/* On mobile, wrap the type pills to second row */
@media (max-width: 900px) {
  .filter-type-group {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 8px;
    flex-wrap: wrap;
  }
}

.filter-pill-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.filter-pill.open .filter-pill-chevron {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Filter Dropdowns & Popovers
   -------------------------------------------------------------------------- */
.filter-dropdown {
  position: relative;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
}

.filter-dropdown.open .filter-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-popover-header {
  padding: 16px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.filter-popover-content {
  padding: 8px 16px 16px;
}

.filter-popover-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.filter-popover-apply {
  padding: 8px 20px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}

.filter-popover-apply:hover {
  background: var(--color-accent-hover);
}

.filter-popover-reset {
  padding: 8px 16px;
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  font-weight: 500;
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
}

.filter-popover-reset:hover {
  color: var(--color-text);
}

/* Price Range Inputs in Popover */
.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-input-group {
  flex: 1;
}

.price-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.price-input-group select,
.price-input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.2s;
}

.price-input-group select:focus,
.price-input-group input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.price-separator {
  color: var(--color-text-light);
  padding-top: 20px;
}

/* Beds/Baths Pills in Popover */
.beds-baths-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bb-pill {
  padding: 8px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.bb-pill:hover {
  border-color: var(--color-accent);
}

.bb-pill.active {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Flood Zone Pills */
.flood-zone-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fz-pill {
  padding: 8px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.fz-pill:hover {
  border-color: #3b82f6;
}

.fz-pill.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* Home Type Checkboxes in Popover */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
}

.filter-checkbox:last-child {
  border-bottom: none;
}

.filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.filter-checkbox span {
  font-size: 14px;
  color: var(--color-text);
}

/* More Filters Button */
.filter-pill-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill-more svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Active Filter Chips
   -------------------------------------------------------------------------- */
.active-filters {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: none;
}

.active-filters.visible {
  display: block;
}

.active-filters-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-filters-label {
  font-size: 13px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.filter-chip-remove {
  width: 16px;
  height: 16px;
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.filter-chip-remove:hover {
  background: rgba(44, 85, 69, 0.2);
}

.filter-chip-remove svg {
  width: 12px;
  height: 12px;
}

.clear-all-filters {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.clear-all-filters:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Results Header
   -------------------------------------------------------------------------- */
.results-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}

.results-count {
  font-size: 15px;
  color: var(--color-text-muted);
}

.results-count strong {
  color: var(--color-text);
  font-weight: 600;
}

.results-sort select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.results-sort select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.view-toggle {
  display: flex;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--color-border);
}

.view-toggle-btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle-btn:hover {
  color: var(--color-text);
}

.view-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.view-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Property Grid (Enhanced)
   -------------------------------------------------------------------------- */
.results-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.property-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .property-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* --------------------------------------------------------------------------
   Property List View
   -------------------------------------------------------------------------- */
.property-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-list-item {
  display: flex;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

.property-list-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.property-list-item:nth-child(1) { animation-delay: 0s; }
.property-list-item:nth-child(2) { animation-delay: 0.03s; }
.property-list-item:nth-child(3) { animation-delay: 0.06s; }
.property-list-item:nth-child(4) { animation-delay: 0.09s; }
.property-list-item:nth-child(5) { animation-delay: 0.12s; }

.property-list-link {
  display: flex;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.list-photo {
  position: relative;
  width: 280px;
  min-width: 280px;
  height: 180px;
  background: var(--color-surface);
  flex-shrink: 0;
}

.list-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-photo .card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.list-photo .card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 24px);
}

.list-photo .card-badges .card-badge {
  position: static;
}

.list-photo .card-photo-placeholder {
  height: 100%;
}

.list-details {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-display);
}

.list-address {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
}

.list-city {
  font-size: 14px;
  color: var(--color-text-muted);
}

.list-specs {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-text);
}

.list-specs span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-meta {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.list-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-type {
  background: var(--color-surface);
  padding: 3px 8px;
  border-radius: 4px;
}

.list-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-left: 1px solid var(--color-border);
  background: var(--color-bg);
  justify-content: center;
  min-width: 130px;
}

.list-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: white;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.list-action-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.list-action-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.list-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* List view responsive */
@media (max-width: 900px) {
  .list-photo {
    width: 200px;
    min-width: 200px;
    height: 150px;
  }

  .list-details {
    padding: 16px;
  }

  .list-price {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .property-list-item {
    flex-direction: column;
  }

  .list-photo {
    width: 100%;
    height: 200px;
  }

  .list-actions {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--color-border);
    justify-content: flex-start;
  }

  .list-action-btn {
    flex: 1;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Property Card (Enhanced)
   -------------------------------------------------------------------------- */
.property-card-wrapper {
  position: relative;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

/* Staggered animation delays for cards */
.property-card-wrapper:nth-child(1) { animation-delay: 0s; }
.property-card-wrapper:nth-child(2) { animation-delay: 0.05s; }
.property-card-wrapper:nth-child(3) { animation-delay: 0.1s; }
.property-card-wrapper:nth-child(4) { animation-delay: 0.15s; }
.property-card-wrapper:nth-child(5) { animation-delay: 0.2s; }
.property-card-wrapper:nth-child(6) { animation-delay: 0.25s; }
.property-card-wrapper:nth-child(7) { animation-delay: 0.3s; }
.property-card-wrapper:nth-child(8) { animation-delay: 0.35s; }
.property-card-wrapper:nth-child(9) { animation-delay: 0.4s; }
.property-card-wrapper:nth-child(10) { animation-delay: 0.45s; }
.property-card-wrapper:nth-child(n+11) { animation-delay: 0.5s; }

.property-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.property-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

/* Card Photo */
.card-photo {
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #f5f4f2 0%, #eae8e4 100%);
  overflow: hidden;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .card-photo img {
  transform: scale(1.05);
}

.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.card-photo-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.card-photo-placeholder span {
  font-size: 13px;
}

/* Card Action Buttons (fade in on hover) */
.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.25s ease;
}

.property-card-wrapper:hover .card-actions {
  opacity: 1;
  transform: translateY(0);
}

/* Card Badges */
.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 5;
}

.card-badge {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-badge.badge-active { background: #e6f4ea; color: #1e7e34; }
.card-badge.badge-pending { background: #fff8e6; color: #9a6700; }
.card-badge.badge-closed { background: #e8f0fe; color: #1a56db; }
.card-badge.badge-new { background: var(--color-accent); color: white; }
.card-badge.badge-price-drop { background: #dc2626; color: white; }
.card-badge.badge-open-house { background: #7c3aed; color: white; }
.card-badge.badge-coming-soon { background: #8b5cf6; color: white; }

/* Photo Count */
.card-photo-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-photo-count svg {
  width: 14px;
  height: 14px;
}

/* Card Content */
.card-content {
  padding: 18px 20px 22px;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.card-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.card-price-change {
  font-size: 13px;
  font-weight: 600;
}

.card-price-change.down {
  color: #dc2626;
}

.card-price-change.up {
  color: #059669;
}

.card-address {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.card-city {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.card-specs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.card-specs .spec {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-specs .spec strong {
  color: var(--color-text);
  font-weight: 600;
}

.card-specs .spec-divider {
  color: var(--color-border);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 40px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active,
.pagination .pagination-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Admin Link Footer
   -------------------------------------------------------------------------- */
.admin-link {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--color-border);
  margin-top: 40px;
}

.admin-link a {
  color: var(--color-text-muted);
  font-size: 14px;
  text-decoration: none;
}

.admin-link a:hover {
  color: var(--color-accent);
}

/* ==========================================================================
   Compare Page Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Compare Page Container
   -------------------------------------------------------------------------- */
.compare-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* --------------------------------------------------------------------------
   Compare Empty State
   -------------------------------------------------------------------------- */
.compare-empty {
  text-align: center;
  padding: 80px 24px;
}

.compare-empty svg {
  width: 80px;
  height: 80px;
  color: var(--color-text-light);
  margin-bottom: 24px;
  opacity: 0.5;
}

.compare-empty h2 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-text);
  margin-bottom: 12px;
}

.compare-empty p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   Compare Property Grid (Columns)
   -------------------------------------------------------------------------- */
.compare-grid {
  display: grid;
  gap: 24px;
}

.compare-grid.cols-1 {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin: 0 auto;
}

.compare-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.compare-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --------------------------------------------------------------------------
   Compare Property Card
   -------------------------------------------------------------------------- */
.compare-property {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.compare-property:nth-child(1) { animation-delay: 0s; }
.compare-property:nth-child(2) { animation-delay: 0.1s; }
.compare-property:nth-child(3) { animation-delay: 0.2s; }

.compare-property-photo {
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #f5f4f2 0%, #eae8e4 100%);
  overflow: hidden;
}

.compare-property-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.compare-property:hover .compare-property-photo img {
  transform: scale(1.05);
}

.compare-property-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 5;
}

.compare-property-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.compare-property-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
}

.compare-property-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.compare-property-address {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.compare-property-city {
  font-size: 14px;
  color: var(--color-text-muted);
}

.compare-property-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.compare-property-link:hover {
  color: var(--color-accent-hover);
}

/* No photo placeholder for compare */
.compare-no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.compare-no-photo svg {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Compare Table (Side-by-Side Comparison)
   -------------------------------------------------------------------------- */
.compare-table {
  margin-top: 40px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.5s ease 0.3s forwards;
}

.compare-section {
  border-bottom: 1px solid var(--color-border);
}

.compare-section:last-child {
  border-bottom: none;
}

.compare-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 16px 20px 12px;
  background: var(--color-bg);
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.compare-row {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--color-border-light);
}

.compare-row:last-child {
  border-bottom: none;
}

.compare-row.cols-1 {
  grid-template-columns: 1fr;
}

.compare-row.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.compare-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.compare-cell {
  padding: 14px 20px;
  border-right: 1px solid var(--color-border-light);
}

.compare-cell:last-child {
  border-right: none;
}

.compare-cell-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.compare-cell-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.compare-cell-value.highlight-best {
  color: #15803d;
}

.compare-cell-value.highlight-worst {
  color: #dc2626;
}

.compare-cell-value.na {
  color: var(--color-text-light);
  font-weight: 400;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Compare Page Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .compare-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare-row.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare-grid.cols-3 .compare-property:nth-child(3) {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .compare-container {
    padding: 24px 16px 60px;
  }

  .compare-grid.cols-2,
  .compare-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .compare-grid.cols-3 .compare-property:nth-child(3) {
    grid-column: span 1;
    max-width: none;
  }

  .compare-property-price {
    font-size: 24px;
  }

  .compare-table {
    margin-top: 24px;
  }

  .compare-row.cols-2,
  .compare-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .compare-cell {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: none;
  }

  .compare-cell-label {
    margin-bottom: 0;
  }

  .compare-section-title {
    padding: 12px 16px;
  }
}

/* ==========================================================================
   Cities Page Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   City Grid
   -------------------------------------------------------------------------- */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* --------------------------------------------------------------------------
   City Card (Neighborhood Cards) - Premium Dark Style
   -------------------------------------------------------------------------- */
.city-card {
  display: flex;
  flex-direction: column;
  background: #1e3a4f;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
  overflow: hidden;
}

.city-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.city-card-header {
  padding: 32px 28px 28px;
  background: linear-gradient(135deg, #1a3344 0%, #2d4a5e 50%, #1e3a4f 100%);
  position: relative;
}

.city-card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.city-card-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  position: relative;
  z-index: 1;
}

.city-card-body {
  padding: 24px 28px;
  background: #1e3a4f;
  flex: 1;
}

.city-card-stats-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}

.city-card-stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.city-card-stat-label {
  font-size: 12px;
  color: #7fb3d3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.city-card-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.city-card-empty {
  font-size: 14px;
  color: #7fb3d3;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
  grid-column: 1 / -1;
}

/* Last 7 Days section on city cards */
.city-card-week {
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.2) 0%, rgba(201, 169, 98, 0.1) 100%);
  border-top: 1px solid rgba(201, 169, 98, 0.3);
  border-bottom: 1px solid rgba(201, 169, 98, 0.3);
  padding: 12px 20px;
}

.city-card-week-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #C9A962;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.city-card-week-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}

.city-card-week-stat {
  text-align: center;
}

.city-card-week-stat .week-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #C9A962;
}

.city-card-week-stat .week-label {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.city-card.has-week-data {
  border: 1px solid rgba(201, 169, 98, 0.4);
}

.city-card-footer {
  padding: 20px 28px;
  background: rgba(0, 0, 0, 0.15);
  text-align: center;
}

.city-card-link {
  font-size: 14px;
  color: #4fc3f7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.city-card:hover .city-card-link {
  color: #81d4fa;
}

/* --------------------------------------------------------------------------
   Cities Page Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .city-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .city-card-header {
    padding: 24px 20px 20px;
  }

  .city-card-body {
    padding: 20px;
  }

  .city-card-footer {
    padding: 16px 20px;
  }

  .city-card-name {
    font-size: 22px;
  }

  .city-card-stats-list {
    gap: 16px;
  }

  .city-card-stat-value {
    font-size: 16px;
  }
}

/* ==========================================================================
   Neighborhood Market Report Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Market Report Container
   -------------------------------------------------------------------------- */
.market-report-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* --------------------------------------------------------------------------
   Market Condition Banner
   -------------------------------------------------------------------------- */
.market-condition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

.market-condition-label {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.market-condition-supply {
  font-size: 14px;
  opacity: 0.9;
}

.market-condition.market-hot {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
}

.market-condition.market-warm {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: white;
}

.market-condition.market-balanced {
  background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%);
  color: white;
}

.market-condition.market-cool {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
}

.market-condition.market-cold {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

.market-condition.market-unknown {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

/* --------------------------------------------------------------------------
   Week Snapshot (Last 7 Days)
   -------------------------------------------------------------------------- */
.week-snapshot {
  background: linear-gradient(135deg, #1e3a5a 0%, #2c5545 100%);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  color: white;
}

.week-snapshot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.week-snapshot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.week-snapshot-header svg {
  opacity: 0.8;
}

.week-snapshot-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.week-stat {
  text-align: center;
}

.week-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #C9A962;
  margin-bottom: 4px;
}

.week-stat-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.week-snapshot-note {
  margin: 12px 0 0;
  font-size: 13px;
  opacity: 0.7;
  text-align: center;
  font-style: italic;
}

@media (max-width: 900px) {
  .week-snapshot-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .week-stat-value {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .week-snapshot-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Section Title
   -------------------------------------------------------------------------- */
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Market Stats Grid
   -------------------------------------------------------------------------- */
.market-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.market-stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}

.market-stat-card:nth-child(1) { animation-delay: 0.1s; }
.market-stat-card:nth-child(2) { animation-delay: 0.15s; }
.market-stat-card:nth-child(3) { animation-delay: 0.2s; }
.market-stat-card:nth-child(4) { animation-delay: 0.25s; }

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--color-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Market Details Grid
   -------------------------------------------------------------------------- */
.market-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.market-details-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  opacity: 0;
  animation: fadeUp 0.4s ease 0.3s forwards;
}

.market-details-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: var(--color-text-muted);
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Trends Table
   -------------------------------------------------------------------------- */
.market-trends-card {
  grid-column: span 2;
}

.trends-table-wrapper {
  overflow-x: auto;
}

.trends-table {
  width: 100%;
  border-collapse: collapse;
}

.trends-table th,
.trends-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.trends-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

.trends-table td {
  font-size: 14px;
  color: var(--color-text);
}

.trends-table tbody tr:hover {
  background: var(--color-bg);
}

/* --------------------------------------------------------------------------
   Property Type Bars
   -------------------------------------------------------------------------- */
.property-type-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-type-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
}

.property-type-label {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-type-bar-wrapper {
  height: 24px;
  background: var(--color-bg);
  border-radius: 12px;
  overflow: hidden;
}

.property-type-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3f2f 100%);
  border-radius: 12px;
  min-width: 4px;
}

.property-type-stats {
  display: flex;
  gap: 8px;
  font-size: 13px;
  min-width: 100px;
  justify-content: flex-end;
}

.property-type-count {
  color: var(--color-text);
  font-weight: 500;
}

.property-type-pct {
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Market CTA
   -------------------------------------------------------------------------- */
.market-cta {
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3f2f 100%);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  margin-top: 32px;
  opacity: 0;
  animation: fadeUp 0.4s ease 0.5s forwards;
}

.market-cta h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: white;
  margin-bottom: 8px;
}

.market-cta p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
}

.market-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.market-cta .btn-primary {
  background: white;
  color: var(--color-accent);
}

.market-cta .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.market-cta .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.market-cta .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   Market Report Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .market-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .market-details-grid {
    grid-template-columns: 1fr;
  }

  .market-trends-card {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .market-report-container {
    padding: 24px 16px 60px;
  }

  .market-condition {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }

  .market-stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 28px;
  }

  .property-type-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .property-type-stats {
    justify-content: flex-start;
  }

  .market-cta {
    padding: 32px 24px;
  }

  .market-cta h3 {
    font-size: 24px;
  }

  .market-cta-buttons {
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   DOM Distribution Chart
   -------------------------------------------------------------------------- */
.dom-distribution {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dom-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  gap: 12px;
  align-items: center;
}

.dom-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.dom-bar-wrapper {
  height: 20px;
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
}

.dom-bar {
  height: 100%;
  border-radius: 10px;
  min-width: 4px;
}

.dom-bar.dom-fast { background: #22c55e; }
.dom-bar.dom-moderate { background: #84cc16; }
.dom-bar.dom-slow { background: #eab308; }
.dom-bar.dom-very-slow { background: #f97316; }
.dom-bar.dom-stale { background: #ef4444; }

.dom-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Area Demographics Section
   -------------------------------------------------------------------------- */
.demographics-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
  opacity: 0;
  animation: fadeUp 0.4s ease 0.55s forwards;
}

.demographics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.demographics-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.demographics-header h2 svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-accent);
}

.demographics-source {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

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

.demographics-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.demographics-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* Ownership Chart */
.ownership-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.ownership-chart h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.ownership-bar-wrapper {
  display: flex;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.ownership-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  transition: width 0.6s ease;
}

.ownership-bar span {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.ownership-bar.owner {
  background: linear-gradient(135deg, var(--color-accent) 0%, #3d7a5f 100%);
}

.ownership-bar.renter {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.ownership-legend {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.ownership-legend span {
  font-size: 13px;
  color: var(--color-text-muted);
}

.ownership-legend strong {
  color: var(--color-text);
}

/* Demographics Responsive */
@media (max-width: 900px) {
  .demographics-grid {
    grid-template-columns: 1fr;
  }

  .demographics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ownership-legend {
    flex-direction: column;
    gap: 8px;
  }

  .ownership-bar span {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   Contact Agent Modal
   -------------------------------------------------------------------------- */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.contact-modal.visible {
  opacity: 1;
  visibility: visible;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.contact-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.contact-modal.visible .contact-modal-content {
  transform: translateY(0);
}

.contact-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.contact-modal-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.contact-modal-close svg {
  width: 18px;
  height: 18px;
}

.contact-modal-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
}

.contact-modal-content > p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.contact-modal-content .form-group {
  margin-bottom: 16px;
}

.contact-modal-content label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.contact-modal-content input,
.contact-modal-content textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.contact-modal-content input:focus,
.contact-modal-content textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.contact-modal-content textarea {
  resize: vertical;
  min-height: 80px;
}

.contact-modal-content .btn-block {
  width: 100%;
  margin-top: 8px;
}

/* Contact Success State */
.contact-success {
  text-align: center;
  padding: 20px 0;
}

.contact-success svg {
  width: 64px;
  height: 64px;
  color: #22c55e;
  margin-bottom: 16px;
}

.contact-success h3 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.contact-success p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* ==================== */
/* RESO DATA HELPERS    */
/* ==================== */

/* Placeholder for missing data sections */
.reso-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--color-bg, #faf9f7);
  border-radius: 8px;
  color: var(--color-text-muted, #6b6b6b);
  text-align: center;
  min-height: 100px;
}

.reso-placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reso-placeholder-icon svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
  margin-bottom: 8px;
}

.reso-placeholder-text {
  font-size: 13px;
  line-height: 1.4;
}

/* N/A styling for inline text */
.reso-na {
  color: var(--color-text-light, #999);
  font-style: italic;
}

/* Photo placeholder in cards */
.card-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e6e1 0%, #d4d2cd 100%);
  color: var(--color-text-muted, #6b6b6b);
}

.card-photo-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 8px;
}

.card-photo-placeholder span {
  font-size: 13px;
}

/* Demo data notice */
.demo-data-notice {
  background: #fff9e6;
  border: 1px solid #ffd54f;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: #856404;
}

.demo-data-notice strong {
  display: block;
  margin-bottom: 4px;
}

/* Empty section state */
.section-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: 8px;
}

.section-empty p {
  margin: 0;
  font-size: 14px;
}

/* ==========================================================================
   Homepage - Zillow-Style Design
   ========================================================================== */

/* --------------------------------------------------------------------------
   Compact Hero Section
   -------------------------------------------------------------------------- */
.home-hero {
  position: relative;
  padding: 60px 24px 48px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3f2f 100%);
  text-align: center;
}

.home-hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.home-hero-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 500;
  color: white;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.home-hero-subtitle {
  color: rgba(255,255,255,0.75);
  font-size: 16px;
  margin-bottom: 28px;
}

.home-search-bar {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  margin-bottom: 24px;
  position: relative;
}

.home-search-bar .search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-search-bar .search-input-icon {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  margin-left: 12px;
  flex-shrink: 0;
}

.home-search-input {
  flex: 1;
  border: none;
  padding: 14px 12px;
  font-size: 16px;
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text);
}

.home-search-input:focus {
  outline: none;
}

.home-search-input::placeholder {
  color: var(--color-text-light);
}

.home-search-btn {
  padding: 14px 28px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.home-search-btn:hover {
  background: var(--color-accent-hover);
}

/* Quick Links */
.home-quick-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.home-quick-link:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.home-quick-link svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .home-hero {
    padding: 40px 16px 36px;
  }

  .home-hero-title {
    font-size: 32px;
  }

  .home-search-bar .search-input-wrapper {
    flex-direction: column;
  }

  .home-search-bar .search-input-icon {
    display: none;
  }

  .home-search-input {
    width: 100%;
    text-align: center;
  }

  .home-search-btn {
    width: 100%;
  }

  .home-quick-links {
    gap: 8px;
  }

  .home-quick-link {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   Homepage Sections
   -------------------------------------------------------------------------- */
.home-section {
  padding: 48px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.home-section-alt {
  background: var(--color-bg);
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.home-section-alt > .home-section-header,
.home-section-alt > .neighborhoods-grid {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.home-section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.home-section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

.home-section-link:hover {
  color: var(--color-accent-hover);
}

.home-section-link svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   Listings Carousel
   -------------------------------------------------------------------------- */
.listings-carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 4px 16px;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.carousel-nav:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
}

.carousel-prev {
  left: -22px;
}

.carousel-next {
  right: -22px;
}

.carousel-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }
}

@media (max-width: 640px) {
  .carousel-nav {
    display: none;
  }
}

/* Carousel Loading */
.carousel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  width: 100%;
  color: var(--color-text-muted);
  gap: 12px;
}

.carousel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Carousel Card (Property Card for Carousels)
   -------------------------------------------------------------------------- */
.carousel-card {
  flex: 0 0 300px;
  min-width: 300px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s, box-shadow 0.3s;
}

.carousel-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.carousel-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.carousel-card-photo {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, #f5f4f2 0%, #eae8e4 100%);
  overflow: hidden;
}

.carousel-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.carousel-card:hover .carousel-card-photo img {
  transform: scale(1.05);
}

/* Badge containers */
.card-badges-left {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.card-badges-left .card-badge {
  position: static;
}

.carousel-card-photo .badge-type,
.card-photo .badge-type {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.75);
  color: white;
}

/* When badge-type is inside card-badges container, make it stack */
.card-badges .badge-type {
  position: static;
  background: rgba(0,0,0,0.75);
  color: white;
}

/* Badge variants */
.badge-reduced {
  background: #dc2626 !important;
  color: white !important;
}

.badge-new {
  background: #059669 !important;
  color: white !important;
}

.badge-openhouse {
  background: #7c3aed !important;
  color: white !important;
}

.badge-quick {
  background: #0891b2 !important;
  color: white !important;
}

/* Action buttons container on carousel cards */
.carousel-card-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
}

.carousel-card:hover .carousel-card-actions {
  opacity: 1;
  transform: translateY(0);
}

/* Carousel card content */
.carousel-card-content {
  padding: 16px;
}

.carousel-card-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.carousel-card-address {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-card-city {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-card-specs {
  font-size: 13px;
  color: var(--color-text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* See More card at end of carousels */
.carousel-card-see-more {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #f0f7f4 100%);
  border: 2px dashed var(--color-primary);
}

.carousel-card-see-more:hover {
  background: linear-gradient(135deg, #dceee6 0%, #e8f5ef 100%);
  border-color: var(--color-primary-hover);
}

.carousel-card-see-more .see-more-link {
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.see-more-content {
  text-align: center;
  padding: 24px;
}

.see-more-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, background-color 0.3s;
}

.see-more-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

.carousel-card-see-more:hover .see-more-icon {
  transform: scale(1.1);
  background: var(--color-primary-hover);
}

.see-more-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.see-more-count {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.see-more-arrow {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  transition: transform 0.3s;
}

.see-more-arrow svg {
  width: 100%;
  height: 100%;
  stroke: var(--color-primary);
}

.carousel-card-see-more:hover .see-more-arrow {
  transform: translateX(6px);
}

@media (max-width: 640px) {
  .carousel-card {
    flex: 0 0 260px;
    min-width: 260px;
  }

  .carousel-card-photo {
    height: 150px;
  }

  .carousel-card-price {
    font-size: 20px;
  }

  .carousel-save-btn {
    opacity: 1;
    transform: scale(1);
  }

  .carousel-card-see-more .see-more-link {
    min-height: 230px;
  }

  .see-more-icon {
    width: 48px;
    height: 48px;
  }

  .see-more-icon svg {
    width: 24px;
    height: 24px;
  }

  .see-more-text {
    font-size: 20px;
  }
}

/* --------------------------------------------------------------------------
   Neighborhoods Grid (Homepage)
   -------------------------------------------------------------------------- */
.neighborhoods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.neighborhood-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.neighborhood-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.neighborhood-card-content {
  flex: 1;
  min-width: 0;
}

.neighborhood-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 8px;
}

.neighborhood-card-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.neighborhood-stat {
  font-size: 13px;
  color: var(--color-text-muted);
}

.neighborhood-stat strong {
  color: var(--color-text);
}

.neighborhood-card-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 16px;
  transition: all 0.2s;
}

.neighborhood-card-arrow svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent);
}

.neighborhood-card:hover .neighborhood-card-arrow {
  background: var(--color-accent);
}

.neighborhood-card:hover .neighborhood-card-arrow svg {
  color: white;
}

@media (max-width: 900px) {
  .neighborhoods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .neighborhoods-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .neighborhood-card {
    padding: 16px;
  }

  .neighborhood-card-name {
    font-size: 18px;
  }
}

/* --------------------------------------------------------------------------
   Homepage Coming Soon Section
   -------------------------------------------------------------------------- */
.home-coming-soon {
  background: linear-gradient(135deg, #f8faf9 0%, #eef3f0 100%);
  padding: 64px 24px;
}

.coming-soon-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.coming-soon-text h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.coming-soon-text p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.coming-soon-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
}

.coming-soon-benefits li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--color-text);
}

.coming-soon-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}

.coming-soon-form {
  background: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.coming-soon-form .form-group {
  margin-bottom: 16px;
}

.coming-soon-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.coming-soon-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(44, 85, 69, 0.1);
}

.coming-soon-form button {
  width: 100%;
  margin-top: 8px;
}

.coming-soon-note {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .coming-soon-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .coming-soon-text h2 {
    font-size: 26px;
  }
}

/* --------------------------------------------------------------------------
   Homepage CTA Section
   -------------------------------------------------------------------------- */
.home-cta {
  background: linear-gradient(135deg, #1e3a4f 0%, var(--color-accent) 100%);
  padding: 64px 24px;
  text-align: center;
}

.home-cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.home-cta h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  color: white;
  margin-bottom: 12px;
}

.home-cta p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  margin-bottom: 28px;
}

.home-cta-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-cta .btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.home-cta .btn-primary {
  background: white;
  color: var(--color-accent);
}

.home-cta .btn-primary:hover {
  background: rgba(255,255,255,0.9);
}

.home-cta .btn-secondary {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  color: white;
}

.home-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* --------------------------------------------------------------------------
   Price Range Quick Links
   -------------------------------------------------------------------------- */
.price-range-section {
  padding: 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}

.price-range-links {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.price-range-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}

.price-range-link:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.price-range-link:hover .price-range-arrow {
  transform: translateX(4px);
}

.price-range-arrow {
  transition: transform 0.2s;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .price-range-links {
    gap: 8px;
  }

  .price-range-link {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   Email Signup Section
   -------------------------------------------------------------------------- */
.email-signup-section {
  background: linear-gradient(135deg, var(--color-accent) 0%, #1e3a4f 100%);
  padding: 48px 24px;
}

.email-signup-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.email-signup-text h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: white;
  margin: 0 0 8px;
}

.email-signup-text p {
  color: rgba(255,255,255,0.8);
  font-size: 15px;
  margin: 0;
}

.email-signup-form {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.email-signup-input {
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  width: 280px;
  background: rgba(255,255,255,0.95);
}

.email-signup-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.email-signup-btn {
  padding: 14px 28px;
  background: white;
  color: var(--color-accent);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.email-signup-btn:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}

.email-signup-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.email-signup-btn.success {
  background: #059669;
  color: white;
}

@media (max-width: 900px) {
  .email-signup-content {
    flex-direction: column;
    text-align: center;
  }

  .email-signup-form {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .email-signup-input {
    width: 100%;
  }

  .email-signup-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .home-cta {
    padding: 48px 16px;
  }

  .home-cta h2 {
    font-size: 26px;
  }

  .home-cta-buttons {
    flex-direction: column;
  }

  .home-cta .btn-lg {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Search Page Header (Compact)
   -------------------------------------------------------------------------- */
.search-page-header {
  background: linear-gradient(135deg, var(--color-accent) 0%, #1a3f2f 100%);
  padding: 24px;
}

.search-page-header-content {
  max-width: 800px;
  margin: 0 auto;
}

.search-page-bar {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  position: relative;
}

.search-page-bar .search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-page-bar .search-input-icon {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  margin-left: 12px;
  flex-shrink: 0;
}

.search-page-bar .search-hero-input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 16px;
  font-family: var(--font-body);
  background: transparent;
  color: var(--color-text);
}

.search-page-bar .search-hero-input:focus {
  outline: none;
}

.search-page-bar .search-hero-btn {
  padding: 12px 24px;
  font-size: 15px;
}

@media (max-width: 640px) {
  .search-page-header {
    padding: 16px;
  }

  .search-page-bar .search-input-wrapper {
    flex-direction: column;
  }

  .search-page-bar .search-input-icon {
    display: none;
  }

  .search-page-bar .search-hero-input {
    width: 100%;
    text-align: center;
  }

  .search-page-bar .search-hero-btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Cookie Consent Banner
   -------------------------------------------------------------------------- */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1E3A5A;
  color: #fff;
  padding: 16px 24px;
  z-index: 10000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.cookie-consent-banner.cookie-consent-hidden {
  transform: translateY(100%);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-consent-text {
  flex: 1;
  min-width: 280px;
}

.cookie-consent-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-consent-link {
  color: #C9A962;
  text-decoration: underline;
  font-size: 14px;
}

.cookie-consent-link:hover {
  color: #e0c478;
}

.cookie-consent-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.cookie-btn-accept {
  background: #C9A962;
  color: #1E3A5A;
}

.cookie-btn-accept:hover {
  background: #e0c478;
}

.cookie-btn-reject {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.cookie-btn-reject:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

@media (max-width: 640px) {
  .cookie-consent-content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-consent-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   IDX Compliance Footer
   Per Maine Listings Rules & Regulations Section 18.3.7 and 18.3.8
   -------------------------------------------------------------------------- */
.idx-footer {
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 24px;
  margin-top: 60px;
}

.idx-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.idx-footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.idx-footer-logo img {
  height: 48px;
  width: auto;
}

.idx-footer-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.02em;
}

.idx-footer-disclaimer {
  font-size: 13px;
  line-height: 1.7;
  max-width: 800px;
  color: rgba(255, 255, 255, 0.6);
}

.idx-footer-disclaimer p {
  margin: 0;
}

.idx-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 800px;
}

.idx-footer-bottom a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.idx-footer-bottom a:hover {
  color: white;
}

.idx-footer-brand {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.idx-footer-brand a {
  color: var(--color-accent);
  text-decoration: none;
}

.idx-footer-brand a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .idx-footer {
    padding: 32px 16px;
  }

  .idx-footer-disclaimer {
    font-size: 12px;
  }

  .idx-footer-bottom {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   FRED Economic Data Sections
   ========================================================================== */

/* --------------------------------------------------------------------------
   Market Snapshot (Homepage)
   -------------------------------------------------------------------------- */
.market-snapshot-section {
  padding: 0 24px;
  margin-bottom: 32px;
}

.market-snapshot-section .home-section-header {
  margin-bottom: 16px;
}

.market-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.snapshot-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.snapshot-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.snapshot-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1.2;
}

.snapshot-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.snapshot-change {
  font-size: 13px;
  margin-top: 8px;
}

.snapshot-change.positive { color: #059669; }
.snapshot-change.negative { color: #dc2626; }

.snapshot-cta {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s;
}

.snapshot-cta:hover {
  background: var(--color-accent-hover);
}

.snapshot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 20px;
}

@media (max-width: 900px) {
  .market-snapshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .market-snapshot-section {
    padding: 0 16px;
  }

  .market-snapshot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .snapshot-card {
    padding: 16px;
  }

  .snapshot-value {
    font-size: 24px;
  }
}

/* --------------------------------------------------------------------------
   HUD Affordability Context (Listing Detail)
   -------------------------------------------------------------------------- */
.hud-affordability-section {
  margin-top: 48px;
  animation: fadeUp 0.5s ease-out;
}

.hud-affordability-section .section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-text);
  margin-bottom: 24px;
}

.hud-affordability-section .section-title svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.hud-context-card {
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.hud-fmr-highlight-label,
.hud-fmr-vs-label {
  font-size: 13px;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 4px;
}

.hud-fmr-highlight-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-display);
}

.hud-fmr-vs-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-display);
  text-align: right;
}

.hud-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  margin-bottom: 20px;
}

.hud-verdict--favorable {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.hud-verdict--caution {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.hud-verdict--neutral {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.hud-verdict-icon {
  font-weight: 700;
  font-size: 16px;
}

.hud-fmr-table {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.hud-fmr-cell {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.hud-fmr-cell--active {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.hud-fmr-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.hud-fmr-value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.hud-fmr-cell--active .hud-fmr-value {
  color: var(--color-primary);
}

.hud-income-context {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-bottom: 12px;
}

.hud-income-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.hud-income-label {
  color: var(--color-text-muted);
}

.hud-income-value {
  font-weight: 600;
  color: var(--color-text);
}

.hud-value--favorable {
  color: var(--color-success);
}

.hud-value--caution {
  color: #b45309;
}

.hud-attribution {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .hud-fmr-header {
    flex-direction: column;
    gap: 12px;
  }

  .hud-fmr-vs-value {
    text-align: left;
  }

  .hud-fmr-table {
    flex-wrap: wrap;
  }

  .hud-fmr-cell {
    min-width: calc(33% - 6px);
  }
}

/* --------------------------------------------------------------------------
   County Market Data (Listing Detail)
   -------------------------------------------------------------------------- */
.county-market-section {
  margin-top: 48px;
  animation: fadeUp 0.5s ease-out;
}

.county-market-section .section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 24px;
}

.county-market-section .section-title svg {
  color: var(--color-accent);
}

.county-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.county-stat-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: box-shadow 0.2s;
}

.county-stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.county-stat-card.highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
}

.county-stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.county-stat-card .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.county-stat-card .stat-change {
  font-size: 13px;
  margin-top: 8px;
  font-weight: 500;
}

.county-stat-card .stat-change.positive { color: #059669; }
.county-stat-card .stat-change.negative { color: #dc2626; }

.county-stat-card .stat-subtext {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 4px;
}

.county-market-footer {
  text-align: center;
  margin-top: 20px;
}

.county-market-footer .btn-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.county-market-footer .btn-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .county-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .county-stats-grid {
    grid-template-columns: 1fr;
  }

  .county-stat-card {
    padding: 16px;
  }

  .county-stat-card .stat-value {
    font-size: 24px;
  }
}

/* --------------------------------------------------------------------------
   Income Context (Buyer Analysis)
   -------------------------------------------------------------------------- */
.income-context-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.income-context-section .section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
}

.income-insight {
  background: var(--color-bg);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.income-insight strong {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   County Comparison (Market Intelligence)
   -------------------------------------------------------------------------- */
.county-comparison-section {
  margin-top: 48px;
}

.county-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.county-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.county-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.county-card h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.county-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.county-stat {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.county-stat .label {
  color: var(--color-text-muted);
}

.county-stat .value {
  font-weight: 600;
  color: var(--color-text);
}

/* Economic Indicators Grid (Market Intelligence) */
.economic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.economic-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.economic-card h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.economic-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
}

.economic-card .context {
  font-size: 13px;
  margin-top: 8px;
  color: var(--color-text-muted);
}

.economic-card .context.good { color: #059669; }
.economic-card .context.warning { color: #f59e0b; }

@media (max-width: 640px) {
  .county-comparison-grid {
    grid-template-columns: 1fr;
  }

  .economic-grid {
    grid-template-columns: 1fr 1fr;
  }
}
