/* eVent City palette (settled 2026-11-24):
   bright blue leads, grass green for garage sales, sunset gold Featured,
   red-orange selected pin/badges, pink only a small highlight by the logo,
   cool blue-green neutrals, deep blue-green dark mode. */

:root {
  --blue: #1e88e5;
  --blue-dark: #1565c0;
  --green: #43a047;
  --gold: #f9a825;
  --gold-soft: #fff3d6;
  --redorange: #f4511e;
  --pink: #ec407a;
  --plum: #8e24aa;
  --bg: #f2f8f7;
  --surface: #ffffff;
  --surface-2: #e8f2f0;
  --text: #14303a;
  --muted: #5b7280;
  --border: #d3e4e0;
  --danger: #c62828;
  --shadow: 0 2px 10px rgba(20, 48, 58, 0.12);
}

html[data-theme="dark"] {
  --blue: #42a5f5;
  --blue-dark: #90caf9;
  --green: #66bb6a;
  --gold: #ffca28;
  --gold-soft: #3a2f10;
  --redorange: #ff7043;
  --pink: #f48fb1;
  --plum: #ba68c8;
  --bg: #0b1e26;
  --surface: #12303c;
  --surface-2: #173c4a;
  --text: #e6f2f0;
  --muted: #9db8bd;
  --border: #1e4353;
  --danger: #ef9a9a;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h2, h3 { margin: 0.4em 0; }
.muted { color: var(--muted); font-size: 0.9em; }
a { color: var(--blue); }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 3px solid var(--blue);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 52px; height: 52px; object-fit: cover; border-radius: 10px;
  border-bottom: 3px solid var(--pink); /* pink: small highlight by the logo only */
}
.brand-name { font-size: 1.5rem; font-weight: 800; color: var(--blue-dark); line-height: 1.05; }
.brand-name span { color: var(--redorange); letter-spacing: 0.04em; }
.brand-tagline { color: var(--muted); font-size: 0.9rem; }
.brand-subtext { color: var(--muted); font-size: 0.78rem; opacity: 0.85; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.place-search { display: flex; gap: 6px; }
.place-search input { min-width: 200px; }

/* Buttons & inputs */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 0.95rem; cursor: pointer;
}
.btn:hover { border-color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 10px; font-size: 0.85rem; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 1em; padding: 0; text-decoration: underline; }

input, select, textarea {
  width: 100%; padding: 9px 10px; margin: 4px 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 1rem;
}
label { display: block; font-weight: 600; margin-top: 8px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 12px 0; padding: 10px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.radio-row, .check-row { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
.radio-row input, .check-row input { width: auto; margin: 0; }
.form-error { color: var(--danger); font-weight: 600; }
.form-warning { color: var(--redorange); font-weight: 600; }

/* Toolbar */
.toolbar {
  padding: 10px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.toolbar-label { font-weight: 700; font-size: 0.9rem; margin-right: 8px; }
.toolbar-note { color: var(--muted); font-size: 0.85rem; margin-left: 8px; }
.who-browsing { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg-btn { border: none; background: transparent; color: var(--text); padding: 7px 14px; cursor: pointer; font-size: 0.9rem; }
.seg-btn.active { background: var(--blue); color: #fff; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 0.88rem;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }

/* Layout: map + list */
.layout {
  display: grid; grid-template-columns: 1fr 380px;
  height: calc(100vh - 190px); min-height: 420px;
}
#map { width: 100%; height: 100%; z-index: 1; }
.list-panel {
  overflow-y: auto; padding: 12px; background: var(--bg);
  border-left: 1px solid var(--border);
}
.list-head { display: flex; align-items: baseline; gap: 8px; }
.list-count { color: var(--muted); font-size: 0.9rem; }
.notice {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.notice p { margin: 0 0 8px; }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.listing-list { display: flex; flex-direction: column; gap: 10px; }
.list-empty { color: var(--muted); }

.listing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow);
  border-left: 5px solid var(--blue);
}
.listing-card.garage { border-left-color: var(--green); }
.listing-card.open_house { border-left-color: var(--plum); }
.listing-card.featured { background: var(--gold-soft); border-color: var(--gold); }
.listing-card.selected { outline: 2px solid var(--redorange); }
.listing-card h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.listing-card h3.bold-title { font-weight: 900; }
.card-meta { color: var(--muted); font-size: 0.9rem; }
.card-when { color: var(--blue-dark); font-weight: 600; font-size: 0.92rem; }
.card-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; margin-right: 4px; vertical-align: middle;
}
.badge-event { background: var(--blue); color: #fff; }
.badge-garage { background: var(--green); color: #fff; }
.badge-openhouse { background: var(--plum); color: #fff; }
.badge-moto { background: #8dc63f; color: #1a2e05; }
.badge-atv { background: #e8590c; color: #fff; }
.badge-featured { background: var(--gold); color: #3a2b00; }
.badge-audience { background: var(--redorange); color: #fff; }
.badge-price { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.badge-sample { background: var(--muted); color: #fff; }
.badge-idverified { background: var(--green, #2e9e5b); color: #fff; align-self: center; }

/* Map pins */
.pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  background: var(--blue);
}
.pin.garage { background: var(--green); }
.pin.open_house { background: var(--plum); }
.pin.moto_ride { background: #8dc63f; }
.pin.atv_ride { background: #e8590c; }
.list-divider {
  font-weight: 700; color: var(--muted); font-size: 0.9rem;
  padding: 10px 4px 4px; border-top: 1px solid var(--border); margin-top: 6px;
}
.list-divider:first-child { border-top: none; margin-top: 0; }
.pin.selected { background: var(--redorange); width: 32px; height: 32px; }
.pin.featured { box-shadow: 0 0 0 3px var(--gold), 0 1px 4px rgba(0,0,0,0.4); }

/* Modals */
.modal {
  position: fixed; inset: 0; background: rgba(11, 30, 38, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 12px; z-index: 2000; overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); color: var(--text); border-radius: 14px;
  padding: 20px; width: 100%; max-width: 440px; position: relative;
  box-shadow: var(--shadow);
}
.modal-card-wide { max-width: 640px; }
.modal-close {
  position: absolute; top: 8px; right: 12px; border: none; background: none;
  font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.auth-switch { margin-top: 12px; text-align: center; }

.when-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.neighbors-preview { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.address-row { display: flex; gap: 8px; align-items: flex-start; }
.address-row input { flex: 1; }
.map-preview { height: 180px; border-radius: 10px; border: 1px solid var(--border); margin: 6px 0; z-index: 1; }
.pin-status { font-size: 0.92rem; }
.price-row { display: flex; align-items: center; gap: 6px; max-width: 180px; }

/* Detail */
.detail-photos { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; }
.detail-photos img { height: 180px; border-radius: 10px; object-fit: cover; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* My listings */
.my-listing-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface);
}

/* Toast */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  z-index: 3000; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; height: auto; }
  #map { min-height: 300px; }
  .list-panel { border-left: none; border-top: 1px solid var(--border); max-height: none; }
  .when-grid { grid-template-columns: 1fr; }
  .place-search input { min-width: 150px; }
}
