/* ============================================================
   Property Owner Widget — CAMA Project
   ============================================================ */

html, body { height: 100%; display: flex; flex-direction: column; }

/* ---- Header nav: yellow pill buttons ---- */
.header-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.header-nav a {
  background: var(--phila-gold);
  color: var(--phila-dark-blue);
  padding: 0.38rem 0.9rem;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.header-nav a:hover { background: var(--phila-gold-dark); color: white; }

/* ---- Hero search bar ---- */
.hero-search {
  background: linear-gradient(135deg, var(--phila-dark-blue) 0%, var(--phila-blue) 100%);
  padding: 2rem 1.5rem;
  color: white;
  flex-shrink: 0;
}

.hero-search h2 { font-size: 21px; margin-bottom: 0.3rem; }

.hero-search p { font-size: 13px; opacity: 0.8; margin-bottom: 1rem; }

.hero-search-bar { display: flex; gap: 0.5rem; max-width: 620px; }

.hero-search-bar .search-input-wrap { flex: 1; position: relative; }

.hero-search-bar input {
  width: 100%;
  font-size: 14px;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--radius);
}

.hero-search-bar .autocomplete-list { border-color: #ccc; }

.hero-search-bar button {
  padding: 0.65rem 1.4rem;
  background: var(--phila-gold);
  color: var(--phila-dark-blue);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.hero-search-bar button:hover { background: var(--phila-gold-dark); }
.hero-search-bar button:disabled { opacity: 0.6; cursor: default; }

.hero-hint { font-size: 11px; opacity: 0.6; margin-top: 0.5rem; }

.hero-error {
  font-size: 12px;
  color: #ffccaa;
  margin-top: 0.5rem;
  max-width: 620px;
}

/* ---- Page body ---- */
.page-body {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Main two-column grid ---- */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1rem;
  align-items: stretch;
}

/* ---- Map ---- */
.map-wrapper {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--phila-shadow);
}

.map-wrapper .card-header {
  flex-shrink: 0;
}

.clear-marker-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 3px;
  cursor: pointer;
}
.clear-marker-btn:hover {
  background: rgba(255,255,255,0.15);
}

#widget-map {
  flex: 1;
  min-height: 480px;
}

/* ---- Right panel (two stacked cards) ---- */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================================
   SUMMARY CARD
   ============================================================ */
.summary-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--phila-shadow);
  overflow: hidden;
}

.summary-header {
  background: var(--phila-blue);
  color: white;
  padding: 0.85rem 1.1rem;
}

.summary-pid {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.summary-body {
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--phila-border);
}

.summary-row:last-of-type { border-bottom: none; }

.summary-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0 0.85rem;
}

.summary-value-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  background: #f8f9fb;
  border: 1px solid var(--phila-border);
  border-radius: var(--radius);
}

.summary-value-block .sr-value-main { font-size: 16px; }

.sr-label {
  font-size: 11px;
  color: var(--phila-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sr-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--phila-text);
}

.sr-value-main {
  font-size: 18px;
  font-weight: 700;
  color: var(--phila-blue);
}

/* Insight sentence */
.summary-insight {
  font-size: 12px;
  color: var(--phila-text-muted);
  line-height: 1.6;
  padding: 0.7rem 0.85rem;
  background: #f8f8f8;
  border-radius: var(--radius);
  border-left: 3px solid var(--phila-blue);
}

.insight-tag {
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 11px;
}

.insight-tag.above { background: #fff0ee; color: var(--phila-red); }
.insight-tag.below { background: #edfaf0; color: var(--phila-green); }

/* ---- Property tile legend (rendered as a Leaflet control) ---- */
.map-legend {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--phila-border);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  min-width: 130px;
}

.map-legend-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--phila-text-muted);
  margin-bottom: 0.35rem;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin-bottom: 0.18rem;
  font-size: 10px;
  color: var(--phila-text);
}

.map-legend-item:last-child { margin-bottom: 0; }

.map-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* ---- Property hover popup ---- */
/* pointer-events:none lets clicks pass through to the tile layer below */
.property-hover-popup,
.property-hover-popup * {
  pointer-events: none;
}
.property-hover-popup .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  padding: 0.35rem 0.55rem;
}

.property-hover-popup .leaflet-popup-content {
  margin: 0;
  font-size: 11px;
  color: var(--phila-text);
  min-width: 130px;
}

.property-hover-popup .leaflet-popup-tip-container { display: none; }

.phover-id {
  font-weight: 700;
  font-size: 11px;
  color: var(--phila-blue);
  margin-bottom: 0.2rem;
}

.phover-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 11px;
}

/* ============================================================
   MAP POPUP
   ============================================================ */
.map-popup-address {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.map-popup-pid {
  font-size: 11px;
  color: var(--phila-text-muted);
  margin-bottom: 2px;
}

.map-popup-value {
  font-size: 12px;
  color: var(--phila-blue);
  font-weight: 600;
}

/* ============================================================
   INFO CARDS ROW
   ============================================================ */
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.info-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--phila-shadow);
  padding: 1.1rem 1.25rem;
  border-top: 4px solid var(--phila-blue);
}

.info-card.gold  { border-top-color: var(--phila-gold); }
.info-card.green { border-top-color: var(--phila-green); }

.info-card h4 { font-size: 13px; font-weight: 700; color: var(--phila-blue); margin-bottom: 0.4rem; }
.info-card.gold h4  { color: var(--phila-gold-dark); }
.info-card.green h4 { color: var(--phila-green); }

.info-card p { font-size: 12px; color: var(--phila-text-muted); line-height: 1.6; }
.info-card a { color: var(--phila-blue); font-weight: 700; font-size: 12px; display: inline-block; margin-top: 0.4rem; }

/* Footer links */
.footer-links { margin-top: 0.3rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .main-grid  { grid-template-columns: 1fr; }
  .info-cards { grid-template-columns: 1fr; }
  #widget-map { min-height: 300px; }
}
