/* ============================================================
   Market Pulse — Pro Plus interactive suburb map
   Chrome is brand-aware (--brand-* tokens). Trend colours are
   SEMANTIC and stay literal: a falling suburb is red on every
   brand. Loaded only on /market-pulse, after style.css/brand.css.
   ============================================================ */

.mp-map-section { background: var(--white); border-radius: var(--brand-radius); overflow: hidden; box-shadow: var(--shadow-md); }

/* Controls / legend bar */
.mp-controls {
  background: var(--brand-primary);
  padding: 14px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.mp-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.mp-legend-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.62); }
.mp-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.82); }
.mp-legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.mp-legend-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.22); }
.mp-legend-size { display: flex; align-items: center; gap: 8px; }
.mp-legend-size-sm { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.mp-legend-size-lg { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.mp-counter { font-size: 12px; color: rgba(255,255,255,0.6); }

/* Map row: left panel + map */
.mp-row { display: flex; }
.mp-panel {
  width: 300px; flex-shrink: 0; background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; min-height: 600px; overflow-y: auto;
}
.mp-panel-default { display: flex; flex-direction: column; flex: 1; }
.mp-panel-empty { padding: 22px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.mp-panel-empty p { font-size: 13px; color: var(--gray-700); line-height: 1.7; }
.mp-panel-head { background: var(--brand-primary); padding: 14px 20px; flex-shrink: 0; }
.mp-panel-suburb { font-size: 19px; font-weight: 700; color: #fff; font-family: var(--brand-font-display); }
.mp-panel-city { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.mp-panel-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-top: 8px; letter-spacing: 0.03em; }
.mp-panel-body { padding: 14px 18px; flex: 1; }
.mp-stat { margin-bottom: 10px; }
.mp-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gray-500); margin-bottom: 3px; }
.mp-stat-val { font-size: 22px; font-weight: 700; color: var(--brand-ink); line-height: 1; font-family: var(--brand-font-display); }
.mp-stat-sub { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.mp-divider { height: 1px; background: var(--gray-200); margin: 10px 0; }
.mp-trend-bar { height: 8px; background: var(--gray-200); border-radius: 4px; position: relative; overflow: hidden; margin-top: 8px; }
.mp-trend-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; }
.mp-note { margin: 10px 0 2px; padding: 9px 12px; border-radius: var(--brand-radius-sm); background: var(--brand-accent-pale); border-left: 3px solid var(--brand-accent); font-size: 12px; color: var(--gray-700); line-height: 1.45; }
.mp-panel-cta {
  display: block; text-align: center; text-decoration: none;
  background: var(--brand-accent); color: var(--brand-on-accent);
  border-radius: var(--brand-radius-sm); padding: 11px 16px;
  font-size: 14px; font-weight: 700; margin-top: 10px;
  transition: background var(--transition);
}
.mp-panel-cta:hover { background: var(--brand-accent-light); }

/* Map area */
.mp-map-area { flex: 1; position: relative; min-height: 600px; }
#mp-map { position: absolute; inset: 0; }
.mp-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--brand-surface); color: var(--gray-500); font-size: 13px; z-index: 5; }
.mp-spinner { width: 26px; height: 26px; border: 3px solid var(--gray-200); border-top-color: var(--brand-primary); border-radius: 50%; animation: mp-spin 0.8s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }

/* Data notice */
.mp-disclaimer { background: var(--brand-surface); border-top: 1px solid var(--gray-200); padding: 12px 20px; font-size: 11px; color: var(--gray-500); line-height: 1.6; }

/* Suburb dot markers (Leaflet divIcon) */
.mp-dot { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mp-dot-inner { border-radius: 50%; position: absolute; opacity: 0.9; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.mp-dot-pulse { border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0; animation: mp-pulse var(--pd,2s) ease-out infinite; }
.mp-dot-ring { border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--brand-accent); }
@keyframes mp-pulse { 0% { transform: translate(-50%,-50%) scale(1); opacity: 0.5; } 70% { opacity: 0.1; } 100% { transform: translate(-50%,-50%) scale(2.4); opacity: 0; } }
.leaflet-container { font-family: var(--brand-font-body); }
.leaflet-div-icon { background: none !important; border: none !important; }

/* Agent card under the map */
.mp-agent { margin-top: 28px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--brand-radius); box-shadow: var(--shadow-sm); padding: 28px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.mp-agent-photo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mp-agent-body { flex: 1; min-width: 220px; }
.mp-agent-name { font-size: 20px; font-weight: 700; color: var(--brand-primary); font-family: var(--brand-font-display); }
.mp-agent-title { font-size: 14px; color: var(--gray-700); margin-top: 2px; }
.mp-agent-blurb { font-size: 14px; color: var(--gray-700); line-height: 1.7; margin-top: 10px; max-width: 620px; }
.mp-agent-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

@media (max-width: 860px) {
  .mp-row { flex-direction: column; }
  .mp-panel { width: 100%; height: auto; max-height: 340px; border-right: none; border-bottom: 1px solid var(--gray-200); }
  .mp-map-area { min-height: 460px; }
  .mp-agent { flex-direction: column; text-align: center; align-items: center; }
  .mp-agent-actions { justify-content: center; }
}
