/* ============================================================
 * Compare / Shortlist system - vibrant, attractive styling
 * ============================================================ */

/* --- Compare page --- */
body { font-family: 'Segoe UI', Arial, sans-serif; margin: 0; background: #f4f6fb; }
.cmp-header {
  background: linear-gradient(135deg, #7b2ff7, #f107a3, #ff6a3d);
  color: #fff; padding: 2rem 1.2rem 1.6rem; text-align: center;
}
.cmp-header h1 { margin: 0 0 6px; font-size: 1.6rem; }
.cmp-header p { margin: 0; opacity: 0.92; font-size: 0.95rem; }
.cmp-back-link {
  display: inline-block; color: #fff; text-decoration: none; font-weight: 700; font-size: 0.85rem;
  background: rgba(255,255,255,0.2); padding: 6px 14px; border-radius: 20px; margin-bottom: 10px;
}
.cmp-back-link:hover { background: rgba(255,255,255,0.32); }
.cmp-visitor-id { font-weight: 700; font-size: 0.95rem; margin: 4px 0; background: rgba(255,255,255,0.18); display: inline-block; padding: 4px 14px; border-radius: 16px; }

.cmp-pdf-btn {
  background: linear-gradient(135deg, #333, #555); color: #fff; border: none;
  border-radius: 24px; padding: 10px 22px; font-weight: 800; font-size: 0.9rem; cursor: pointer;
}

/* --- Print / Save-as-PDF output --- */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .cmp-back-link, .cmp-pdf-btn, .cmp-browse-more, .cmp-freeze-box, .cmp-swipe-hint,
  .cmp-share-box, .cmp-share-hint { display: none !important; }
  .cmp-header { padding: 0 0 10px; }
  .cmp-visitor-id { border: 1px solid #333; }
  .cmp-grid {
    display: block !important; /* stop horizontal-scroll layout - stack for print instead */
  }
  .cmp-col, .cmp-col-empty {
    display: inline-block; width: 45%; vertical-align: top; margin: 0 2% 14px 0;
    page-break-inside: avoid; border: 1px solid #999 !important;
  }
  .cmp-remove-btn { display: none !important; }
  .cmp-view-link { display: none !important; }
}

.cmp-share-box {
  display: flex; justify-content: center; max-width: 560px; margin: -1rem auto 1rem;
}
.cmp-whatsapp-admin-btn {
  display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff !important; text-decoration: none; border-radius: 30px; padding: 12px 22px;
  font-weight: 800; font-size: 0.9rem; box-shadow: 0 8px 24px rgba(37,211,102,0.4);
}
.cmp-share-hint {
  max-width: 560px; margin: 0 auto 1rem; text-align: center; font-size: 0.8rem;
  color: #666; padding: 0 1rem; line-height: 1.4;
}

.cmp-table-wrap { max-width: 1400px; margin: 0 auto; padding: 1.5rem 1rem 3rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-loading { text-align: center; color: #888; padding: 3rem; }
.cmp-swipe-hint {
  display: none; text-align: center; color: #7b2ff7; font-weight: 700; font-size: 0.85rem;
  margin: 0 0 10px; animation: cmpSwipeNudge 1.6s ease-in-out infinite;
}
@keyframes cmpSwipeNudge {
  0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); }
}

.cmp-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 14px;
  scroll-snap-type: x mandatory; padding-bottom: 6px;
}
.cmp-col, .cmp-col-empty { scroll-snap-align: start; }

@media (max-width: 700px) {
  .cmp-swipe-hint { display: block; }
  .cmp-grid { grid-auto-columns: 82vw; gap: 12px; }
  .cmp-table-wrap { padding: 1rem 0.8rem 2rem; }
}
.cmp-col {
  background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  padding: 1rem; position: relative; display: flex; flex-direction: column; gap: 8px;
}
.cmp-col-empty {
  background: repeating-linear-gradient(135deg, #eceff5, #eceff5 10px, #f4f6fb 10px, #f4f6fb 20px);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: #aaa; font-weight: 700; font-size: 0.85rem; text-align: center; min-height: 300px;
}
.cmp-remove-btn {
  position: absolute; top: 8px; right: 8px; background: #fde8e8; color: #d63031;
  border: none; border-radius: 50%; width: 26px; height: 26px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.cmp-col h3 { font-size: 0.95rem; margin: 6px 0 4px; color: #111; font-weight: 700; }
.cmp-row { font-size: 0.82rem; color: #333; display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding: 5px 0; }
.cmp-row .label { color: #888; font-weight: 600; }
.cmp-row .value { font-weight: 700; color: #111; }
.cmp-row.best .value { color: #fff; background: linear-gradient(135deg, #00b894, #00cec9); padding: 1px 8px; border-radius: 10px; }
.cmp-view-link { display: block; text-align: center; margin-top: 6px; background: linear-gradient(135deg, #7b2ff7, #f107a3); color: #fff !important; text-decoration: none; padding: 8px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; }

/* --- Password gate for shared links --- */
.cmp-password-gate {
  position: fixed; inset: 0; background: rgba(20,20,20,0.75); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.cmp-password-box { background: #fff; border-radius: 16px; padding: 2rem; max-width: 380px; text-align: center; }
.cmp-password-box h2 { margin: 0 0 10px; }
.cmp-password-box input {
  width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 1rem; margin: 14px 0 10px;
}
.cmp-password-box button {
  width: 100%; background: linear-gradient(135deg, #7b2ff7, #f107a3); color: #fff; border: none;
  border-radius: 10px; padding: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.cmp-password-error { color: #d63031; font-weight: 700; font-size: 0.85rem; margin-top: 10px; }

/* --- Browse more / freeze-shuffle prompt --- */
.cmp-browse-more {
  display: block; text-align: center; max-width: 420px; margin: 0 auto 1.4rem;
  background: linear-gradient(135deg, #00b894, #00cec9); color: #fff !important; text-decoration: none;
  padding: 12px; border-radius: 12px; font-weight: 800; font-size: 0.95rem;
}
.cmp-freeze-box {
  max-width: 500px; margin: 0 auto 1.4rem; background: #fff8e6; border: 2px dashed #f0a500;
  border-radius: 16px; padding: 1.2rem; text-align: center;
}
.cmp-freeze-box p { margin: 0 0 12px; font-weight: 700; color: #7a5c00; }
.cmp-freeze-btn {
  background: linear-gradient(135deg, #ff9a3c, #ff6a3d); color: #fff; border: none;
  border-radius: 12px; padding: 10px 24px; font-weight: 800; font-size: 0.95rem; cursor: pointer;
}
.cmp-freeze-btn.frozen { background: linear-gradient(135deg, #00b894, #00cec9); }
.cmp-congrats-msg {
  max-width: 500px; margin: 0 auto 1.4rem; background: linear-gradient(135deg, #00b894, #00cec9);
  color: #fff; border-radius: 16px; padding: 1.4rem; text-align: center; font-weight: 800; font-size: 1.05rem;
}

/* --- Floating pill (used on listings.php + property.php) --- */
.cmp-pill {
  background: linear-gradient(135deg, #7b2ff7, #f107a3); color: #fff;
  border-radius: 30px; padding: 12px 20px; font-weight: 700; font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(123,47,247,0.4); cursor: pointer; border: none;
  display: none; align-items: center; gap: 6px; transition: transform 0.15s;
}
.cmp-pill:hover { transform: scale(1.05); }
.cmp-pill.visible { display: flex; }

.cmp-share-pill {
  position: fixed; bottom: 78px; right: 20px; z-index: 350;
  background: #fff; color: #7b2ff7; border: 2px solid #7b2ff7;
  border-radius: 30px; padding: 8px 16px; font-weight: 700; font-size: 0.8rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15); cursor: pointer;
  display: none; align-items: center; gap: 6px;
}
.cmp-share-pill.visible { display: flex; }

/* --- Toggle button on property cards --- */
.cmp-toggle-btn {
  background: linear-gradient(135deg, #ff9a3c, #ff6a3d, #f107a3);
  border: none; border-radius: 24px; padding: 10px 18px;
  font-size: 0.9rem; font-weight: 800; color: #fff; cursor: pointer; margin: 8px 0; width: 100%;
  box-shadow: 0 4px 14px rgba(241,7,163,0.35);
  animation: cmpPulse 1.6s ease-in-out 3; /* pulses 3 times then stops - not forever, on every card */
  letter-spacing: 0.2px;
}
@keyframes cmpPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(241,7,163,0.35); transform: scale(1); }
  50% { box-shadow: 0 6px 22px rgba(241,7,163,0.55); transform: scale(1.015); }
}
.cmp-toggle-btn.active { background: linear-gradient(135deg, #00b894, #00cec9); animation: none; box-shadow: 0 4px 14px rgba(0,184,148,0.4); }

/* --- Password gate for shared links --- */
.cmp-password-gate {
  position: fixed; inset: 0; background: linear-gradient(135deg, #7b2ff7, #f107a3);
  display: flex; align-items: center; justify-content: center; z-index: 500; padding: 1rem;
}
.cmp-password-box {
  background: #fff; border-radius: 16px; padding: 2rem; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.cmp-password-box h2 { margin: 0 0 8px; font-size: 1.3rem; }
.cmp-password-box p { color: #555; font-size: 0.9rem; margin: 0 0 1rem; }
.cmp-password-box input {
  width: 100%; box-sizing: border-box; padding: 12px; border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 1rem; margin-bottom: 12px; text-align: center;
}
.cmp-password-box button {
  width: 100%; background: linear-gradient(135deg, #7b2ff7, #f107a3); color: #fff; border: none;
  border-radius: 10px; padding: 12px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.cmp-password-error { color: #d63031; font-weight: 700; margin-top: 10px !important; }
