/* ─── sold-listings.css ─────────────────────────────────────────────────────
   Flip-card listings widget styles for getsetsold.ca
   Link this BEFORE sold-listings.js
   ────────────────────────────────────────────────────────────────────────── */

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: auto;
}
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── Flip card shell ───────────────────────────────────────────────────────── */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  height: 300px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* ── Front & Back shared ───────────────────────────────────────────────────── */
.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  background: white;
  color: black;
}

/* ── Front ─────────────────────────────────────────────────────────────────── */
.flip-card-front {
  background: #000;
  color: white;
}
.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Back ──────────────────────────────────────────────────────────────────── */
.flip-card-back {
  transform: rotateY(180deg);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  padding-top: 45px;
}

/* ── Status ribbons (front) ────────────────────────────────────────────────── */
.ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #2e7d32;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  z-index: 2;
}
.flip-card.flipped .ribbon { display: none; }

.status-sold    .ribbon { background: #ff0000; }
.status-leased  .ribbon { background: #1976d2; }
.status-for-sale .ribbon { background: #2e7d32; }
.status-for-lease .ribbon { background: #ffb900; color: black; }
.status-purchased .ribbon { background: #e71cf7; color: white; }

/* ── Status ribbons (back) ─────────────────────────────────────────────────── */
.ribbon-back {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #2e7d32;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  z-index: 2;
}
.status-sold      .ribbon-back { background: #d32f2f; }
.status-leased    .ribbon-back { background: #1976d2; }
.status-for-sale  .ribbon-back { background: #2e7d32; }
.status-for-lease .ribbon-back { background: #ff8c00; }
.status-purchased .ribbon-back { background: #e71cf7; color: white; }

/* ── Feature bubbles (bed / bath / parking / sqft) ─────────────────────────── */
.feature-text {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.flip-card.flipped .feature-text { display: none; }

.feature-item {
  background: white;
  color: #1a3454;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.feature-number { font-size: 10px; font-weight: 700; line-height: 1; }
.feature-label  { font-size: 8px;  line-height: 1;   margin-top: 2px; }

/* ── "More Info" button (front) ────────────────────────────────────────────── */
.details-button {
  background: #1a3454;
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 20px;
  position: absolute;
  bottom: 12px;
  left: 12px;
  text-decoration: none;
  z-index: 2;
  cursor: pointer;
}
.flip-card.flipped .details-button { display: none; }

/* ── Price diff circle (back) ──────────────────────────────────────────────── */
.price-diff-circle {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: #ffeb3b;
  color: #000;
  border-radius: 22px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
  text-align: center;
  min-width: 40px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* ── Price lines (back) ────────────────────────────────────────────────────── */
.price-line-inline {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: -5px;
  color: #333;
  display: flex;
  line-height: 1;
  justify-content: space-between;
}
.price-line {
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  color: #333;
  position: absolute;
  top: 12px;
}

/* ── Address ───────────────────────────────────────────────────────────────── */
.address {
  font-size: 14px;
  color: #444;
  margin: 0;
  line-height: 1;
}

/* ── Agent section ─────────────────────────────────────────────────────────── */
.agent-details {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: black;
}
.agent-details img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.agent-text {
  font-size: 10px;
  color: black;
  line-height: 1;
  margin: 0;
  padding: 0;
}
.agent-text strong {
  display: block;
  font-size: 10px;
  color: black;
}

/* ── Agent message ─────────────────────────────────────────────────────────── */
.agent-message {
  font-size: 13px;
  color: #1a3454;
  margin: 0;
  font-weight: 500;
  line-height: 1;
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0;
}

/* ── Action buttons row ────────────────────────────────────────────────────── */
.agent-buttons,
.agent-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.back-button {
  background: transparent;
  border: 1px solid #d5d5d5;
  font-size: 12px;
  color: #1a3454;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 22px;
  transition: background-color 0.3s ease;
  margin-right: auto;
  font-family: inherit;
}
.back-button:hover { background: #f0f0f0; }

.agent-call-btn,
.details-btn-back {
  background: #1a3454;
  color: white;
  padding: 8px 16px;
  border-radius: 22px;
  text-decoration: none;
  font-size: 12px;
  display: inline-block;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}
.agent-call-btn:hover,
.details-btn-back:hover { background: #12243b; }

/* ── Skeleton shimmer ──────────────────────────────────────────────────────── */
.flip-card.skeleton { pointer-events: none; }
.skeleton-inner {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  width: 100%;
  height: 100%;
  border-radius: 5px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Load More buttons ─────────────────────────────────────────────────────── */
#loadMoreAvailableBtn,
#loadMoreClosedBtn {
  display: none;
  margin: 20px auto;
  padding: 10px 20px;
  font-size: 16px;
  background: #1a3454;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  max-width: 200px;
  font-family: inherit;
  transition: background-color 0.3s ease;
}
#loadMoreAvailableBtn:hover,
#loadMoreClosedBtn:hover {
  background: #12243b;
}
