/* ============================================================
   PropLocate — main.css
   Global styles, design tokens, reusable components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── Design Tokens ── */
:root {
  --navy:       #3f3f46;        /* Zinc 700 — ash primary */
  --navy-2:     #27272a;        /* Zinc 800 — darker ash */
  --navy-3:     #18181b;        /* Zinc 900 — darkest ash */
  --gold:       #ffffff;        /* White */
  --gold-2:     #f4f4f5;        /* Zinc 100 — soft hover tint */
  --cream:      #f4f4f5;        /* Zinc 100 — ash background */
  --white:      #ffffff;        /* White surfaces */
  --text:       #18181b;        /* Zinc 900 — primary text */
  --muted:      #71717a;        /* Zinc 500 — secondary text */
  --border:     #e4e4e7;        /* Zinc 200 — borders */
  --danger:     #ef4444;        /* Red 500 */
  --success:    #10b981;        /* Emerald 500 */

  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  20px;

  --shadow:     0 4px 24px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.12);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-sans); }

/* ── Typography ── */
.serif { font-family: var(--font-serif); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; transition: all .2s; border: none;
  line-height: 1;
}
.btn-primary   { background: var(--navy);  color: #ffffff; }
.btn-primary:hover  { background: var(--navy-2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.btn-gold      { background: var(--gold);  color: var(--navy); }
.btn-gold:hover     { background: var(--gold-2); transform: translateY(-1px); }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--muted); }
.btn-outline:hover  { border-color: var(--navy); color: var(--navy); }
.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover    { color: var(--navy); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover   { filter: brightness(1.1); }
.btn-sm  { padding: 8px 14px; font-size: 13px; }
.btn-lg  { padding: 15px 30px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Form Elements ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--navy-2); margin-bottom: 6px;
}
.form-group label .tag { margin-left: 6px; }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--cream);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.form-control:disabled { opacity: .55; cursor: not-allowed; background: #f4f4f5; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; gap: 14px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

/* ── Badges / Tags ── */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.tag-navy    { background: rgba(124,58,237,.08); color: var(--navy); }
.tag-gold    { background: var(--gold); color: var(--navy); }
.tag-green   { background: #d1fae5; color: #065f46; }
.tag-gray    { background: #f4f4f5; color: var(--muted); }

/* ── Alert / Notice ── */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: var(--danger); }
.alert-info    { background: #f5f3ff; border: 1px solid #c4b5fd; color: var(--navy); }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* ── Property Card ── */
.prop-card { transition: transform .2s, box-shadow .2s; }
.prop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.prop-card__img {
  height: 180px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  display: flex; align-items: center; justify-content: center;
}
.prop-card__img img { width: 100%; height: 100%; object-fit: cover; }
.prop-card__img-placeholder { font-size: 48px; opacity: .25; }

.prop-card__status {
  position: absolute; top: 12px; left: 12px;
}
.status-sale   { background: var(--white);   color: var(--navy); border: 1px solid rgba(124,58,237,0.2); }
.status-rent   { background: var(--white); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.status-sold   { background: var(--white);   color: #71717a; border: 1px solid #e4e4e7; }
.status-off    { background: #f4f4f5;        color: #71717a; }

.prop-card__body { padding: 18px; }
.prop-card__price { font-family:var(--font-heading); font-size: 24px; font-weight:800; color:var(--text); line-height:1; }
.prop-card__title { font-weight: 700; font-size: 16px; margin-top: 6px; line-height: 1.3; }
.prop-card__type  { font-size: 14px; color: var(--text); margin-top: 4px; font-weight: 500; }
.prop-card__place { font-size: 14px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.prop-card__meta  { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.prop-card__desc  { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.5; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.prop-card__actions { display: flex; gap: 6px; padding: 0 18px 14px; }

/* ── Stats Row ── */
.stats-row { display: grid; gap: 16px; }
.stats-row-3 { grid-template-columns: repeat(3,1fr); }

.stat-card { padding: 20px; text-align: center; }
.stat-card__val { font-family: var(--font-serif); font-size: 30px; font-weight: 700; color: var(--navy); } 
.stat-card__lbl { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ── Map Wrapper ── */
.map-wrapper {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.map-wrapper--lg { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* ── Purple Radar-Pulse Map Markers ── */
.radar-marker {
  position: absolute;
  width: 40px !important;
  height: 40px !important;
}
.radar-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: #7c3aed;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.6);
  z-index: 2;
}
.radar-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(124, 58, 237, 0.7);
  border-radius: 50%;
  animation: radarExpand 2s ease-out infinite;
  z-index: 1;
}
.radar-ring-2 {
  animation-delay: 1s;
}
@keyframes radarExpand {
  0%   { width: 12px; height: 12px; margin: -6px 0 0 -6px; opacity: 0.8; }
  100% { width: 50px; height: 50px; margin: -25px 0 0 -25px; opacity: 0; }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(13,31,45,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal__header h2 { font-family: var(--font-serif); font-size: 22px; color: var(--navy); }
.modal__close { color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal__close:hover { background: var(--cream); color: var(--navy); }
.modal__body { padding: 24px 28px; }
.modal__footer { padding: 0 28px 28px; display: flex; gap: 10px; justify-content: flex-end; }

/* ── Share Link Box ── */
.share-link-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--cream); border-radius: var(--radius-sm);
  padding: 13px 16px; border: 1.5px solid var(--border); margin-bottom: 24px;
}
.share-link-box__url { flex: 1; font-size: 14px; color: var(--navy-2); font-weight: 500; font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm  { width: 34px; height: 34px; font-size: 13px; }
.avatar--md  { width: 56px; height: 56px; font-size: 20px; }
.avatar--lg  { width: 80px; height: 80px; font-size: 28px; }
.avatar--xl  { width: 100px; height: 100px; font-size: 36px; }
.avatar--gold { background: var(--gold); color: var(--navy); border: 3px solid var(--gold); }
.avatar--navy { background: var(--navy); color: var(--gold); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── Grid helpers ── */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px,1fr));
  gap: 20px;
}

/* ── Loading spinner ── */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(124,58,237,.15);
  border-top-color: var(--navy);
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notification ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #27272a; color: #ffffff; padding: 13px 18px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: slideUp .25s ease;
}
.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .stats-row-3 { grid-template-columns: 1fr 1fr; }
  .form-control, select, input, textarea { font-size: 16px !important; }
}
@media (max-width: 480px) {
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-row-3 { grid-template-columns: 1fr; }
}
