/* Listings Container */
.listings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Base Listing Item */
.listing-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
  display: flex;
  transition: background-color 0.2s;
  text-align: left;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  data-property-id: attr(data-property-id);
}

.listing-item:hover {
  background: #f1f5f9;
}

/* Anonymous Listing (no image, vertical layout) */
.listing-item.anonymous-listing {
  flex-direction: column;
}

/* Full Listing (with/without image, vertical layout) */
.listing-item.full-listing {
  flex-direction: column;
}

/* Full Listing no-image uses same vertical layout */
.listing-item.full-listing.no-image {
  flex-direction: column;
}

/* Title Row (title + button on same line) */
.listing-item .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  width: 100%;
  max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.listing-item .title {
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-item.full-listing .title {
  cursor: pointer;
  color: #3b82f6;
  text-decoration: none;
}

.listing-item.full-listing .title:hover {
  text-decoration: underline;
}

/* Price + Metrics Row (with gaps, no dots) */
.listing-item .price-metrics-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Price */
.listing-item .price {
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
}

/* Dots */
.listing-item .dot {
  width: 3px;
  height: 3px;
  background: #cbd5e1;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Agency Link */
.listing-item .agency-link {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.listing-item .agency-link:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* Metrics */
.listing-item .metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.listing-item .metric {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

/* Meta Line */
.listing-item .meta-line {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Status Pills */
.listing-item .status {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
}

.listing-item .status.for-sale {
  background: #dcfce7;
  color: #166534;
}

.listing-item .status.under-contract {
  background: #fef3c7;
  color: #92400e;
}

.listing-item .status:not(.for-sale):not(.under-contract) {
  background: #f1f5f9;
  color: #64748b;
}

/* Verify Location */
.listing-item .verify-location-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.listing-item .verify-location-btn {
  margin-left: 0;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 12px;
  border: 1px solid #19c37d;
  background: #fff;
  color: #19c37d;
  cursor: pointer;
}

.listing-item .location-verified-text {
  color: #19c37d;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 11px;
}

/* Premium Indicator */
.listing-item .premium-indicator {
  color: #f97316;
  font-weight: 500;
  font-size: 11px;
}

/* Image */
.listing-item img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  margin-left: 16px;
}

/* Content Row (for full listings with images) */
.listing-item .content-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: nowrap;
}

/* Buttons */
.listing-item .enquire-btn,
.listing-item .visit-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  height: fit-content;
  flex-shrink: 0;
}

.listing-item .enquire-btn:hover,
.listing-item .visit-btn:hover {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
}

/* Admin Debug Line */
.listing-item .admin-debug-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dotted #cbd5e1;
  font-size: 11px;
  color: #666;
}

/* (removed) Upgrade Message styles no longer used */

/* Listing Popup Container */
.listing-popup {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: 420px;
  background: var(--color-background);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (max-width: 480px) {
  .listing-popup {
    max-height: 50vh;
  }
}

.listing-popup .header {
  background: var(--color-background-alt);
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 32px;
}

.listing-popup .header h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-primary);
}

.listing-popup .property-count {
  font-weight: normal;
  font-size: 0.9em;
  color: var(--color-text-muted);
}

.listing-popup .popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  width: 100%;
}

/* Parcel Details */
.parcel-details {
  margin-top: 10px;
  border-top: 1px solid var(--color-border-light, #eee);
  padding-top: 12px;
}

.parcel-details.full-width {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.parcel-details h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #333);
  margin: 0 0 10px 0;
  padding: 0 14px;
  letter-spacing: -0.01em;
}

.parcel-row {
  display: flex;
  font-size: 12px;
  line-height: 1.4;
  width: 100%;
}

.parcel-row:hover {
  background-color: var(--color-background-hover);
}

.parcel-label {
  width: 35%;
  padding: 5px 14px;
  font-weight: 500;
  color: var(--color-text-secondary, #666);
}

.parcel-value {
  width: 65%;
  padding: 5px 14px;
  color: var(--color-text-primary, #333);
}

.parcel-value a {
  color: var(--color-primary);
  text-decoration: none;
}

.parcel-value a:hover {
  text-decoration: underline;
}
