/* ── Sea To Sky Scout — Unified Listing Card v2 ──────────────────
   .sc-card  —  dark theme, works on landing + dashboard
   ─────────────────────────────────────────────────────────── */

/* ── Card shell ─────────────────────────────────────────────── */
.sc-card {
  background: #13151f;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35), 0 0 0 0 transparent;
  position: relative;
}
.sc-card:hover {
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 6px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

/* Score-tier left accent bar */
.sc-card::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: rgba(255,255,255,0.08);
}
.sc-card.sc-top::before  { background: #fbbf24; }
.sc-card.sc-pos::before  { background: #34d399; }
.sc-card.sc-neg::before  { background: #f87171; }

/* Border tint per tier */
.sc-card.sc-top { border-color: rgba(251,191,36,0.22); }
.sc-card.sc-pos { border-color: rgba(52,211,153,0.18); }
.sc-card.sc-neg { border-color: rgba(248,113,113,0.22); }

/* ── Header ─────────────────────────────────────────────────── */
.sc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px 24px; /* extra left for accent bar */
}

.sc-addr-block { flex: 1; min-width: 0; }

.sc-addr {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  display: block;
  word-break: break-word;     /* no more truncation */
  line-height: 1.3;
}
.sc-addr:hover { color: #818cf8; text-decoration: underline; text-underline-offset: 3px; }

.sc-addr-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.sc-subarea {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sc-type-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.22);
  color: rgba(129,140,248,0.85);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Score badge ────────────────────────────────────────────── */
.sc-score {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}
.sc-score.sc-top { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.25); }
.sc-score.sc-pos { background: rgba(52,211,153,0.08);  border-color: rgba(52,211,153,0.22); }
.sc-score.sc-neg { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.22); }
.sc-score.sc-zero{ background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); }

.sc-score-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 3px;
}
.sc-score-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
/* Larger badge when rendered in full detail mode (dashboard expanded row) */
.sc-card .sc-score-val { font-size: 28px; }
.sc-score.sc-top  .sc-score-val { color: #fbbf24; }
.sc-score.sc-pos  .sc-score-val { color: #34d399; }
.sc-score.sc-neg  .sc-score-val { color: #f87171; }
.sc-score.sc-zero .sc-score-val { color: rgba(255,255,255,0.28); }

.sc-score-rank {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.25);
  margin-top: 3px;
}

/* ── Stats row ──────────────────────────────────────────────── */
.sc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
}
.sc-stat {
  padding: 11px 16px;
  border-right: 1px solid rgba(255,255,255,0.05);
  min-width: 0;
}
.sc-stat:last-child { border-right: none; }

.sc-stat-val {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}
.sc-stat-lbl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,0.42); /* contrast-safe vs 2.8 bg */
  margin-top: 3px;
}

/* ── Attribute pills ────────────────────────────────────────── */
.sc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 12px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sc-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
/* Pills that encode meaning get their own color */
.sc-pill.warn   {
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.08);
  color: rgba(251,191,36,0.88);
}
.sc-pill.danger {
  border-color: rgba(248,113,113,0.35);
  background: rgba(248,113,113,0.08);
  color: rgba(248,113,113,0.9);
}
.sc-pill.good {
  border-color: rgba(52,211,153,0.35);
  background: rgba(52,211,153,0.08);
  color: rgba(52,211,153,0.88);
}
/* property type pill — distinct blue, NOT green (avoids green/flag collision) */
.sc-type-pill-inline {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  background: rgba(99,179,237,0.1);
  border: 1px solid rgba(99,179,237,0.22);
  color: rgba(99,179,237,0.85);
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}

/* ── Flags ──────────────────────────────────────────────────── */
.sc-flags {
  padding: 10px 20px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sc-flag {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: 8px;
}
/* Colored dot indicator — separate element in JS */
.sc-flag-dot {
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-radius: 2px;
  margin-top: 3px;
}
.sc-flag-text { flex: 1; }

.sc-flag.amber {
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.18);
  color: rgba(251,191,36,0.88);
}
.sc-flag.amber .sc-flag-dot { background: #fbbf24; }

.sc-flag.red {
  background: rgba(248,113,113,0.07);
  border: 1px solid rgba(248,113,113,0.18);
  color: rgba(248,113,113,0.9);
}
.sc-flag.red .sc-flag-dot { background: #f87171; }

.sc-flag.green {
  background: rgba(52,211,153,0.07);
  border: 1px solid rgba(52,211,153,0.2);
  color: rgba(52,211,153,0.9);
}
.sc-flag.green .sc-flag-dot { background: #34d399; }

/* ── Score breakdown (full mode) ────────────────────────────── */
.sc-breakdown {
  padding: 14px 20px 14px 24px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.12);
}
.sc-breakdown-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: baseline;
}
.sc-breakdown-key {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.sc-breakdown-val {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  word-break: break-word;
  line-height: 1.55;
}
.sc-breakdown-val b {
  color: rgba(255,255,255,0.92);
  font-weight: 700;
}

/* ── Actions ────────────────────────────────────────────────── */
.sc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 20px 14px 24px;
  align-items: center;
}
.sc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  min-height: 34px;
  white-space: nowrap;
}
.sc-action-btn:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.18);
}
.sc-action-btn.primary {
  background: #818cf8;
  color: #09090f;
  border-color: transparent;
  font-weight: 700;
}
.sc-action-btn.primary:hover { background: #939cf9; }
.sc-action-btn.active {
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.35);
  color: #fbbf24;
}

/* ── CTA link (compact/flag modes) ─────────────────────────── */
.sc-cta {
  display: block;
  padding: 10px 20px 12px 24px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(129,140,248,0.8);
  text-decoration: none;
  transition: color .12s;
}
.sc-cta:hover { color: #818cf8; }
.sc-cta::after { content: ' →'; }

/* ── Empty state ────────────────────────────────────────────── */
.sc-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.22);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sc-head { padding: 14px 16px 12px 20px; gap: 12px; }
  .sc-addr  { font-size: 14px; }

  .sc-score { min-width: 56px; padding: 7px 10px; }
  .sc-score-val { font-size: 20px; }
  .sc-score-rank { font-size: 9px; }

  /* Force 2×2 stats grid on mobile — no orphans */
  .sc-stats { grid-template-columns: 1fr 1fr; }
  .sc-stat:nth-child(even) { border-right: none; }
  .sc-stat:nth-child(1),
  .sc-stat:nth-child(2) { border-bottom: 1px solid rgba(255,255,255,0.05); }
  .sc-stat-val { font-size: 14px; }

  .sc-pills  { padding: 10px 16px 10px 20px; }
  .sc-flags  { padding: 8px 16px 8px 20px; }
  .sc-breakdown { padding: 12px 16px 12px 20px; }
  .sc-breakdown-row { grid-template-columns: 100px 1fr; gap: 8px; }
  .sc-breakdown-key { font-size: 10px; }
  .sc-breakdown-val { font-size: 12px; }
  .sc-actions { padding: 10px 16px 12px 20px; gap: 6px; }
  .sc-action-btn { font-size: 13px; min-height: 40px; padding: 8px 14px; }
  .sc-action-btn.primary { flex: 1; justify-content: center; }
  .sc-cta { padding: 8px 16px 10px 20px; }
}
