/* =============================================
   STUDENT MARKET PALACE — DARK THEME
   Complete stylesheet for all pages
============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --bg:           #0d0d14;
  --bg2:          #12121f;
  --bg3:          #1a1a2e;
  --bg4:          #1e1e35;
  --surface:      #16162a;
  --surface2:     #1d1d35;
  --border:       rgba(139,92,246,0.15);
  --border2:      rgba(139,92,246,0.3);
  --purple:       #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark:  #6d28d9;
  --purple-dim:   rgba(139,92,246,0.12);
  --pink:         #ec4899;
  --cyan:         #06b6d4;
  --green:        #10b981;
  --amber:        #f59e0b;
  --red:          #ef4444;
  --text:         #f1f0ff;
  --text2:        #a09dc0;
  --text3:        #6b6890;
  --white:        #ffffff;
  --radius:       12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --shadow:       0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.6);
  --glow:         0 0 30px rgba(139,92,246,0.25);
  --glow-lg:      0 0 60px rgba(139,92,246,0.35);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Animated background watermark */
body::before {
  content: 'SMP';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40vw;
  font-weight: 900;
  color: rgba(139,92,246,0.025);
  pointer-events: none;
  z-index: 0;
  letter-spacing: -10px;
  user-select: none;
  animation: wmPulse 8s ease-in-out infinite;
}
@keyframes wmPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.04); }
}

a { text-decoration: none; color: var(--purple-light); }
a:hover { color: var(--purple); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 3px; }

