/* ============================================================
   MCM Square — Main Stylesheet
   Theme: #E85D26 (orange) / #FFFFFF / #1A1A1A
   ============================================================ */

/* Self-hosted system font stack — eliminates Google Fonts network request.
   Falls back gracefully to system fonts which are already on the device. */
:root {
  --font-display: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Load Google Fonts asynchronously so they don't block rendering */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap&display=optional');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --primary: #E85D26;
  --primary-dark: #C44A18;
  --primary-light: #F5803F;
  --primary-pale: #FEF0EA;
  --white: #FFFFFF;
  --bg: #F8F7F5;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-dark: #D1D5DB;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 4px 12px rgba(232,93,38,0.15), 0 8px 32px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: 'Outfit', 'Syne', sans-serif;
  --font-body: 'Inter', 'DM Sans', sans-serif;
  --transition: 0.2s ease;
  --nav-height: 68px;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
}

/* ─── LANDING PAGE – PREMIUM MARKETPLACE DESIGN ─── */
.landing-page { padding-top: var(--nav-height); background: var(--bg); }
.landing-hero-wrap { position: relative; padding: 60px 0 80px; overflow: hidden; max-width: 100vw; }
.hero-gradient {
  position: absolute; top: 0; left: 0; right: 0; height: 500px; z-index: -1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #FF9F5E 100%);
  clip-path: polygon(0 0, 100% 0, 100% 65%, 0 100%);
}
[data-theme="dark"] .hero-gradient {
  background: linear-gradient(135deg, rgba(232,93,38,0.9) 0%, rgba(245,128,63,0.7) 50%, rgba(255,159,94,0.6) 100%);
}

.landing-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(12px);
  padding: 8px 16px; border-radius: 50px; color: white;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.3);
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.1;
  color: white; margin-bottom: 16px; font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.text-gradient {
  background: linear-gradient(120deg, #FFE66D, #FFB347);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.1); } }

.hero-subtitle {
  font-size: 1.1rem; color: rgba(255,255,255,0.9); margin-bottom: 28px; line-height: 1.6; max-width: 480px;
}
.landing-ctas {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px;
}
.btn-hero {
  display: flex; align-items: center; gap: 8px; padding: 14px 28px; font-size: 1rem; font-weight: 700;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.btn-hero::before {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.2);
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.btn-hero:hover::before { transform: translateX(0); }
.btn-arrow { display: inline-block; transition: transform 0.3s ease; }
.btn-hero:hover .btn-arrow { transform: translateX(4px); }

.hero-quick-stats {
  display: flex; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2);
}
.quick-stat { display: flex; flex-direction: column; gap: 2px; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: white; font-family: var(--font-display); }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Light mode: hero text goes dark since gradient is behind page bg ── */
[data-theme="light"] .hero-badge {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.15);
  color: #1A1A1A;
}
[data-theme="light"] .hero-title { color: #1A1A1A; }
[data-theme="light"] .hero-subtitle { color: rgba(0,0,0,0.7); }
[data-theme="light"] .stat-number { color: var(--primary); }
[data-theme="light"] .stat-label { color: rgba(0,0,0,0.55); }
[data-theme="light"] .hero-quick-stats { border-top-color: rgba(0,0,0,0.12); }
[data-theme="light"] .btn-hero.btn-outline {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}
[data-theme="light"] .text-gradient {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-visual { display: flex; align-items: center; justify-content: center; }
.market-preview-wrap {
  position: relative; width: 100%; max-width: 450px;
}
.market-preview-glow {
  position: absolute; inset: -20px; background: radial-gradient(circle, rgba(255,159,94,0.3), transparent);
  border-radius: 50%; animation: float 4s ease-in-out infinite;
  pointer-events: none; /* don't let the glow extend scroll area */
  overflow: hidden;
}
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-20px); } }

