/* ─── TorchDoor Core Styles ─────────────────────────────────────────────── */

:root {
  --navy:      #0d1b2a;
  --navy-mid:  #1a2e45;
  --navy-light:#243b55;
  --gold:      #f0a500;
  --gold-light:#ffc53d;
  --white:     #ffffff;
  --off-white: #f4f6f9;
  --gray-100:  #edf0f4;
  --gray-300:  #b8c2cc;
  --gray-500:  #6b7a8d;
  --gray-700:  #3d4f5e;
  --green:     #22c55e;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.15), 0 4px 8px rgba(0,0,0,.08);
  --radius:    8px;
  --radius-lg: 14px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--navy);
  margin: 0;
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

/* ─── Navbar ─────────────────────────────────────────────────────────────── */

.navbar {
  background: var(--navy);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.navbar-brand .torch { color: var(--gold); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-links a {
  color: var(--gray-300);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--white);
  background: var(--navy-light);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(240,165,0,.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--white);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; justify-content: center; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #1e3a5f 100%);
  color: var(--white);
  padding: 100px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(240,165,0,.15);
  color: var(--gold);
  border: 1px solid rgba(240,165,0,.3);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 auto 16px;
  max-width: 800px;
  letter-spacing: -1.5px;
}

.hero h1 span { color: var(--gold); }

.hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,.7);
  margin: 0 auto 40px;
  max-width: 560px;
}

/* ─── Search Bar ─────────────────────────────────────────────────────────── */

.search-bar {
  display: flex;
  max-width: 680px;
  margin: 0 auto 20px;
  background: var(--white);
  border-radius: 100px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.1);
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 18px 24px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--navy);
  background: transparent;
}

.search-bar input::placeholder { color: var(--gray-300); }

.search-bar button {
  padding: 12px 28px;
  margin: 6px;
  border-radius: 100px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-bar button:hover { background: var(--gold-light); }

.search-hints {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.search-hint {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.search-hint:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
}

/* ─── Stats Bar ──────────────────────────────────────────────────────────── */

.stats-bar {
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(0,0,0,.1);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  color: var(--white);
}

.stat-item .val {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.stat-item .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-300);
  margin-top: 2px;
}

/* ─── Container / Layout ─────────────────────────────────────────────────── */

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }

.section-header {
  margin-bottom: 36px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.section-header p {
  color: var(--gray-500);
  margin: 0;
  font-size: 16px;
}

.section-header .badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ─── Property Grid ──────────────────────────────────────────────────────── */

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.property-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.property-card-img {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: var(--gray-100);
}

.property-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .property-card-img img { transform: scale(1.04); }

.property-card-img .no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--gray-300);
  background: var(--gray-100);
}

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-hot    { background: #ef4444; color: white; }
.badge-new    { background: #22c55e; color: white; }
.badge-pending{ background: #f59e0b; color: white; }
.badge-sold   { background: var(--gray-700); color: white; }
.badge-reduced{ background: var(--blue); color: white; }

.card-save {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 16px;
  transition: all var(--transition);
}

.card-save:hover, .card-save.saved { background: var(--gold); color: var(--navy); }

.property-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.card-price .price-change {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin-left: 8px;
}

.card-address {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 12px;
  line-height: 1.4;
}

.card-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--gray-700);
  font-weight: 600;
  border-top: 1px solid var(--gray-100);
  padding-top: 12px;
  margin-top: auto;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-stat .icon { font-size: 12px; color: var(--gray-300); }

.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-500);
}

.card-dom { color: var(--gray-500); }
.card-dom.hot { color: var(--green); font-weight: 600; }

/* ─── Filter Panel ───────────────────────────────────────────────────────── */

.filter-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.filter-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}

.filter-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 10px;
  display: block;
}

.filter-group {
  display: flex;
  gap: 8px;
}

.filter-group .form-input { flex: 1; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  color: var(--navy);
  background: var(--off-white);
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus { border-color: var(--gold); background: var(--white); }

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--gray-100);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
  transition: all var(--transition);
  background: var(--off-white);
  user-select: none;
}

.pill:hover { border-color: var(--gold); color: var(--navy); }
.pill.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ─── Market Dashboard ───────────────────────────────────────────────────── */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
}

.metric-card.green::before { background: var(--green); }
.metric-card.blue::before  { background: var(--blue); }
.metric-card.red::before   { background: var(--red); }

.metric-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 6px;
}

.metric-change {
  font-size: 13px;
  font-weight: 600;
}

.metric-change.up   { color: var(--green); }
.metric-change.down { color: var(--red); }

/* ─── Charts ─────────────────────────────────────────────────────────────── */

.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  margin-bottom: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.chart-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.chart-tabs {
  display: flex;
  gap: 4px;
}

.chart-tab {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-100);
  color: var(--gray-500);
  background: transparent;
  transition: all var(--transition);
}

.chart-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ─── Map Panel ──────────────────────────────────────────────────────────── */

#map {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  z-index: 0;
}

.map-container {
  position: relative;
  height: 100%;
  min-height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ─── Property Detail ────────────────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 280px 200px;
  gap: 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: brightness var(--transition);
}

.gallery img:hover { brightness: 0.9; }
.gallery .main { grid-row: 1 / 3; }
.gallery .more-overlay { position: relative; }
.gallery .more-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.detail-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.detail-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-stat .val {
  font-size: 22px;
  font-weight: 800;
}

.detail-stat .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
}

/* ─── Contact Card ───────────────────────────────────────────────────────── */

.contact-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.contact-card-header {
  background: var(--navy);
  color: white;
  padding: 20px;
  text-align: center;
}

.contact-card-header .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
}

.contact-card-body { padding: 20px; }

.contact-card .form-input { margin-bottom: 12px; }

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ─── Market Trending Cards ──────────────────────────────────────────────── */

.market-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.market-rank {
  font-size: 28px;
  font-weight: 900;
  color: var(--gray-100);
  min-width: 36px;
  text-align: right;
}

.market-info { flex: 1; }
.market-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.market-sub  { font-size: 13px; color: var(--gray-500); }

.market-price {
  text-align: right;
}

.market-price .val {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}

.market-price .chg {
  font-size: 12px;
  font-weight: 600;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-100);
  font-weight: 700;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--navy);
}

.data-table tr:hover td { background: var(--off-white); }
.data-table tr:last-child td { border-bottom: none; }

/* ─── Loading / Empty States ─────────────────────────────────────────────── */

.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, #e8ecf0 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.skeleton-img  { height: 210px; }
.skeleton-body { padding: 16px; }
.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-line.lg  { height: 22px; width: 60%; }
.skeleton-line.md  { width: 80%; }
.skeleton-line.sm  { width: 40%; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-500);
}

.empty-state .icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
.empty-state p  { margin: 0 0 24px; }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn .25s ease;
  border-left: 4px solid var(--gold);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.footer {
  background: var(--navy);
  color: rgba(255,255,255,.5);
  padding: 48px 24px 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand h3 { color: var(--white); font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.footer-brand p  { margin: 0 0 20px; font-size: 14px; line-height: 1.7; }

.footer-col h4 {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a  { color: rgba(255,255,255,.5); font-size: 14px; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--gold); }

.footer-bottom {
  max-width: 1280px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero { padding: 60px 16px 48px; }
  .hero h1 { font-size: 30px; }
  .detail-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 240px; }
  .gallery .main { grid-row: auto; }
  .gallery > *:nth-child(n+2) { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { gap: 20px; }
  .navbar-links { display: none; }
}