/* ===========================================
   NAVBAR
=========================================== */
.navbar {
  background: rgba(13,13,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  /* Glow animation */
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, #ec4899, #8b5cf6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: brandGlow 4s linear infinite;
  transition: filter 0.3s;
}
.nav-brand:hover { filter: brightness(1.2); }
@keyframes brandGlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text2);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--purple-dim); }
.nav-links a.active { color: var(--purple-light); background: var(--purple-dim); }
.btn-nav {
  background: var(--purple) !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.btn-nav:hover { background: var(--purple-dark) !important; box-shadow: var(--glow); }
.btn-nav-sell {
  background: linear-gradient(135deg, var(--green), #059669) !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.btn-nav-sell:hover { filter: brightness(1.15); }
.btn-logout { color: var(--red) !important; }
.btn-logout:hover { background: rgba(239,68,68,0.12) !important; }

/* ===========================================
   SHARED FOOTER
=========================================== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 56px 24px 32px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.footer-desc { color: var(--text3); font-size: 0.88rem; line-height: 1.7; margin-bottom: 20px; max-width: 300px; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-contact a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-contact a:hover { color: var(--purple-light); }
.footer-contact .icon { font-size: 1rem; }
.footer-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text2); font-size: 0.88rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--purple-light); }
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.social-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text2);
  transition: all 0.2s;
  text-decoration: none;
}
.social-btn:hover { background: var(--purple-dim); border-color: var(--border2); color: var(--purple-light); transform: translateY(-2px); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { color: var(--text3); font-size: 0.82rem; }
.footer-bottom a { color: var(--text3); font-size: 0.82rem; }
.footer-bottom a:hover { color: var(--purple-light); }

/* ===========================================
   SAFETY TIPS BANNER
=========================================== */
.tips-banner {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 44px 24px 36px;
  position: relative;
  z-index: 1;
}
.tips-banner-inner { max-width: 1200px; margin: 0 auto; }
.tips-banner-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.tips-rotating {
  background: linear-gradient(135deg, var(--purple-dark), #6d28d9cc);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  box-shadow: var(--glow);
}
.tips-rotating-icon { font-size: 1.4rem; flex-shrink: 0; }
.tips-rotating-text { flex: 1; color: #e9d5ff; font-size: 0.93rem; font-weight: 500; transition: opacity 0.3s; }
.tips-dots { display: flex; gap: 5px; flex-shrink: 0; }
.tips-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: background 0.3s; cursor: pointer; }
.tips-dot.active { background: #fff; }
.tips-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s;
}
.tips-card:hover { border-color: var(--border2); }
.tips-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.tips-card-icon.green { background: rgba(16,185,129,0.15); }
.tips-card-icon.amber { background: rgba(245,158,11,0.15); }
.tips-card-icon.blue  { background: rgba(6,182,212,0.15); }
.tips-card-icon.red   { background: rgba(239,68,68,0.15); }
.tips-card-label { font-size: 0.7rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
.tips-card-text { font-size: 0.84rem; color: var(--text2); line-height: 1.4; }

/* ===========================================
   PRODUCT CARDS (shared)
=========================================== */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  text-decoration: none;
  color: inherit;
  display: block;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glow-lg);
  border-color: var(--border2);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-img-wrap {
  position: relative;
  height: 190px;
  background: var(--bg3);
  overflow: hidden;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.product-card:hover .card-img { transform: scale(1.07); }
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  font-size: 2.5rem;
  color: var(--text3);
  background: var(--bg3);
}
.card-img-placeholder span { font-size: 0.75rem; color: var(--text3); }
.sold-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; letter-spacing: 3px;
}
.card-badge-wrap {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 6px;
}
.card-badge {
  background: rgba(139,92,246,0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}
.card-cond {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.cond-new      { background: rgba(16,185,129,0.85); color: #fff; }
.cond-like-new { background: rgba(6,182,212,0.85); color: #fff; }
.cond-used     { background: rgba(245,158,11,0.85); color: #fff; }

.card-body { padding: 14px 16px 16px; }
.card-category { font-size: 0.72rem; color: var(--purple-light); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.card-title { font-size: 0.93rem; font-weight: 600; margin-bottom: 8px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.card-desc  { font-size: 0.78rem; color: var(--text3); margin-bottom: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 1.1rem; font-weight: 800; color: var(--purple-light); margin-bottom: 4px; }
.card-date { font-size: 0.72rem; color: var(--text3); }
.card-sold { opacity: 0.6; }

/* Skeleton */
.skeleton-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.skeleton-img  { height: 190px; background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
.skeleton-body { padding: 14px 16px; }
.skeleton-line { height: 11px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
.skeleton-line.short { width: 55%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty / error */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 5rem 2rem;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; color: var(--text3); }
.loading { text-align: center; padding: 40px; color: var(--text3); }
.empty   { text-align: center; padding: 40px; color: var(--text3); }
.error   { text-align: center; padding: 40px; color: var(--red); }

/* ===========================================
   ALERTS & BADGES
=========================================== */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; font-weight: 500; }
.alert-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.alert-error   { background: rgba(239,68,68,0.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: capitalize; }
.badge-available { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.badge-reserved  { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-sold      { background: rgba(239,68,68,0.15);  color: #fca5a5; }

/* ===========================================
   FORMS (shared)
=========================================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text2); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  font-size: 0.93rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg3);
  color: var(--text);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
}
.form-group select option { background: var(--bg3); }
.form-group small { display: block; color: var(--text3); font-size: 0.78rem; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.char-count { font-size: 0.75rem; color: var(--text3); float: right; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(139,92,246,0.3);
  letter-spacing: 0.2px;
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 6px 25px rgba(139,92,246,0.45); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { padding: 11px 20px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--text2); transition: all 0.2s; }
.btn-secondary:hover { background: var(--bg3); color: var(--text); }
.btn-danger { padding: 12px 20px; background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); border-radius: 10px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.btn-danger:hover { background: var(--red); color: #fff; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(6px); }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 1.3rem; margin-bottom: 20px; color: var(--text); }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: 1; }

/* ===========================================
   HERO (index.html)
=========================================== */
.hero {
  background: radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(236,72,153,0.2) 0%, transparent 50%),
              radial-gradient(ellipse at 60% 80%, rgba(6,182,212,0.15) 0%, transparent 50%),
              var(--bg2);
  padding: 100px 24px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px; right: -100px; bottom: -100px;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b5cf6' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  animation: dotMove 20s linear infinite;
}
@keyframes dotMove { from { transform: translateY(0); } to { transform: translateY(60px); } }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-dim);
  border: 1px solid var(--border2);
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
  animation: fadeDown 0.6s ease both;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  animation: fadeDown 0.7s ease both;
}
.hero h1 .grad {
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto 36px;
  animation: fadeDown 0.8s ease both;
}
.hero-search {
  display: flex;
  max-width: 580px;
  margin: 0 auto 20px;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(139,92,246,0.3);
  border: 1px solid var(--border2);
  animation: fadeDown 0.9s ease both;
}
.hero-search input {
  flex: 1;
  padding: 17px 22px;
  border: none;
  font-size: 0.97rem;
  outline: none;
  background: var(--surface2);
  color: var(--text);
  border-radius: 0;
}
.hero-search input::placeholder { color: var(--text3); }
.hero-search button {
  padding: 17px 28px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s;
  white-space: nowrap;
}
.hero-search button:hover { filter: brightness(1.15); }
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: fadeDown 1s ease both;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 800; color: var(--purple-light); }
.hero-stat-label { font-size: 0.75rem; color: var(--text3); font-weight: 500; }
.hero-stat-divider { width: 1px; height: 32px; background: var(--border); }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

/* Categories */
.categories-section { padding: 64px 0 32px; position: relative; z-index: 1; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.section-title span { color: var(--purple-light); }
.categories-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  animation: fadeDown 0.5s ease both;
}
.cat-card:nth-child(1) { animation-delay: 0.05s; }
.cat-card:nth-child(2) { animation-delay: 0.10s; }
.cat-card:nth-child(3) { animation-delay: 0.15s; }
.cat-card:nth-child(4) { animation-delay: 0.20s; }
.cat-card:nth-child(5) { animation-delay: 0.25s; }
.cat-card:nth-child(6) { animation-delay: 0.30s; }
.cat-card span { font-size: 0.8rem; font-weight: 600; color: var(--text3); }
.cat-card:hover { border-color: var(--border2); background: var(--purple-dim); transform: translateY(-4px); box-shadow: var(--glow); color: var(--purple-light); }
.cat-card:hover span { color: var(--purple-light); }

/* Latest listings */
.listings-section { padding: 24px 0 72px; position: relative; z-index: 1; }

/* ===========================================
   BROWSE PAGE
=========================================== */
.page-header {
  background: radial-gradient(ellipse at 30% 50%, rgba(139,92,246,0.2) 0%, transparent 60%), var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 56px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.page-header::after {
  content: 'BROWSE';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8rem;
  font-weight: 900;
  color: rgba(139,92,246,0.04);
  pointer-events: none;
  letter-spacing: -4px;
}
.page-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-header-inner h1 { font-size: 2rem; font-weight: 800; margin-bottom: 18px; }
.page-header-inner h1 span { color: var(--purple-light); }
.search-bar { display: flex; max-width: 520px; gap: 10px; }
.search-bar input {
  flex: 1; padding: 11px 16px;
  border: 1.5px solid var(--border2);
  border-radius: 10px; font-size: 0.93rem;
  outline: none; background: var(--bg3); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input::placeholder { color: var(--text3); }
.search-bar input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
.search-bar button {
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff; border: none; border-radius: 10px;
  cursor: pointer; font-weight: 700; font-size: 0.9rem;
  transition: filter 0.2s;
  white-space: nowrap;
}
.search-bar button:hover { filter: brightness(1.15); }

.browse-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: -2rem auto 0;
  padding: 0 20px 56px;
  align-items: start;
  position: relative;
  z-index: 2;
}
.filters-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  height: fit-content;
  position: sticky;
  top: 82px;
  animation: slideLeft 0.4s ease;
  box-shadow: var(--shadow);
}
@keyframes slideLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.filters-sidebar h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 18px; }
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text3); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.7px; }
.filter-group select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border2); border-radius: 9px;
  font-size: 0.88rem; outline: none;
  background: var(--bg3); color: var(--text);
  cursor: pointer; transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b6890' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.filter-group select option { background: var(--bg3); }
.filter-group select:focus { border-color: var(--purple); }
.btn-clear {
  width: 100%; padding: 9px;
  background: transparent; border: 1.5px dashed var(--border2);
  border-radius: 9px; color: var(--text3); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; margin-top: 4px;
}
.btn-clear:hover { border-color: var(--red); color: #fca5a5; background: rgba(239,68,68,0.08); }
.results-info { font-size: 0.85rem; color: var(--text3); margin-bottom: 16px; font-weight: 500; }
.results-info strong { color: var(--purple-light); }

.pagination { display: flex; align-items: center; gap: 12px; margin-top: 36px; justify-content: center; }
.pagination button {
  padding: 9px 22px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text2); font-size: 0.88rem;
  transition: all 0.2s;
}
.pagination button:hover:not(:disabled) { background: var(--purple-dim); border-color: var(--purple); color: var(--purple-light); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
#pageInfo { font-size: 0.85rem; color: var(--text3); font-weight: 600; min-width: 90px; text-align: center; }

/* ===========================================
   AUTH PAGES
=========================================== */
.auth-page {
  min-height: calc(100vh - 66px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  position: relative; z-index: 1;
  background: radial-gradient(ellipse at center, rgba(139,92,246,0.12) 0%, transparent 65%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-lg), var(--glow);
  animation: authIn 0.5s ease;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 70%);
  pointer-events: none;
}
@keyframes authIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.auth-icon { font-size: 2.4rem; margin-bottom: 16px; display: block; }
.auth-card h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.auth-sub { color: var(--text3); margin-bottom: 28px; font-size: 0.9rem; }
.auth-link { text-align: center; margin-top: 22px; font-size: 0.88rem; color: var(--text3); }
.auth-link a { color: var(--purple-light); font-weight: 600; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.auth-divider span { flex: 1; height: 1px; background: var(--border); }
.auth-divider p { font-size: 0.75rem; color: var(--text3); white-space: nowrap; }

/* ===========================================
   SELL PAGE
=========================================== */
.form-page {
  min-height: calc(100vh - 66px);
  display: flex; justify-content: center;
  padding: 44px 16px;
  position: relative; z-index: 1;
  background: radial-gradient(ellipse at 70% 20%, rgba(236,72,153,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 20% 80%, rgba(139,92,246,0.1) 0%, transparent 50%);
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg);
  height: fit-content;
  animation: authIn 0.4s ease;
}
.form-card-header { margin-bottom: 28px; }
.form-card-header h2 { font-size: 1.7rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.form-card-header p  { color: var(--text3); font-size: 0.9rem; }
.form-steps { display: flex; gap: 6px; margin-bottom: 28px; }
.form-step { flex: 1; height: 3px; border-radius: 3px; background: var(--border); }
.form-step.active { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.img-preview-box {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--text3);
  font-size: 0.88rem;
  background: var(--bg3);
  transition: border-color 0.2s;
  margin-top: 8px;
}
.img-preview-box img { max-height: 140px; border-radius: 8px; margin-bottom: 8px; }
.img-preview-box:hover { border-color: var(--purple); }

/* ===========================================
   PRODUCT DETAIL
=========================================== */
.product-detail-page { padding: 36px 20px 72px; position: relative; z-index: 1; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text3); font-size: 0.88rem; font-weight: 500;
  margin-bottom: 28px; transition: color 0.2s;
}
.back-link:hover { color: var(--purple-light); }
.product-detail-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow);
  animation: authIn 0.4s ease;
}
.product-detail-img { width: 100%; height: 380px; object-fit: cover; border-radius: var(--radius-lg); }
.product-detail-placeholder {
  height: 380px; background: var(--bg3);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: var(--text3);
}
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-header h1 { font-size: 1.55rem; line-height: 1.3; color: var(--text); font-weight: 800; }
.detail-price { font-size: 2.1rem; font-weight: 900; color: var(--purple-light); margin-bottom: 18px; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.detail-meta span {
  font-size: 0.82rem; color: var(--text2);
  background: var(--bg3); padding: 5px 12px;
  border-radius: 20px; border: 1px solid var(--border);
}
.detail-description h3 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; }
.detail-description p { color: var(--text2); line-height: 1.7; font-size: 0.93rem; }
.owner-actions, .buyer-actions { display: flex; gap: 12px; margin-top: 28px; }
.owner-actions .btn-primary,
.buyer-actions .btn-primary { width: auto; padding: 12px 24px; }

/* ===========================================
   PROFILE PAGE
=========================================== */
.profile-page { padding: 36px 20px 72px; position: relative; z-index: 1; }

.profile-banner {
  background: radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(236,72,153,0.2) 0%, transparent 60%),
              var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  animation: authIn 0.4s ease;
  position: relative;
  overflow: hidden;
}
.profile-banner::before {
  content: '👤';
  position: absolute;
  right: 32px; top: 50%;
  transform: translateY(-50%);
  font-size: 8rem;
  opacity: 0.05;
  pointer-events: none;
}
.profile-top { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.profile-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(139,92,246,0.4);
}
.profile-info h1 { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.profile-info p  { color: var(--text3); font-size: 0.88rem; }
.profile-actions { margin-left: auto; display: flex; gap: 10px; }
.profile-actions .btn-primary { width: auto; padding: 11px 22px; }

.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-num  { font-size: 1.8rem; font-weight: 800; color: var(--purple-light); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.75rem; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.profile-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 5px; width: fit-content; }
.tab-btn {
  padding: 9px 22px; border-radius: 9px; border: none;
  background: transparent; color: var(--text3); font-weight: 600; font-size: 0.88rem;
  cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: var(--purple); color: #fff; box-shadow: 0 2px 10px rgba(139,92,246,0.4); }
.tab-btn:not(.active):hover { color: var(--text); background: var(--purple-dim); }

.profile-section-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 20px; }

/* ===========================================
   RESPONSIVE
=========================================== */
@media (max-width: 960px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .browse-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; display: flex; gap: 12px; flex-wrap: wrap; }
  .product-detail-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body::before { font-size: 60vw; }
  .hero h1 { font-size: 2.2rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 14px; }
  .nav-links a { padding: 6px 9px; font-size: 0.82rem; }
  .auth-card, .form-card { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .profile-top { flex-direction: column; text-align: center; }
  .profile-actions { margin-left: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-stats { gap: 16px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}
