/* ─── NAV ─── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.nav-logo { font-size: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--fg); }

.btn-post {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #0c0f14;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-post:hover { background: var(--accent-light); }

/* ─── GLOBAL BUTTONS ─── */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  background: var(--accent);
  color: #0c0f14;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  text-align: center;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-primary.btn-full { width: 100%; display: block; }
.btn-primary.btn-lg { padding: 14px 36px; font-size: 16px; }

.btn-ghost {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 15px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  text-align: center;
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.15); }
.btn-ghost.btn-full { width: 100%; display: block; margin-top: 10px; }

/* ─── APP MAIN ─── */
.app-main { min-height: calc(100vh - 64px - 120px); }

/* ─── BROWSE HERO ─── */
.browse-hero {
  padding: 56px 0 32px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.browse-hero h1 { margin-bottom: 8px; }
.browse-sub { color: var(--fg-muted); font-size: 17px; }

/* ─── BROWSE LAYOUT ─── */
.browse-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 60px;
  align-items: start;
}

/* ─── FILTERS ─── */
.filters-panel {
  position: sticky;
  top: 80px;
}

.filters-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.filters-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.filter-group { margin-bottom: 20px; }

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.filter-radios { display: flex; flex-direction: column; gap: 6px; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  color: var(--fg-muted);
}
.radio-option input { display: none; }
.radio-option.active, .radio-option:hover { background: var(--accent-glow); border-color: rgba(232,164,74,0.2); color: var(--accent); }

.filter-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.filter-input:focus { border-color: rgba(232,164,74,0.4); }

.filter-row { display: flex; gap: 8px; }
.filter-input.half { width: 50%; }

/* ─── LISTINGS SECTION ─── */
.listings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.listings-count {
  font-size: 15px;
  color: var(--fg-muted);
}

.btn-post-sm {
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #0c0f14;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.btn-post-sm:hover { background: var(--accent-light); }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ─── LISTING CARD ─── */
.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  display: block;
  transition: border-color 0.25s, transform 0.2s;
}
.listing-card:hover { border-color: rgba(232,164,74,0.3); transform: translateY(-2px); }

.listing-photo {
  position: relative;
  height: 200px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 48px;
  color: var(--fg-muted);
}

.listing-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.listing-badge--sale { background: rgba(232,164,74,0.18); color: var(--accent); }
.listing-badge--rent { background: rgba(92,184,122,0.18); color: var(--green); }
.listing-badge--lease { background: rgba(100,149,237,0.18); color: #6495ed; }

.listing-body { padding: 18px; }
.listing-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}
.listing-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-location { font-size: 13px; color: var(--fg-muted); margin-bottom: 10px; }
.listing-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-muted);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-family: 'Space Grotesk', sans-serif; font-size: 22px; margin-bottom: 8px; color: var(--fg); }
.empty-state a { color: var(--accent); text-decoration: none; }

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}
.page-btn {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.2s;
}
.page-btn:hover { border-color: rgba(232,164,74,0.3); }
.page-info { font-size: 14px; color: var(--fg-muted); }

/* ─── POST FORM PAGE ─── */
.form-page { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.form-header { margin-bottom: 32px; }
.form-header h1 { margin-bottom: 8px; }
.form-header p { color: var(--fg-muted); }

.error-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
  color: #f87171;
  font-size: 14px;
  line-height: 1.7;
}

.listing-form { display: flex; flex-direction: column; gap: 32px; }

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
}
.form-label.required::after { content: ' *'; color: var(--accent); }

.form-input {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: rgba(232,164,74,0.5); }

textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8a87' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.input-prefix { position: relative; }
.prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-muted); font-size: 15px; pointer-events: none; }
.form-input.with-prefix { padding-left: 28px; }

.form-hint { font-size: 12px; color: var(--fg-muted); }

/* Type selector */
.type-selector { display: flex; gap: 12px; }
.type-option {
  flex: 1;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--fg-muted);
}
.type-option input { display: none; }
.type-option.active, .type-option:hover { background: var(--accent-glow); border-color: rgba(232,164,74,0.4); color: var(--accent); }

/* Photo upload */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  transition: border-color 0.2s;
}
.photo-upload-area:hover { border-color: rgba(232,164,74,0.3); }
.photo-file-input { display: none; }
.photo-upload-label { cursor: pointer; display: block; }
.photo-upload-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.photo-upload-text { display: block; color: var(--fg); font-size: 15px; margin-bottom: 6px; }
.photo-upload-text u { color: var(--accent); }
.photo-upload-hint { font-size: 13px; color: var(--fg-muted); }

.photo-preview-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; justify-content: center; }
.photo-thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.form-actions { display: flex; gap: 16px; align-items: center; }

/* ─── DETAIL PAGE ─── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  padding: 40px 24px 80px;
  align-items: start;
}

.success-banner {
  grid-column: span 2;
  background: rgba(92,184,122,0.1);
  border: 1px solid rgba(92,184,122,0.25);
  border-radius: 10px;
  padding: 14px 20px;
  color: var(--green);
  font-size: 15px;
}

/* Gallery */
.gallery { margin-bottom: 28px; }
.gallery-main { border-radius: 14px; overflow: hidden; height: 420px; background: var(--bg-card); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-placeholder { display: flex; align-items: center; justify-content: center; height: 420px; font-size: 72px; background: var(--bg-card); border-radius: 14px; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb { width: 80px; height: 64px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; flex-shrink: 0; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }

/* Stats bar */
.detail-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); }
.stat-value { font-size: 15px; font-weight: 600; }
.badge-sale { color: var(--accent); }
.badge-rent { color: var(--green); }
.badge-lease { color: #6495ed; }

/* Header */
.detail-header { margin-bottom: 24px; }
.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.detail-address { font-size: 15px; color: var(--fg-muted); }

.detail-description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.detail-description h2 { font-size: 17px; margin-bottom: 12px; }
.detail-description p { color: var(--fg-muted); line-height: 1.75; white-space: pre-wrap; }

.detail-meta { font-size: 13px; color: var(--fg-muted); }

/* Contact card */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: sticky;
  top: 80px;
}
.contact-card-title { font-size: 20px; margin-bottom: 12px; font-family: 'Space Grotesk', sans-serif; }
.contact-name { font-size: 14px; color: var(--fg-muted); margin-bottom: 20px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }

.back-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--fg); }

/* ─── ERROR PAGE ─── */
.error-page {
  text-align: center;
  padding: 100px 24px;
}
.error-icon { font-size: 64px; margin-bottom: 20px; }
.error-page h1 { font-size: 28px; margin-bottom: 12px; }
.error-page p { color: var(--fg-muted); margin-bottom: 28px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .browse-layout { grid-template-columns: 1fr; }
  .filters-panel { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .success-banner { grid-column: span 1; }
  .contact-card { position: static; }
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
  .type-selector { flex-direction: column; }
  .listings-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .detail-stats-bar { flex-wrap: wrap; }
}
