.spark-mls-app {
    width: 100%;
    margin: 20px 0;
}

.spark-mls-search {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.spark-mls-search input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

.spark-mls-search button {
    padding: 10px 20px;
    cursor: pointer;
}

.spark-mls-layout {
    display: flex;
    height: 600px;
    border: 1px solid #ddd;
}

#spark-sidebar {
    width: 35%;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

#spark-map {
    width: 65%;
    height: 100%;
}

/* Luxury Panel UI */
.spark-panel {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
}

.spark-panel-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.spark-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: .2s;
}

.spark-item:hover {
    background: #f7f7f7;
}

/* Slide-out property panel */
#spark-detail-panel {
    position: absolute; /* not fixed */
    bottom: 20px;       /* float above bottom */
    left: 50%;          /* center horizontally */
    transform: translateX(-50%) translateY(200%); /* hidden below by default */
    width: 320px;
    max-width: 90%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 1000;
    font-family: sans-serif;
}

#spark-detail-panel.active {
    transform: translateX(-50%) translateY(0); /* slide up */
    opacity: 1;
}

#spark-detail-close {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
}

#spark-detail-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}

#spark-detail-panel .panel-close {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

#spark-detail-panel .panel-body {
    padding: 16px;
}

#spark-detail-panel .listing-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 12px;
}

#spark-detail-panel .listing-meta .price {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 6px;
}

#spark-detail-panel .listing-meta .beds-baths,
#spark-detail-panel .listing-meta .dom,
#spark-detail-panel .listing-meta .hoa-fee {
    font-size: 14px;
    margin-bottom: 4px;
}

#spark-detail-panel .listing-meta .more-details {
    font-size: 13px;
    margin-top: 8px;
    color: #555;
}

@media (max-width: 768px) {
    #spark-detail-panel {
        width: 90%;
        bottom: 10px;
    }
}

.spark-detail-price {
    font-size: 22px;
    font-weight: 700;
    color: #c89b3c;
    margin-bottom: 16px;
}

.spark-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
    font-size: 14px;
}

.spark-detail-grid div strong {
    display: block;
    font-size: 12px;
    color: #777;
}

.spark-listing-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.spark-listing-item:hover {
    background: #f7f7f7;
}

.spark-community-panel {
    background: #f6f8ef;
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.spark-community-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.spark-community-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.spark-community-metrics span {
    font-size: 12px;
    color: #6b6b6b;
}

.spark-community-metrics strong {
    font-size: 20px;
    font-weight: 700;
}

.spark-community-actions button {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    margin-top: 8px;
    cursor: pointer;
    font-weight: 600;
}

#spark-view-listings {
    background: #2f7d32;
    color: white;
}

#spark-view-community {
    background: #9bc53d;
    color: white;
}

.spark-suggestions {
    position:absolute;
    top:100%;
    left:0;
    right:0;
    background:#fff;
    border:1px solid #ddd;
    z-index:9999;
    max-height:220px;
    overflow-y:auto;
    display:none;
    box-shadow:0 10px 30px rgba(0,0,0,.15);
}

.spark-suggestion-item {
    padding:10px 12px;
    cursor:pointer;
    font-size:14px;
}

.spark-suggestion-item:hover {
    background:#f5f5f5;
}

/* Drawer panel */
.listing-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px; /* desktop */
  max-width: 90%;
  height: 100%;
  background: #fff;
  box-shadow: -3px 0 12px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.listing-panel.open {
  transform: translateX(0);
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header .panel-close {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.panel-content {
  padding: 16px;
  overflow-y: auto;
  flex-grow: 1;
}

.listing-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.listing-details .price {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
}

.listing-details .info {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.listing-details .dom,
.listing-details .hoa-fee {
  font-size: 13px;
  color: #777;
  margin-bottom: 6px;
}

.panel-actions {
  padding: 12px 16px;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 10px;
}

.panel-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #0077cc;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

/* MOBILE: bottom sheet style */
@media(max-width: 768px) {
  .listing-panel {
    width: 100%;
    height: 60%;
    bottom: 0;
    top: auto;
    right: 0;
    transform: translateY(100%);
    border-radius: 12px 12px 0 0;
  }
  .listing-panel.open {
    transform: translateY(0);
  }
  .panel-content {
    padding: 12px;
  }
}

.spark-map-popup {
  max-width: 280px;
}

.spark-map-popup img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}
