/* ═══════════════════════════════════════════════════════════════════════════
   HOMESURE - PUBLIC BROWSE LISTINGS
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --border: rgba(0,0,0,0.1);
  --text: #1e293b;
  --muted: rgba(0,0,0,0.5);
  --muted2: rgba(0,0,0,0.7);
  --teal: #00c9a7;
  --teal-hover: #00a88a;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --border: rgba(255,255,255,0.1);
  --text: #f1f5f9;
  --muted: rgba(255,255,255,0.5);
  --muted2: rgba(255,255,255,0.7);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation ── */
.browse-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.browse-nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

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

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--border);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.btn-signin {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-signin:hover {
  background: var(--bg);
  border-color: var(--teal);
}

.btn-signup {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: white;
  background: var(--teal);
  transition: all 0.2s;
}

.btn-signup:hover {
  background: var(--teal-hover);
  transform: translateY(-1px);
}

/* ── Main Container ── */
.browse-container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
}

/* ── Header ── */
.browse-header {
  text-align: center;
  margin-bottom: 40px;
}

.browse-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.browse-subtitle {
  font-size: 16px;
  color: var(--muted);
}

/* ── Filters ── */
.browse-filters {
  margin-bottom: 32px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.filter-select,
.filter-search {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-select:focus,
.filter-search:focus {
  outline: none;
  border-color: var(--teal);
}

.filter-search {
  grid-column: span 2;
}

/* ── Results Header ── */
.browse-results-header {
  margin-bottom: 24px;
}

.results-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Listings Grid ── */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
}

.listing-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.listing-content {
  padding: 18px;
}

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

.listing-type {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.listing-type.rent {
  background: rgba(0, 201, 167, 0.12);
  color: var(--teal);
}

.listing-type.sale {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.listing-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.listing-address {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.listing-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 12px;
}

.listing-details {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.listing-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted2);
}

.listing-detail svg {
  width: 16px;
  height: 16px;
}

/* ── Empty State ── */
.browse-empty {
  text-align: center;
  padding: 80px 20px;
}

.browse-empty svg {
  width: 64px;
  height: 64px;
  color: var(--muted);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-text {
  font-size: 14px;
  color: var(--muted);
}

/* ── Footer ── */
.browse-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content p {
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .browse-nav-content {
    padding: 0 16px;
  }

  .nav-logo-text {
    font-size: 18px;
  }

  .btn-signin,
  .btn-signup {
    padding: 8px 16px;
    font-size: 13px;
  }

  .browse-container {
    padding: 24px 16px 60px;
  }

  .browse-title {
    font-size: 28px;
  }

  .browse-subtitle {
    font-size: 14px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: span 1;
  }

  .browse-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}
