/* ═══════════════════════════════════════════════════════════════════════════
   Shshukner Marketplace — modern, futuristic, official.
   Dark base with violet/cyan accents, glassmorphism cards, soft motion.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  /* Base palette */
  --bg:        #0A0B14;
  --bg-elev:   #11121E;
  --card:      #161726;
  --card-2:    #1C1D30;
  --border:    #232442;
  --border-2:  #303155;
  --text:      #EDEEF7;
  --text-sec:  #A8AAC4;
  --text-mut:  #6F7290;

  /* Accents */
  --primary:   #8B5CF6;
  --primary-2: #A78BFA;
  --primary-d: #6D44DC;
  --cyan:      #22D3EE;
  --emerald:   #34D399;
  --amber:     #F59E0B;
  --rose:      #FB7185;
  --indigo:    #6366F1;

  /* Effects */
  --r-sm:      8px;
  --r-md:      14px;
  --r-lg:      20px;
  --r-pill:    999px;
  --shadow-sm: 0 4px 14px -4px rgba(0,0,0,0.45);
  --shadow-md: 0 12px 30px -10px rgba(0,0,0,0.55);
  --shadow-lg: 0 30px 80px -20px rgba(139,92,246,0.32);
  --shadow-glow: 0 0 40px -10px rgba(139,92,246,0.55);
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(1500px 800px at 50% -200px, rgba(139,92,246,0.22), transparent 60%),
    radial-gradient(1100px 700px at 100% 30%, rgba(34,211,238,0.10), transparent 70%),
    radial-gradient(900px 600px at 0% 80%, rgba(168,85,247,0.10), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary-2); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--text); }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ── Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 20, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 900;
  box-shadow: 0 6px 18px -6px var(--primary);
}
.brand-mark svg { width: 18px; height: 18px; stroke: white; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-suffix { color: var(--text-sec); font-weight: 600; }

.topbar-spacer { flex: 1; }

.topbar-search {
  flex: 1.4;
  max-width: 520px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 11px 18px 11px 42px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.topbar-search input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.topbar-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-mut); stroke: currentColor; fill: none; stroke-width: 2; }
.topbar-search input::placeholder { color: var(--text-mut); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}
.btn:hover { border-color: var(--border-2); background: var(--card); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 22px -8px var(--primary);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-color: transparent;
  color: white;
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-sec); }
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
  background: var(--bg-elev);
}
.lang-toggle button {
  padding: 5px 11px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-toggle button.active { background: var(--primary); color: white; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 24px 48px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--text-sec) 110%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary-2) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 17px;
  color: var(--text-sec);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ── Big search hero ──────────────────────────────────────────────────── */
.search-hero {
  max-width: 720px;
  margin: 28px auto 0;
  position: relative;
}
.search-hero input {
  width: 100%;
  padding: 18px 22px 18px 56px;
  border: 1px solid var(--border-2);
  background: var(--bg-elev);
  border-radius: 18px;
  color: var(--text);
  font-size: 16px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-hero input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(139,92,246,0.18);
}
.search-hero svg {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; color: var(--primary-2);
  stroke: currentColor; fill: none; stroke-width: 2;
}

/* ── Sections ─────────────────────────────────────────────────────────── */
section { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
section h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
section h2 .see-all { font-size: 13px; font-weight: 600; color: var(--primary-2); }

/* ── Category grid ────────────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.cat-card {
  position: relative;
  display: block;
  padding: 22px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
  isolation: isolate;
}
.cat-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--cat-color, var(--primary)) 16%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: -1;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--cat-color, var(--primary));
  box-shadow: var(--shadow-md);
}
.cat-card:hover::before { opacity: 1; }
.cat-card .cat-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--cat-color, var(--primary)) 16%, transparent);
  color: var(--cat-color, var(--primary));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.cat-card .cat-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cat-card .cat-title { font-weight: 800; font-size: 15px; margin-bottom: 4px; letter-spacing: -0.005em; }
.cat-card .cat-meta  { color: var(--text-mut); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ── Listing card ─────────────────────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.listing-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
  color: var(--text);
}
.listing-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.listing-card .cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-elev);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.listing-card .cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.listing-card:hover .cover img { transform: scale(1.04); }
.listing-card .cover .photo-count {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 9px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.listing-card .body { padding: 16px 18px; flex: 1; }
.listing-card .cat-pill {
  display: inline-flex;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  color: var(--primary-2);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.listing-card .title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card .desc {
  color: var(--text-sec);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card .meta {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mut);
}
.listing-card .meta .phone { color: var(--primary-2); font-weight: 700; }

/* ── Form (post listing) ──────────────────────────────────────────────── */
.form-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.form-wrap h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.form-wrap .sub { color: var(--text-sec); margin-bottom: 32px; font-size: 15px; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0.2px;
}
.field label .req { color: var(--rose); margin-left: 4px; }
.field label .hint { color: var(--text-mut); font-weight: 500; margin-left: 6px; font-size: 12px; }
.field input[type=text],
.field input[type=tel],
.field input[type=email],
.field input[type=password],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.18s, background 0.18s;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
}
.field .err { color: var(--rose); font-size: 13px; margin-top: 6px; min-height: 1em; }

