/* DirtVault App CSS — dark OHV aesthetic, Outfit + Space Grotesk */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --fg: #f0ede8;
  --fg-muted: #8a8580;
  --fg-dim: #5a5550;
  --accent: #e87a2e;
  --accent-glow: rgba(232, 122, 46, 0.15);
  --accent-bright: #ff9a4e;
  --danger: #e84040;
  --success: #3dcc6e;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

/* ===== NAV ===== */
.nav {
  background: rgba(10,10,10,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 5%;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
  max-width: 1280px;
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--fg);
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-links a {
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}
.nav-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nav-badge {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-bright); color: #000; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.25); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== PAGE CONTAINER ===== */
.page { max-width: 1280px; margin: 0 auto; padding: 40px 5%; }
.page-sm { max-width: 560px; margin: 0 auto; padding: 60px 5%; }
.page-md { max-width: 800px; margin: 0 auto; padding: 40px 5%; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 32px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.page-header p { color: var(--fg-muted); font-size: 0.9rem; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}
.card:hover { border-color: rgba(255,255,255,0.14); transform: translateY(-2px); }
.card-body { padding: 20px; }

/* ===== LISTING GRID ===== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.listing-card { text-decoration: none; color: inherit; display: block; }
.listing-card:hover { color: inherit; }
.listing-card:hover .card { border-color: rgba(232,122,46,0.3); }
.listing-photo {
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  overflow: hidden;
  position: relative;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.listing-card:hover .listing-photo img { transform: scale(1.04); }
.listing-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--fg-dim); font-size: 2.5rem;
}
.listing-info { padding: 16px; }
.listing-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.listing-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--fg-muted);
}
.tag-accent { background: var(--accent-glow); color: var(--accent); }
.tag-success { background: rgba(61, 204, 110, 0.12); color: var(--success); }
.tag-danger { background: rgba(232, 64, 64, 0.12); color: var(--danger); }

/* ===== BROWSE LAYOUT ===== */
.browse-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .browse-layout { grid-template-columns: 1fr; }
  .browse-filters { display: none; }
  .browse-filters.open { display: block; }
}
.filters-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 76px;
}
.filter-section { margin-bottom: 20px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 8px;
  display: block;
}
.browse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.browse-count { color: var(--fg-muted); font-size: 0.875rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.form-label .req { color: var(--accent); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-input::placeholder { color: var(--fg-dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 0.78rem; color: var(--fg-dim); margin-top: 4px; }
.form-error {
  background: rgba(232, 64, 64, 0.1);
  border: 1px solid rgba(232, 64, 64, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

/* ===== PHOTO UPLOAD ===== */
.photo-upload-area {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.photo-upload-area:hover { border-color: var(--accent); background: var(--accent-glow); }
.photo-upload-area input[type="file"] { display: none; }
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.photo-preview { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===== LISTING DETAIL ===== */
.listing-detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) { .listing-detail-layout { grid-template-columns: 1fr; } }

.photo-gallery { position: relative; }
.gallery-main {
  aspect-ratio: 4/3;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumb {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.listing-sidebar {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 76px;
}
.listing-sidebar-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
}
.listing-sidebar-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.listing-specs { margin-bottom: 20px; }
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.875rem;
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--fg-muted); }
.spec-value { font-weight: 500; }

.seller-card {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 16px;
  margin-top: 16px;
}
.seller-name { font-weight: 600; margin-bottom: 4px; }
.seller-since { font-size: 0.8rem; color: var(--fg-dim); margin-bottom: 16px; }

/* ===== MESSAGES ===== */
.inbox-list { display: flex; flex-direction: column; gap: 2px; }
.inbox-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.inbox-item:hover { border-color: rgba(255,255,255,0.14); color: inherit; }
.inbox-item.unread { border-left: 3px solid var(--accent); }
.inbox-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  overflow: hidden;
}
.inbox-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inbox-info { flex: 1; min-width: 0; }
.inbox-who { font-weight: 600; font-size: 0.875rem; }
.inbox-listing { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview { font-size: 0.875rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 0.78rem; color: var(--fg-dim); }

.thread-messages { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
}
.message-bubble.mine {
  background: var(--accent);
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message-bubble.theirs {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.message-time { font-size: 0.72rem; color: var(--fg-dim); margin-top: 4px; text-align: right; }
.message-bubble.theirs .message-time { text-align: left; }
.thread-composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.thread-composer textarea {
  flex: 1;
  min-height: 56px;
  resize: none;
}

/* ===== AUTH ===== */
.auth-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 40px;
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--fg-muted); font-size: 0.875rem; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 0.875rem; color: var(--fg-muted); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--fg-dim); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--fg-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 8px; color: var(--fg); }
.empty-state p { margin-bottom: 24px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--fg-muted);
  text-decoration: none;
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.search-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ===== CONDITION BADGE ===== */
.condition-like-new { background: rgba(61, 204, 110, 0.12); color: var(--success); }
.condition-excellent { background: rgba(61, 204, 110, 0.08); color: #7ed99e; }
.condition-good { background: rgba(232, 122, 46, 0.1); color: var(--accent); }
.condition-fair { background: rgba(232, 122, 46, 0.08); color: #c97a4a; }
.condition-parts-only { background: rgba(232, 64, 64, 0.1); color: var(--danger); }

/* ===== MISC ===== */
.divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 24px 0; }
.text-muted { color: var(--fg-muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.85rem; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Listing description */
.listing-description { line-height: 1.75; color: var(--fg-muted); font-size: 0.9rem; white-space: pre-wrap; }