.market-preview {
  position: relative; z-index: 1; background: white; border-radius: 16px; padding: 16px; gap: 12px;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.6);
}
[data-theme="dark"] .market-preview { background: #1e1e1e; border-color: rgba(232,93,38,0.2); }

.market-preview .mini-card {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px;
  background: var(--bg); transition: all 0.3s ease; cursor: pointer; border: 1px solid var(--border);
}
.market-preview .mini-card:hover { transform: translateX(4px); background: var(--primary-pale); }
.market-preview .mini-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.market-preview .mini-card > div:last-child { flex: 1; }

/* Trust Banner */
.trust-banner {
  background: white; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
[data-theme="dark"] .trust-banner { background: #1e1e1e; }
.trust-banner .container { display: flex; align-items: center; justify-content: space-around; gap: 20px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-icon { font-size: 1.5rem; }
.trust-text { font-size: 0.9rem; line-height: 1.4; }
.trust-text strong { display: block; color: var(--primary); font-weight: 700; }
.trust-divider { width: 1px; height: 30px; background: var(--border); }

/* How Section */
.how-section { padding: 80px 0; background: var(--bg); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 8px; }
.section-header p { color: var(--primary); font-size: 1.1rem; font-weight: 700; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 24px; }
.how-card {
  background: white; border-radius: 16px; padding: 32px 24px; box-shadow: var(--card-shadow);
  text-align: center; position: relative; transition: all 0.3s ease; border: 1px solid transparent;
}
[data-theme="dark"] .how-card { background: #1e1e1e; }
.how-card:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(232,93,38,0.15); border-color: var(--primary-pale); }
.how-card-number {
  position: absolute; top: -14px; left: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: white; font-weight: 800; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
}
.how-icon { font-size: 2.5rem; margin: 12px 0 16px; }
.how-card h4 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text); }
.how-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.6; }
.how-feature {
  font-size: 0.8rem; color: var(--success); font-weight: 600; padding-top: 12px; border-top: 1px solid var(--border);
}

/* Categories Section */
.categories-section { padding: 60px 0; background: white; }
[data-theme="dark"] .categories-section { background: #1e1e1e; }
.categories-section h2 { text-align: center; margin-bottom: 40px; font-size: 2rem; }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.category-tile {
  padding: 18px 12px; border-radius: 12px; text-align: center;
  background: var(--bg); border: 2px solid var(--border); cursor: pointer;
  transition: all 0.3s ease; font-weight: 600; font-size: 0.95rem;
}
.category-tile:hover { border-color: var(--primary); background: var(--primary-pale); color: var(--primary); transform: scale(1.05); }

/* ── About Section ───────────────────────────────────────── */
.about-section {
  padding: 80px 0;
  background: white;
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .about-section { background: #1a1a1a; }

/* Decorative background accent — clipped so they never cause horizontal scroll */
.about-section::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,93,38,0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  max-width: 60vw; /* never wider than viewport */
}
.about-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(232,93,38,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  max-width: 60vw;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.section-tag {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.about-copy h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin-bottom: 16px;
  line-height: 1.15;
}

.about-lead {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.7;
}

.about-copy p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}

.about-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.about-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.about-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.value-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.value-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(232,93,38,0.04) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.value-card:hover::before { transform: translateX(100%); }
.value-card:hover {
  border-left-color: var(--primary);
  box-shadow: 0 8px 32px rgba(232,93,38,0.12);
  transform: translateX(6px);
  background: white;
}
[data-theme="dark"] .value-card:hover { background: #242424; }

.value-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease;
}
.value-card:hover .value-icon {
  transform: scale(1.18) rotate(-4deg);
  background: var(--primary);
}

.value-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}
.value-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.about-stat {
  position: relative;
}
.about-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}
.about-stat:hover strong { transform: scale(1.08); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 480px) {
  .about-section { padding: 48px 0; }
  .about-stats { gap: 20px; }
  .about-stat strong { font-size: 1.3rem; }
}

/* Why MCM Section */
.why-section { padding: 80px 0; background: var(--bg); }
.why-section .section-header { text-align: center; margin-bottom: 48px; }
.why-section h2 { text-align: center; margin-bottom: 8px; font-size: 2.2rem; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 28px; }
.why-card {
  background: white; border-radius: 16px; padding: 32px 24px; box-shadow: var(--card-shadow);
  text-align: center; transition: all 0.3s ease;
}
[data-theme="dark"] .why-card { background: #1e1e1e; }
.why-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(232,93,38,0.15); }
.why-icon { font-size: 2.8rem; margin-bottom: 16px; }
.why-card h4 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.why-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* Final CTA Section */
.final-cta-section {
  padding: 100px 0;
  background: #111;
  border-top: none;
}
[data-theme="light"] .final-cta-section { background: #1a1a1a; }
.final-cta-inner { text-align: center; }
.final-cta-inner h2 {
  color: #ffffff;
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.final-cta-inner > p {
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  margin-bottom: 32px;
}
.final-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-xl { padding: 16px 36px; font-size: 1.05rem; }
/* Outline button on dark CTA background */
.final-cta-section .btn-outline {
  border-color: rgba(255,255,255,0.3) !important;
  color: rgba(255,255,255,0.85) !important;
  background: rgba(255,255,255,0.06) !important;
}
.final-cta-section .btn-outline:hover {
  border-color: rgba(255,255,255,0.6) !important;
  background: rgba(255,255,255,0.12) !important;
}

/* Footer */
footer.site-footer {
  margin-top: 0;
  padding: 60px 0 0;
  background: #111;
  color: #ccc;
}
[data-theme="light"] footer.site-footer { background: #1a1a1a; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
}

.footer-brand-col .footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 900;
  font-size: 1.2rem; color: white; margin-bottom: 14px;
}
.footer-brand-col .footer-brand .brand-icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}
.footer-tagline {
  font-size: 0.875rem; color: #888; line-height: 1.7;
  max-width: 260px; margin: 0;
}

.footer-heading {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #fff; margin-bottom: 16px;
  font-family: var(--font-body);
}

.footer-list {
  display: flex; flex-direction: column; gap: 10px;
}
.footer-list li { list-style: none; }
.footer-list a, .footer-list span {
  font-size: 0.875rem; color: #888;
  transition: color 0.2s; cursor: pointer;
}
.footer-list a:hover { color: var(--primary); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; font-size: 0.8rem; color: #555; flex-wrap: wrap; gap: 12px;
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: #555; transition: color 0.2s; }
.footer-bottom-links a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  footer.site-footer { padding: 40px 0 0; }
}

/* Global improvements */
.container { max-width: 1200px; }
.hero { padding: 60px 0; border-radius: 12px; margin-top: var(--nav-height); }
.filters-bar { padding: 12px 16px; }
.listing-card { border-radius: 12px; overflow: hidden; }

/* Detail modal responsive grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .listing-detail-images {
    aspect-ratio: 4/3 !important;
    max-height: 260px;
  }
  .modal-body {
    overflow-x: hidden !important;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .landing-hero { grid-template-columns: 1fr; gap: 32px; }
  .market-preview-wrap { max-width: 380px; }
  .nav-search input { width: 180px; }
  .nav-search input:focus { width: 200px; }
}
@media (max-width: 768px) {
  .landing-hero-wrap { padding: 40px 0 60px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .landing-ctas { flex-direction: column; }
  .btn-hero { width: 100%; justify-content: center; }
  .trust-banner .container { flex-direction: column; }
  .trust-divider { width: 100%; height: 1px; }
}
@media (max-width: 480px) {
  .landing-hero-wrap { padding: 30px 0 40px; }
  .hero-badge { display: none; }
  .hero-title { font-size: 1.6rem; }
  .hero-quick-stats { flex-direction: column; gap: 12px; }
  .section-header { margin-bottom: 32px; }
  .section-header h2 { font-size: 1.4rem; }
  .how-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-tile { font-size: 0.8rem; padding: 12px 8px; }
  .why-card { padding: 20px 16px; }
  .final-cta-section { padding: 60px 0; }
  .final-cta-inner h2 { font-size: 1.6rem; }
  .final-ctas { flex-direction: column; }
  .btn-xl { width: 100%; }
}

/* ── Dark Theme ──────────────────────────────────────────── */
[data-theme="dark"] {
  --white: #1e1e1e;
  --bg: #121212;
  --text: #f0f0f0;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --border: #2a2a2a;
  --border-dark: #3a3a3a;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 4px 12px rgba(232,93,38,0.2), 0 8px 32px rgba(0,0,0,0.4);
  --primary-pale: rgba(232,93,38,0.12);
}

[data-theme="dark"] .navbar { background: #1e1e1e; border-bottom-color: #2a2a2a; }
[data-theme="dark"] .nav-search input { background: #2a2a2a; color: #f0f0f0; border-color: #3a3a3a; }
[data-theme="dark"] .nav-search input:focus { background: #2a2a2a; }
[data-theme="dark"] .card { background: #1e1e1e; color: #f0f0f0; }
[data-theme="dark"] .card-body { color: #f0f0f0; }
[data-theme="dark"] .modal { background: #1e1e1e; }
[data-theme="dark"] .modal-header { background: #1e1e1e; color: #f0f0f0; }
[data-theme="dark"] .modal-body { color: #f0f0f0; }
[data-theme="dark"] .form-control { background: #2a2a2a; border-color: #3a3a3a; color: #f0f0f0; }
[data-theme="dark"] .form-control:focus { background: #2a2a2a; }
[data-theme="dark"] .form-control::placeholder { color: #555; }
[data-theme="dark"] .dropdown-menu { background: #1e1e1e; border-color: #2a2a2a; }
[data-theme="dark"] .dropdown-item { color: #f0f0f0; }
[data-theme="dark"] .dropdown-item:hover { background: #2a2a2a; }
[data-theme="dark"] .filters-bar { background: #1e1e1e; }
[data-theme="dark"] .filter-chip { background: #2a2a2a; border-color: #3a3a3a; color: #9ca3af; }
[data-theme="dark"] .filter-select { background: #2a2a2a; border-color: #3a3a3a; color: #f0f0f0; }
[data-theme="dark"] .toast { background: #1e1e1e; color: #f0f0f0; }
[data-theme="dark"] .stat-card { background: #1e1e1e; }
[data-theme="dark"] .table-container { background: #1e1e1e; }
[data-theme="dark"] .data-table th { background: #2a2a2a; color: #9ca3af; }
[data-theme="dark"] .data-table td { color: #f0f0f0; }
[data-theme="dark"] .data-table tr:hover td { background: rgba(232,93,38,0.08); }
[data-theme="dark"] .chat-container { background: #1e1e1e; }
[data-theme="dark"] .chat-sidebar { border-right-color: #2a2a2a; background: #1e1e1e; }
[data-theme="dark"] .chat-sidebar-header { color: #f0f0f0; }
[data-theme="dark"] .chat-item-name { color: #f0f0f0; }
[data-theme="dark"] .chat-item:hover, [data-theme="dark"] .chat-item.active { background: rgba(232,93,38,0.1); }
[data-theme="dark"] .theirs .chat-bubble { background: #2a2a2a; color: #f0f0f0; }
[data-theme="dark"] .chat-input-area input { background: #2a2a2a; border-color: #3a3a3a; color: #f0f0f0; }
[data-theme="dark"] .chat-main { background: #1e1e1e; }
[data-theme="dark"] .upload-area { background: #2a2a2a; border-color: #3a3a3a; }
[data-theme="dark"] .profile-header { background: #1e1e1e; }
[data-theme="dark"] .profile-tabs { background: #1e1e1e; }
[data-theme="dark"] .admin-sidebar { background: #1e1e1e; }
[data-theme="dark"] #mobileNavDrawer > div { background: #1e1e1e !important; }
[data-theme="dark"] #mobileNavDrawer .nav-link { color: #f0f0f0; }
[data-theme="dark"] .auth-form-side { background: #1e1e1e; color: #f0f0f0; }
[data-theme="dark"] .auth-form-side h2 { color: #f0f0f0; }
[data-theme="dark"] .listing-card-body { background: #1e1e1e; }
[data-theme="dark"] .listing-title { color: #f0f0f0; }
[data-theme="dark"] .admin-content h2, [data-theme="dark"] .admin-content h3 { color: #f0f0f0; }

/* Light Mode — explicit variable overrides (light is the base, but we ensure clarity) */
[data-theme="light"] {
  --white: #FFFFFF;
  --bg: #F8F7F5;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-dark: #D1D5DB;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.06);
  --primary-pale: #FEF0EA;
}

/* Light mode — elements that need explicit dark text */
[data-theme="light"] .navbar { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .card { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .modal { background: #FFFFFF; }
[data-theme="light"] .modal-header { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .modal-body { color: var(--text); }
[data-theme="light"] .filters-bar { background: #FFFFFF; }
[data-theme="light"] .filter-chip { background: #FFFFFF; color: var(--text-muted); }
[data-theme="light"] .filter-select { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .dropdown-menu { background: #FFFFFF; }
[data-theme="light"] .dropdown-item { color: var(--text); }
[data-theme="light"] .chat-container { background: #FFFFFF; }
[data-theme="light"] .chat-sidebar-header { color: var(--text); }
[data-theme="light"] .chat-item-name { color: var(--text); }
[data-theme="light"] .chat-input-area input { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .theirs .chat-bubble { background: var(--bg); color: var(--text); }
[data-theme="light"] .profile-header { background: #FFFFFF; }
[data-theme="light"] .profile-tabs { background: #FFFFFF; }
[data-theme="light"] .admin-sidebar { background: #FFFFFF; }
[data-theme="light"] .stat-card { background: #FFFFFF; }
[data-theme="light"] .table-container { background: #FFFFFF; }
[data-theme="light"] .data-table td { color: var(--text); }
[data-theme="light"] .toast { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .form-control { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .auth-form-side { background: #FFFFFF; color: var(--text); }
[data-theme="light"] .auth-form-side h2 { color: var(--text); }
[data-theme="light"] #mobileNavDrawer > div { background: #FFFFFF !important; }
[data-theme="light"] #mobileNavDrawer .nav-link { color: var(--text); }

/* Landing hero — text goes dark in light mode since gradient sits behind page background */

/* Theme toggle button */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--primary); background: var(--primary-pale); }

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* prevent any element from causing horizontal scroll */
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden; /* belt-and-suspenders: block horizontal scroll on body too */
  width: 100%;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); font-weight: 800; }
h3 { font-size: clamp(1.1rem, 2vw, 1.375rem); font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 700; }
p { color: var(--text-muted); font-family: var(--font-body); }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
/* Inner pages: content starts below fixed navbar */
.page-content { padding-top: calc(var(--nav-height) + 24px); padding-bottom: 48px; }
/* index.html: hero already clears the navbar, page-content follows hero */
.hero + .page-content { padding-top: 24px; }

/* ── Navigation ──────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.nav-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.nav-brand span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-pale);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search input {
  width: 220px;
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.875rem;
  background: var(--bg);
  transition: all var(--transition);
  outline: none;
}
.nav-search input:focus { border-color: var(--primary); background: white; width: 260px; }
.nav-search .search-icon {
  position: absolute; left: 12px;
  color: var(--text-muted); font-size: 15px; pointer-events: none;
}
.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  overflow: hidden;
}
.nav-avatar:hover { border-color: var(--primary); transform: scale(1.05); }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-hover);
  min-width: 200px; z-index: 999;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: all var(--transition);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 0.9rem; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.nav-mobile-toggle {
  display: none;
  flex-direction: column; gap: 6px;
  padding: 8px;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  background: transparent;
  border: 2px solid transparent;
}
.nav-mobile-toggle:active { background: var(--primary-pale); }
.nav-mobile-toggle span {
  display: block; width: 24px; height: 2.5px;
  background: var(--text); border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.nav-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(11px);
}
.nav-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-11px);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer; border: none;
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 2px 8px rgba(232,93,38,0.3);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(232,93,38,0.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-pale); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 16px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Listing Cards ───────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}
.listing-card {
  cursor: pointer;
  transform: translateY(0);
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.listing-card:hover { transform: translateY(-4px); }
.listing-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg);
}
.listing-card-img img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.4s ease;
  background: var(--bg);
}
.listing-card:hover .listing-card-img img { transform: scale(1.05); }
.listing-card-img .no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; background: var(--primary-pale); color: var(--primary);
}
.listing-badge { position: absolute; top: 10px; left: 10px; background: white; color: var(--text); padding: 4px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.listing-badge.new { background: var(--primary); color: white; }
.listing-badge.boosted { background: linear-gradient(135deg, #F59E0B, #EF4444); color: white; box-shadow: 0 2px 12px rgba(245,158,11,0.4); }

/* Featured listing card highlight */
.listing-card-featured {
  border: 1.5px solid rgba(245,158,11,0.35) !important;
  box-shadow: 0 4px 20px rgba(245,158,11,0.12), var(--card-shadow) !important;
}
.listing-card-featured:hover {
  box-shadow: 0 8px 32px rgba(245,158,11,0.2), var(--card-shadow-hover) !important;
}

/* Boost badges */
.listing-badge.boosted { background: linear-gradient(135deg, #F59E0B, #EF4444); color: white; box-shadow: 0 2px 12px rgba(245,158,11,0.4); }
.listing-badge.boosted-basic { background: linear-gradient(135deg, #EF4444, #DC2626); color: white; box-shadow: 0 2px 12px rgba(239,68,68,0.4); }

/* Boost plan selector in modal */
.boost-plan {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px; border-radius: var(--radius);
  border: 2px solid var(--border); cursor: pointer;
  transition: all 0.2s; margin-bottom: 12px;
  background: var(--bg);
}
.boost-plan:hover { border-color: var(--primary); }
.boost-plan.selected { border-color: var(--primary); background: var(--primary-pale); }
.boost-plan-premium { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.04); }
.boost-plan-premium:hover, .boost-plan-premium.selected { border-color: #F59E0B; background: rgba(245,158,11,0.1); }
.boost-plan-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.boost-plan-icon { font-size: 1.6rem; flex-shrink: 0; }
.boost-plan-name { font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 2px; }
.boost-plan-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.boost-plan-price { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; color: var(--primary); white-space: nowrap; }
.boost-plan-premium .boost-plan-price { color: #D97706; }
.boost-plan-badge {
  position: absolute; top: -10px; right: 12px;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: white; font-size: 0.65rem; font-weight: 800;
  padding: 2px 8px; border-radius: 50px;
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* Boost button */
.btn-boost {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-boost:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.4); }

/* Boost active bar */
.boost-active-bar {
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(239,68,68,0.08));
  border: 1px solid rgba(245,158,11,0.3);
  font-size: 0.78rem;
  font-weight: 600;
  color: #D97706;
  text-align: center;
}
.listing-card-body { padding: 14px 16px 16px; }
.listing-category {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.73rem; font-weight: 600; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.listing-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1rem; letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 8px;
}
.listing-price {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 800;
  color: var(--primary);
}
.listing-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
}
.listing-seller {
  display: flex; align-items: center; gap: 6px;
}
.seller-avatar-sm {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.listing-wishlist {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: white; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-size: 16px; cursor: pointer;
  transition: all var(--transition);
}
.listing-wishlist:hover { transform: scale(1.15); }
.listing-wishlist.active { background: #FEE2E2; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.875rem; font-weight: 700;
  color: var(--text);
  font-family: var(--font-body);
}
.form-label span { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text);
  background: white; outline: none;
  transition: all var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,93,38,0.1); }
.form-control:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }
.input-group { position: relative; }
.input-prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem; pointer-events: none;
}
.input-group .form-control { padding-left: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  overflow-x: hidden;
}
.auth-brand {
  flex: 1;
  background: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px;
  position: relative; overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 40px);
}
.auth-brand-content { position: relative; z-index: 1; color: white; text-align: center; }
.auth-brand-logo {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 24px;
  backdrop-filter: blur(8px);
}
.auth-brand h1 { color: white; font-size: 2rem; margin-bottom: 12px; }
.auth-brand p { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 360px; }
.auth-features { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.1); border-radius: var(--radius);
  padding: 14px 18px; text-align: left;
}
.auth-feature-icon { font-size: 1.5rem; flex-shrink: 0; }
.auth-feature-text strong { display: block; color: white; font-size: 0.9rem; margin-bottom: 2px; }
.auth-feature-text span { color: rgba(255,255,255,0.7); font-size: 0.8rem; }
.auth-form-side {
  width: 480px; max-width: 100vw;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 48px; background: white;
  overflow-y: auto;
  overflow-x: hidden;
}
.auth-logo-sm {
  display: none;
  align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  margin-bottom: 32px;
}
.auth-logo-sm .brand-icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.auth-form-side h2 { margin-bottom: 6px; }
.auth-form-side p { margin-bottom: 28px; }
.auth-switch {
  text-align: center; margin-top: 24px;
  font-size: 0.875rem; color: var(--text-muted);
}
.auth-switch a { color: var(--primary); font-weight: 600; }

/* ── Hero / Banners ──────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #F5A05A 100%);
  padding: 48px 0; color: white; position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 50px);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { color: white; margin-bottom: 12px; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; margin-bottom: 24px; }
.hero-search {
  display: flex; gap: 10px; max-width: 560px; flex-wrap: wrap;
}
.hero-search input {
  flex: 1; min-width: 0; padding: 14px 20px;
  border: none; border-radius: var(--radius);
  font-size: 0.95rem; outline: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hero-stats {
  display: flex; gap: 32px; margin-top: 32px;
}
.hero-stat strong {
  display: block; font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 800; color: white;
}
.hero-stat span { font-size: 0.85rem; color: rgba(255,255,255,0.75); }

/* ── Filters Bar ─────────────────────────────────────────── */
.filters-bar {
  background: white; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  width: 100%; /* never wider than its container */
  min-width: 0;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  padding: 6px 14px; border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
  background: white; color: var(--text-muted);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: white; }
.filter-select {
  padding: 8px 32px 8px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text);
  background: white; cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  max-width: 100%; /* never overflow its container */
}
.filter-select:focus { border-color: var(--primary); }
.filters-bar .filter-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
/* The sort/price row — always wraps, never pushes right */
.filters-bar > div[style*="margin-left:auto"] {
  margin-left: auto;
  flex-wrap: wrap;
}

/* ── Profile ─────────────────────────────────────────────── */
.profile-header {
  background: white; border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--card-shadow);
  display: flex; gap: 24px; align-items: flex-start;
  margin-bottom: 24px;
}

/* Profile tabs */
.profile-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: white; padding: 6px; border-radius: var(--radius);
  box-shadow: var(--card-shadow); overflow-x: auto;
}
.profile-tab {
  flex: 1; min-width: 80px;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 18px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--text-muted);
  transition: all var(--transition); white-space: nowrap;
}
.profile-tab:hover { color: var(--primary); background: var(--primary-pale); }
.profile-tab.active { background: var(--primary); color: white; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--primary); color: white;
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  border: 3px solid var(--primary-pale);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h2 { margin-bottom: 4px; font-weight: 800; letter-spacing: -0.01em; }
.profile-info .matric { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.profile-stats { display: flex; gap: 24px; }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--text); }
.profile-stat span { font-size: 0.78rem; color: var(--text-muted); }
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 50px;
  font-size: 0.78rem; font-weight: 600;
  background: #ECFDF5; color: var(--success);
  border: 1px solid #A7F3D0;
}
.trust-badge.unverified { background: #FEF3C7; color: #D97706; border-color: #FCD34D; }

/* ── Stars ───────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; }
.star { font-size: 18px; color: var(--border-dark); transition: color var(--transition); }
.star.filled { color: #F59E0B; }
.stars-sm .star { font-size: 13px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
  overflow-y: auto;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(16px);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-family: var(--font-display); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-lg { max-width: min(780px, 96vw); }

/* ── Listing Detail ──────────────────────────────────────── */
.listing-detail-images {
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; aspect-ratio: 16/10;
  background: var(--bg); margin-bottom: 20px;
}
.listing-detail-images img {
  width: 100%; height: 100%; object-fit: contain;
  background: var(--bg);
}
.image-thumbnails {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.image-thumb {
  width: 72px; height: 72px; border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; border: 2px solid transparent;
  transition: border-color var(--transition);
}
.image-thumb.active { border-color: var(--primary); }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Image Upload ────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 32px; text-align: center;
  cursor: pointer; transition: all var(--transition);
  background: var(--bg);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary); background: var(--primary-pale);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-area p { font-size: 0.9rem; margin-bottom: 4px; }
.upload-area small { font-size: 0.78rem; color: var(--text-light); }
.upload-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.upload-preview-item {
  position: relative; width: 88px; height: 88px;
  border-radius: var(--radius-sm); overflow: hidden;
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer;
}

/* ── Toasts ──────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 12px; right: 12px; left: 12px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
@media (max-width: 768px) {
  #toast-container { bottom: 12px; right: 12px; left: 12px; }
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  background: white; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  font-size: 0.875rem; font-weight: 500;
  transform: translateX(120%); transition: transform 0.3s ease;
  min-width: auto; max-width: 100%; word-break: break-word;
  border-left: 4px solid var(--primary);
}
.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--primary); color: white;
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-info .toast-icon { background: var(--info); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
}
.badge-primary { background: var(--primary-pale); color: var(--primary); }
.badge-success { background: #ECFDF5; color: var(--success); }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: var(--danger); }

/* ── Chat ────────────────────────────────────────────────── */
.chat-container {
  display: flex; height: calc(100vh - var(--nav-height) - 48px);
  background: white; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--card-shadow);
  min-width: 0; /* prevent flex children from overflowing */
}.chat-sidebar {
  width: 320px; max-width: 100%; flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-width: 0;
}
.chat-sidebar-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.chat-item:hover, .chat-item.active { background: var(--primary-pale); }
.chat-item-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; overflow: hidden;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 600; font-size: 0.9rem; }
.chat-item-preview {
  font-size: 0.8rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item-time { font-size: 0.72rem; color: var(--text-light); }
.chat-item-badge {
  min-width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.chat-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.chat-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-message { max-width: 68%; }
.chat-message.mine { align-self: flex-end; }
.chat-message.theirs { align-self: flex-start; }
.chat-bubble {
  padding: 10px 14px; border-radius: 12px;
  font-size: 0.875rem; line-height: 1.5;
  word-break: break-word; overflow-wrap: anywhere;
}
.mine .chat-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.theirs .chat-bubble { background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-time { font-size: 0.7rem; color: var(--text-light); margin-top: 4px; text-align: right; }
.theirs .chat-time { text-align: left; }
.chat-input-area {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.chat-input-area input {
  flex: 1; padding: 10px 16px;
  border: 1.5px solid var(--border); border-radius: 50px;
  outline: none; font-size: 0.9rem;
  transition: border-color var(--transition);
}
.chat-input-area input:focus { border-color: var(--primary); }
.chat-no-select {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; color: var(--text-muted);
}
.chat-no-select .chat-no-icon { font-size: 3rem; }

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-layout { display: flex; gap: 24px; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 20px; height: fit-content;
  position: sticky; top: calc(var(--nav-height) + 24px);
}
.admin-sidebar h4 { margin-bottom: 16px; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  color: var(--text-muted); transition: all var(--transition);
  margin-bottom: 2px;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: var(--primary-pale); color: var(--primary);
}
.admin-content { flex: 1; min-width: 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 20px; box-shadow: var(--card-shadow);
}
.stat-card .stat-number {
  font-family: var(--font-display); font-size: 2rem; font-weight: 900;
  color: var(--text); line-height: 1; letter-spacing: -0.02em;
}
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.stat-card .stat-icon { font-size: 2rem; margin-bottom: 10px; }

/* ── Table ───────────────────────────────────────────────── */
.table-container {
  background: white; border-radius: var(--radius);
  box-shadow: var(--card-shadow); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px; text-align: left;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--primary-pale); }

/* ── Loading ─────────────────────────────────────────────── */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 16px;
  color: var(--text-muted);
}
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 12px;
  color: var(--text-muted); text-align: center;
}
.empty-state .empty-icon { font-size: 4rem; }
.empty-state h3 { font-family: var(--font-display); color: var(--text); }

/* ── Animations ──────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0px); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-card { height: 320px; border-radius: var(--radius); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-brand { display: none; }
  .auth-form-side { width: 100%; padding: 40px 32px; }
  .auth-logo-sm { display: flex; }
  .chat-sidebar { width: 280px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; position: static; }
  .admin-sidebar { display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-sidebar h4 { width: 100%; }
  .admin-nav-item { flex: 1; justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav-search { display: none; }
  .nav-avatar { width: 40px; height: 40px; font-size: 0.75rem; }
  .container { padding: 0 16px; }
  
  .landing-hero-wrap { padding: 40px 0 60px; }
  .hero-title { font-size: 1.8rem; line-height: 1.15; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 20px; }
  .landing-ctas { flex-direction: column; gap: 10px; }
  .btn-hero { width: 100%; padding: 12px 20px; font-size: 0.95rem; }
  .hero-quick-stats { flex-direction: column; gap: 10px; border-top: none; padding-top: 0; }
  
  .market-preview { max-width: 100%; }
  .market-preview-wrap { max-width: 100%; }
  
  .section-header { margin-bottom: 32px; }
  .section-header h2 { font-size: 1.5rem; }
  .section-header p { font-size: 0.95rem; }
  
  .how-grid { grid-template-columns: 1fr; gap: 16px; }
  .how-card { padding: 24px 18px; }
  .how-card-number { top: -12px; left: 16px; width: 36px; height: 36px; font-size: 1rem; }
  
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-tile { font-size: 0.75rem; padding: 12px 8px; }
  
  .why-grid { grid-template-columns: 1fr; }
  .why-card { padding: 20px 16px; }
  .why-icon { font-size: 2.2rem; }
  
  .trust-banner .container { flex-direction: column; gap: 12px; }
  .trust-divider { width: 100%; height: 1px; margin: 8px 0; }
  .trust-item { justify-content: center; }
  .trust-text { text-align: center; }
  
  .profile-header { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
  .profile-stats { justify-content: center; }
  .chat-sidebar { display: none; }
  .chat-sidebar.visible { display: flex; }
  
  .filters-bar { flex-direction: column; gap: 8px; }
  .filter-chips { flex-wrap: wrap; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  
  .final-cta-section { padding: 60px 0; }
  .final-cta-inner h2 { font-size: 1.5rem; }
  .final-cta-inner p { font-size: 0.95rem; margin-bottom: 20px; }
  .final-ctas { flex-direction: column; gap: 10px; }
  .btn-xl { width: 100%; padding: 12px 20px; font-size: 0.95rem; }
  
  .modal { max-width: 90vw; }
  .modal-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .navbar-inner { gap: 8px; padding: 0 12px; }
  .nav-brand { font-size: 1.1rem; gap: 6px; }
  .nav-brand .brand-icon { width: 32px; height: 32px; font-size: 16px; }
  .btn-sm { padding: 6px 12px; font-size: 0.75rem; }
  
  .landing-hero-wrap { padding: 24px 0 36px; }
  .hero-badge { display: none; }
  .hero-title { font-size: 1.5rem; line-height: 1.2; }
  .hero-subtitle { font-size: 0.9rem; }
  .landing-ctas { flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .btn-hero { padding: 12px 16px; font-size: 0.9rem; }
  .btn-arrow { font-size: 0.8rem; }
  .hero-quick-stats { padding-top: 16px; }
  .quick-stat { gap: 0; }
  .stat-number { font-size: 1.2rem; }
  .stat-label { font-size: 0.7rem; }
  
  .section-header h2 { font-size: 1.3rem; }
  .section-header p { font-size: 0.85rem; }
  .how-grid { gap: 12px; }
  .how-card { padding: 20px 14px; }
  .how-card h4 { font-size: 1rem; }
  .how-card p { font-size: 0.8rem; }
  .how-icon { font-size: 2rem; }
  .how-feature { font-size: 0.7rem; }
  
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .category-tile { font-size: 0.7rem; padding: 10px 6px; }
  
  .why-card { padding: 16px 12px; }
  .why-icon { font-size: 2rem; margin-bottom: 8px; }
  .why-card h4 { font-size: 1rem; }
  .why-card p { font-size: 0.8rem; }
  
  .trust-icon { font-size: 1.2rem; }
  .trust-text { font-size: 0.8rem; }
  .trust-text strong { display: block; }
  
  .final-cta-section { padding: 40px 0; }
  .final-cta-inner h2 { font-size: 1.3rem; margin-bottom: 4px; }
  .final-cta-inner p { font-size: 0.85rem; margin-bottom: 16px; }
  .final-ctas { gap: 8px; }
  .btn-xl { padding: 10px 16px; font-size: 0.9rem; }
  
  footer.site-footer { padding: 32px 0 0; }
  
  .auth-form-side { padding: 24px 16px; }
  .modal-body { padding: 12px; }
  .modal-header { padding: 14px 16px 10px; }
  .modal-close { width: 28px; height: 28px; font-size: 16px; }
  .form-group { margin-bottom: 14px; }
  .form-label { font-size: 0.8rem; }
  .form-control { padding: 10px 12px; font-size: 0.85rem; }
  .upload-area { padding: 20px 12px; }
  .upload-icon { font-size: 2rem; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-20 { padding: 20px; }
.hidden { display: none !important; }
.relative { position: relative; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Scroll Animations ─────────────────────────────────────── */
.scroll-hidden {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  filter: blur(4px);
  will-change: opacity, transform, filter;
}
.scroll-hidden.scroll-from-left {
  transform: translateX(-40px) translateY(10px); /* reduced from -80px to prevent overflow */
  filter: blur(4px);
}
.scroll-hidden.scroll-from-right {
  transform: translateX(40px) translateY(10px); /* reduced from 80px to prevent overflow */
  filter: blur(4px);
}
.scroll-hidden.scroll-pop {
  transform: scale(0.82) translateY(24px); /* less aggressive scale */
  filter: blur(6px);
  transition: opacity 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scroll-hidden.scroll-from-bottom-slow {
  transform: translateY(60px); /* reduced from 80px */
  filter: blur(4px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-hidden.scroll-fade-up {
  transform: translateY(30px); /* reduced from 40px */
  filter: blur(2px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-visible {
  opacity: 1 !important;
  transform: translateY(0) translateX(0) scale(1) !important;
  filter: blur(0px) !important;
}
.how-card.scroll-visible:hover { transform: translateY(-8px) !important; }
.why-card.scroll-visible:hover { transform: translateY(-6px) !important; }
.category-tile.scroll-visible:hover { transform: scale(1.05) !important; }
.value-card.scroll-visible:hover { transform: translateX(4px) !important; }

/* Hide avatar on mobile — hamburger handles nav */
@media (max-width: 768px) {
  #navAvatarWrapper { display: none !important; }
}

/* ── Onboarding Tour ─────────────────────────────────────── */
#tourOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

#tourSpotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px var(--primary),
    0 0 0 9999px rgba(0, 0, 0, 0.65);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 9001;
}

#tourTooltip {
  position: fixed;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 9002;
  animation: tourPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] #tourTooltip {
  background: #1e1e1e;
  color: #f0f0f0;
}

@keyframes tourPop {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Centered variant */
#tourTooltip.tour-tooltip-center {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Anchored variant */
#tourTooltip.tour-tooltip-anchored {
  position: absolute;
}

#tourStep {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

#tourTitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

[data-theme="dark"] #tourTitle { color: #f0f0f0; }

#tourDesc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

#tourFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#tourDots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-dark);
  transition: all 0.2s;
}

.tour-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 4px;
}

#tourActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#tourSkip {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}
#tourSkip:hover { color: var(--text); }

#tourNext {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
#tourNext:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Mobile tour adjustments */
@media (max-width: 480px) {
  #tourTooltip {
    width: calc(100vw - 32px);
    padding: 20px;
    border-radius: 14px;
  }
  #tourTitle { font-size: 1rem; }
  #tourDesc  { font-size: 0.82rem; }
}

/* ── Listing Detail Modal — proper responsive layout ─────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Image column */
.detail-col-image { min-width: 0; }

/* Info column */
.detail-col-info { min-width: 0; display: flex; flex-direction: column; gap: 0; }

.detail-meta-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}

.detail-title {
  font-size: 1.3rem; margin-bottom: 8px;
  word-break: break-word;
}

.detail-price {
  font-size: 1.6rem; font-weight: 800;
  color: var(--primary); font-family: var(--font-display);
  margin-bottom: 16px;
}

.detail-desc {
  margin-bottom: 16px; color: var(--text);
  font-size: 0.9rem; line-height: 1.7;
  word-break: break-word;
}

.detail-info-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 20px; font-size: 0.875rem;
}

.detail-info-item {
  display: flex; gap: 8px; align-items: flex-start;
}

.detail-seller-card {
  background: var(--bg); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}

.detail-seller-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}

.detail-seller-name {
  font-weight: 700; font-family: var(--font-display);
}

.detail-seller-matric {
  font-size: 0.78rem; color: var(--text-muted);
}

.detail-rating-row {
  display: flex; align-items: center; gap: 8px;
}

.detail-rating-text {
  font-size: 0.82rem; color: var(--text-muted);
}

.detail-actions {
  display: flex; flex-direction: column; gap: 10px;
}

.detail-secondary-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.detail-secondary-actions .btn {
  flex: 1; min-width: 80px;
}

.detail-own-actions {
  display: flex; gap: 10px;
}

.detail-own-actions .btn { flex: 1; }

/* ── Mobile: single column, no horizontal scroll ─────────── */
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .listing-detail-images {
    aspect-ratio: 4 / 3 !important;
    max-height: 260px !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    margin-bottom: 0 !important;
  }

  .detail-col-info {
    padding: 16px 0 0;
  }

  .detail-title { font-size: 1.1rem !important; }
  .detail-price { font-size: 1.3rem !important; margin-bottom: 12px !important; }
  .detail-desc  { font-size: 0.85rem !important; margin-bottom: 12px !important; }

  .detail-secondary-actions {
    flex-wrap: wrap;
  }
  .detail-secondary-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  /* Image inside detail — contain not cover */
  .listing-detail-images img {
    object-fit: contain !important;
    background: var(--bg) !important;
  }
}

/* ── Navbar logo ─────────────────────────────────────────── */
.nav-brand img {
  height: 36px;
  width: auto;
  display: block;
  transition: opacity 0.2s;
}
.nav-brand img:hover { opacity: 0.85; }

@media (max-width: 480px) {
  .nav-brand img { height: 28px; }
}

/* ── Condition badges (on listing cards) ─────────────────── */
.listing-condition-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 1;
}
.condition-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  vertical-align: middle;
  margin-left: 4px;
}
.condition-new       { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.condition-used      { background: #FEF3C7; color: #D97706; border: 1px solid #FCD34D; }
.condition-refurbished { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }

/* ── Condition selector buttons (in post form) ───────────── */
.condition-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  color: var(--text-muted);
  user-select: none;
}
.condition-btn:hover { border-color: var(--primary); color: var(--primary); }
.condition-btn.active {
  border-color: var(--primary);
  background: var(--primary-pale);
  color: var(--primary);
}

/* ── Safety tips block in detail modal ───────────────────── */
.detail-safety-tips {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-left: 3px solid #F59E0B;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
[data-theme="dark"] .detail-safety-tips {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.3);
}
.safety-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #D97706;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.safety-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.safety-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  list-style: disc;
}
.safety-list li strong { color: var(--text); }