/* Two-column grid for category selector */
.cat-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.cat-pick button {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-sec);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-pick button:hover { border-color: var(--border-2); color: var(--text); background: var(--card); }
.cat-pick button.active {
  background: color-mix(in srgb, var(--primary) 18%, var(--bg));
  border-color: var(--primary);
  color: white;
}

/* Captcha */
.captcha-row {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--r-md);
}
.captcha-question {
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary-2);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.captcha-row input { flex: 1; max-width: 160px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); }
.captcha-row input:focus { outline: none; border-color: var(--primary); }

/* Submit row */
.submit-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ── Listing detail ───────────────────────────────────────────────────── */
.listing-detail {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.listing-detail .cat-pill { margin-bottom: 16px; }
.listing-detail h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px; line-height: 1.2; }
.listing-detail .meta-row {
  display: flex; gap: 14px; flex-wrap: wrap;
  color: var(--text-mut);
  font-size: 13px;
  margin-bottom: 28px;
}
.listing-detail .meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.listing-detail .desc {
  font-size: 16px;
  color: var(--text-sec);
  line-height: 1.75;
  white-space: pre-wrap;
  margin-bottom: 32px;
}
.contact-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.contact-card .label { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-mut); text-transform: uppercase; margin-bottom: 6px; }
.contact-card .phone { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Banner / preview / states ────────────────────────────────────────── */
.banner {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  background: var(--card);
}
.banner.success { border-color: color-mix(in srgb, var(--emerald) 50%, var(--border)); background: color-mix(in srgb, var(--emerald) 10%, var(--card)); color: var(--emerald); }
.banner.warn    { border-color: color-mix(in srgb, var(--amber) 50%, var(--border));   background: color-mix(in srgb, var(--amber) 10%, var(--card));   color: var(--amber); }
.banner.error   { border-color: color-mix(in srgb, var(--rose) 50%, var(--border));    background: color-mix(in srgb, var(--rose) 10%, var(--card));    color: var(--rose); }
.banner strong { color: var(--text); }

.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-mut);
}

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Filter / browse page ─────────────────────────────────────────────── */
.browse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.sub-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 24px;
}
.sub-pills button {
  padding: 7px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sub-pills button:hover { border-color: var(--border-2); color: var(--text); }
.sub-pills button.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  max-width: 1280px;
  margin: 60px auto 0;
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-mut);
  font-size: 13px;
}
footer a { color: var(--text-sec); margin-right: 16px; }
footer a:hover { color: var(--primary-2); }

/* ── Admin ────────────────────────────────────────────────────────────── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat-card .label { font-size: 12px; color: var(--text-mut); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .value.pending { color: var(--amber); }
.stat-card .value.live { color: var(--emerald); }
.stat-card .value.rejected { color: var(--rose); }

.admin-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.admin-row .actions { display: flex; gap: 8px; }
.admin-row .btn-approve { background: var(--emerald); color: #0A2018; border-color: transparent; }
.admin-row .btn-reject  { background: var(--rose);    color: white; border-color: transparent; }

/* The topbar search icon button — visible on mobile when input is hidden */
.topbar-search-btn {
  width: 38px; height: 38px; padding: 0;
  display: none;
  align-items: center; justify-content: center;
  border-radius: 999px;
}

/* Back-button helper for inner pages */
.back-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-sec);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.18s ease;
}
.back-bar:hover { border-color: var(--border-2); color: var(--text); background: var(--bg-elev); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .topbar-search { display: none; }
  .topbar-search-btn { display: inline-flex; }
  .topbar-post-btn span { display: none; }
  .topbar-post-btn { padding: 10px 12px; }
  .topbar-inner { padding: 12px 16px; gap: 10px; }
  .hero { padding: 56px 18px 32px; }
  section { padding: 24px 18px; }
  .form-wrap, .listing-detail { padding: 24px 18px 60px; }
  .listing-detail h1 { font-size: 24px; }
  .contact-card { flex-direction: column; align-items: flex-start; }
  .contact-card .btn { width: 100%; justify-content: center; }
}
