/**
 * VCG Saved Listings + Saved Searches styles
 *
 * Heart icons on cards, "Save This Search" pill, /saved/ page layout +
 * tabs, header nav badge.
 */

/* ── Heart icon button ──────────────────────────────────────────── */
.vcg-heart-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #777;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s ease, color 0.15s ease, background 0.15s ease;
}

.vcg-heart-btn:hover {
  transform: scale(1.08);
  color: #d6336c;
  background: #fff;
}

.vcg-heart-btn.is-saved {
  color: #d6336c; /* warm pink — matches "favorite" semantics across MLS sites */
}

.vcg-heart-btn.is-saved svg {
  filter: drop-shadow(0 1px 2px rgba(214, 51, 108, 0.25));
}

.vcg-heart-btn-on-card {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
}

/* Make sure the heart sits above the status + featured badges visually */
.vcg-listing-card-image .vcg-heart-btn-on-card { z-index: 4; }

/* On single-listing page, larger inline heart next to the H1 */
.vcg-heart-btn-inline {
  width: 44px;
  height: 44px;
  vertical-align: middle;
  margin-left: 12px;
}

/* On map popup */
.vcg-popup-wrap {
  position: relative;
}
.vcg-popup-wrap .vcg-heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
}
.vcg-popup-wrap .vcg-heart-btn svg { width: 16px; height: 16px; }

/* On map side panel — heart sits to the right of the link */
.vcg-map-side-row {
  position: relative;
}

.vcg-heart-btn-side {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.vcg-heart-btn-side svg { width: 16px; height: 16px; }

/* ── "Save This Search" button ──────────────────────────────────── */
.vcg-save-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--vcg-border);
  border-radius: 999px;
  background: var(--vcg-white);
  color: var(--vcg-text);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--vcg-font-body);
  cursor: pointer;
  transition: all var(--vcg-transition);
  margin-left: 8px;
}

.vcg-save-search-btn:hover {
  border-color: #d6336c;
  color: #d6336c;
}

.vcg-save-search-btn.is-saved {
  background: #d6336c;
  color: #fff;
  border-color: #d6336c;
}

.vcg-save-search-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── /saved/ page ──────────────────────────────────────────────── */
.vcg-saved-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--vcg-border);
  margin: 24px 0 24px;
}

.vcg-saved-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--vcg-text-light);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--vcg-font-body);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color var(--vcg-transition), border-color var(--vcg-transition);
}

.vcg-saved-tab:hover { color: var(--vcg-text); }

.vcg-saved-tab.is-active {
  color: var(--vcg-black, #1a1a1a);
  border-bottom-color: var(--vcg-black, #1a1a1a);
}

.vcg-saved-tab-panel.is-hidden { display: none; }

.vcg-saved-section {
  margin: 0 0 32px;
}

.vcg-saved-section .vcg-listings-grid {
  /* Use the same density as the main archive */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.vcg-saved-empty {
  border: 1px dashed var(--vcg-border);
  border-radius: var(--vcg-radius);
  padding: 32px;
  text-align: center;
  color: var(--vcg-text-light);
}

.vcg-saved-empty h3 {
  margin: 0 0 8px;
  color: var(--vcg-text);
  font-size: 18px;
}

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

.vcg-saved-loading,
.vcg-saved-error {
  color: var(--vcg-text-light);
  font-size: 14px;
  padding: 16px;
}

/* ── Saved searches list ───────────────────────────────────────── */
.vcg-saved-searches-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--vcg-border);
  border-radius: var(--vcg-radius);
  overflow: hidden;
  background: var(--vcg-white);
}

.vcg-saved-search-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--vcg-border);
  transition: background var(--vcg-transition);
}

.vcg-saved-search-row:last-child { border-bottom: none; }
.vcg-saved-search-row:hover { background: rgba(0, 0, 0, 0.02); }

.vcg-saved-search-link {
  flex: 1;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vcg-saved-search-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--vcg-text);
}

.vcg-saved-search-meta {
  font-size: 11px;
  color: var(--vcg-text-light);
}

.vcg-saved-search-remove {
  background: transparent;
  border: none;
  color: var(--vcg-text-light);
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  margin-right: 8px;
  border-radius: 999px;
  transition: background var(--vcg-transition), color var(--vcg-transition);
}

.vcg-saved-search-remove:hover {
  background: rgba(214, 51, 108, 0.1);
  color: #d6336c;
}

/* ── Header nav badge (count of saved items) ──────────────────── */
.vcg-saved-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d6336c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  margin-left: 6px;
  vertical-align: middle;
}

.vcg-saved-badge.is-empty {
  display: none;
}

/* Header nav heart link */
.nav-saved {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 8px 10px !important;
  position: relative;
  color: var(--vcg-text, currentColor);
  text-decoration: none;
  border-radius: 999px;
  transition: color var(--vcg-transition, 0.15s ease), background var(--vcg-transition, 0.15s ease);
}

.nav-saved:hover {
  color: #d6336c;
  background: rgba(214, 51, 108, 0.08);
}

.nav-saved .vcg-saved-badge {
  margin-left: -2px;
}

/* ── Sync banner on /saved/ ───────────────────────────────────── */
.vcg-sync-banner-wrap {
  margin: 16px 0 24px;
}

.vcg-sync-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid var(--vcg-border);
  border-radius: var(--vcg-radius);
  background: linear-gradient(135deg, #fffaf2 0%, #fff 80%);
}

.vcg-sync-banner.is-verified {
  background: linear-gradient(135deg, #f3faf3 0%, #fff 80%);
  border-color: #c4e6c4;
  color: var(--vcg-text);
}

.vcg-sync-banner.is-verified > svg {
  flex-shrink: 0;
  color: #2c8d3a;
  margin-top: 2px;
}

.vcg-sync-banner-text {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--vcg-text-light);
  line-height: 1.45;
}

.vcg-sync-banner-text strong {
  font-size: 15px;
  color: var(--vcg-text);
  font-weight: 600;
}

.vcg-sync-banner-form {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.vcg-sync-email-input {
  padding: 10px 14px;
  border: 1px solid var(--vcg-border);
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--vcg-font-body);
  min-width: 220px;
}

.vcg-sync-email-input:focus {
  border-color: var(--vcg-accent, #c9a961);
  outline: none;
}

.vcg-sync-banner-btn,
.vcg-sync-signout {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: var(--vcg-black, #1a1a1a);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--vcg-font-body);
  cursor: pointer;
  transition: background var(--vcg-transition);
}

.vcg-sync-banner-btn:hover {
  background: var(--vcg-accent, #c9a961);
}

.vcg-sync-banner-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vcg-sync-signout {
  background: transparent;
  color: var(--vcg-text-light);
  border: 1px solid var(--vcg-border);
}

.vcg-sync-signout:hover {
  background: var(--vcg-border);
  color: var(--vcg-text);
}

.vcg-sync-banner-status {
  flex-basis: 100%;
  font-size: 13px;
  margin-top: 4px;
}

.vcg-sync-banner-status.is-success { color: #2c8d3a; }
.vcg-sync-banner-status.is-error   { color: #c0392b; }

/* Verified-state toast (shown briefly after magic-link redirect) */
.vcg-sync-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transition: opacity 1.5s ease;
}

.vcg-sync-toast.is-fading { opacity: 0; }

@media (max-width: 600px) {
  .vcg-sync-banner-form {
    flex-direction: column;
    width: 100%;
  }
  .vcg-sync-email-input {
    width: 100%;
    min-width: 0;
  }
  .vcg-sync-banner-btn {
    width: 100%;
  }
}
