/* ── Design Tokens — Light Mode ──────────────────────────────────────────── */
:root {
  --bg:         #ffffff;
  --bg-subtle:  #f9fafb;
  --bg-muted:   #f3f4f6;
  --card-bg:    #ffffff;
  --border:     #e5e7eb;
  --text:       #111827;
  --text-muted: #6b7280;
  --text-xs:    #9ca3af;
  --primary:    #4f46e5;
  --primary-h:  #4338ca;
  --primary-50: rgba(79,70,229,.08);
  --nav-bg:     #ffffff;
  --nav-border: #e5e7eb;
  --input-bg:   #ffffff;
  --input-border: #d1d5db;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 28px rgba(0,0,0,.10);
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
}

/* ── Design Tokens — Dark Mode ───────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:         #0f172a;
  --bg-subtle:  #1e293b;
  --bg-muted:   #1e293b;
  --card-bg:    #1e293b;
  --border:     #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --text-xs:    #64748b;
  --primary:    #818cf8;
  --primary-h:  #6366f1;
  --primary-50: rgba(129,140,248,.12);
  --nav-bg:     #0f172a;
  --nav-border: #1e293b;
  --input-bg:   #1e293b;
  --input-border: #334155;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 28px rgba(0,0,0,.5);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Figtree', sans-serif;
  font-size: 0.9rem;
  transition: background-color .2s, color .2s;
}

a { color: var(--primary); }
a:hover { color: var(--primary-h); }

.main-content { min-height: calc(100vh - 64px - 220px); }

/* ── Bootstrap overrides ─────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.card-header {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
  font-weight: 600;
}
.card-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

.form-control, .form-select {
  background-color: var(--input-bg) !important;
  border: 1.5px solid var(--input-border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text) !important;
  font-family: 'Figtree', sans-serif;
  font-size: .875rem;
  box-shadow: none !important;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-50) !important;
}
.form-control::placeholder { color: var(--text-muted); opacity: .7; }
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  margin-bottom: .35rem;
}

.btn {
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  border-radius: var(--radius-md);
  font-size: .85rem;
  transition: all .15s;
}
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--primary-h) !important;
  border-color: var(--primary-h) !important;
}
.btn-outline-primary {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}
.btn-dark {
  background: var(--text) !important;
  border-color: var(--text) !important;
  color: var(--bg) !important;
}
.btn-dark:hover { opacity: .85; }
.btn-warning { color: #000 !important; }
.btn-secondary {
  background: var(--bg-muted) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.btn-secondary:hover { background: var(--border) !important; }

.badge { font-family: 'Figtree', sans-serif; font-weight: 600; border-radius: 20px; }
.bg-purple { background-color: #7c3aed !important; }
.text-purple { color: #7c3aed !important; }

.table {
  color: var(--text);
  border-color: var(--border);
}
.table > :not(caption) > * > * {
  background-color: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
.table-hover > tbody > tr:hover > * {
  background-color: var(--bg-subtle);
  color: var(--text);
}
.table thead th {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.dropdown-menu {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: .35rem;
  min-width: 200px;
}
.dropdown-item {
  color: var(--text);
  border-radius: var(--radius-md);
  font-size: .875rem;
  padding: .5rem .75rem;
  transition: background .12s;
}
.dropdown-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.dropdown-divider { border-color: var(--border); }

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
}
.modal-header, .modal-footer {
  border-color: var(--border);
}

.list-group-item {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}
.list-group-item-action:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.page-link {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-md) !important;
}
.page-link:hover { background: var(--bg-subtle); color: var(--primary); }
.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.alert {
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: .875rem;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.site-navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background .2s;
}
.site-navbar .container-xxl { display: flex; align-items: center; height: 64px; gap: 1rem; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand-icon { font-size: 1.3rem; }
.nav-brand-name {
  font-family: 'Figtree', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}
.nav-brand-name span { color: var(--primary); }
.nav-brand-badge {
  font-size: .6rem;
  font-weight: 700;
  background: var(--primary-50);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--primary);
  opacity: .8;
}

.nav-links { display: flex; align-items: center; gap: .1rem; margin-left: 1rem; }
.nav-link-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: .4rem .7rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-link-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link-item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }

.nav-search { flex: 1; max-width: 280px; position: relative; }
.nav-search input {
  width: 100%;
  padding: .45rem .9rem .45rem 2.2rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: 'Figtree', sans-serif;
}
.nav-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}

.nav-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Currency switcher dropdown */
.cur-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  height: 36px;
}
.cur-toggle:hover { border-color: var(--primary); color: var(--text); }
.cur-toggle.cur-active { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.07); }
.cur-dropdown-menu {
  min-width: 200px;
  padding: .4rem;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.cur-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .7rem;
  border-radius: 8px;
  transition: background .1s;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.cur-option:hover { background: var(--bg-subtle); }
.cur-option-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
  color: var(--primary);
}
.cur-option-name { font-size: .82rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.cur-option-desc { font-size: .7rem; color: var(--text-muted); }
.cur-check { margin-left: auto; color: var(--primary); font-size: .9rem; visibility: hidden; flex-shrink: 0; }
/* Mobile currency buttons */
.cur-mob-btn {
  padding: .3rem .7rem;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
}
.cur-mob-btn:hover, .cur-mob-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,.07);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: all .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-muted); color: var(--text); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.nav-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.nav-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: all .15s;
}
.nav-notif-btn:hover { background: var(--bg-muted); color: var(--text); }
.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--nav-bg);
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: .3rem .6rem .3rem .3rem;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.nav-user-btn:hover { border-color: var(--primary); background: var(--card-bg); color: var(--text); }
.nav-user-btn .chevron { color: var(--text-muted); font-size: .75rem; }

.btn-register {
  padding: .4rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  transition: background .15s;
  white-space: nowrap;
}
.btn-register:hover { background: var(--primary-h); color: #fff; }
.btn-login {
  padding: .4rem .9rem;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  transition: all .15s;
  white-space: nowrap;
}
.btn-login:hover { border-color: var(--primary); color: var(--primary); }

/* Mobile toggle */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #1a1040 0%, #2d1b69 40%, #1a0a4a 70%, #0d0820 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(79,70,229,.25) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(129,140,248,.15) 0%, transparent 50%);
}
.hero-section > * { position: relative; z-index: 1; }

/* ── Section backgrounds ─────────────────────────────────────────────────── */
.bg-page { background: var(--bg); }
.bg-subtle { background: var(--bg-subtle); }
.bg-card { background: var(--card-bg); }

/* ── Text helpers ────────────────────────────────────────────────────────── */
.text-page { color: var(--text); }
.text-muted-custom { color: var(--text-muted); }
.text-xs-custom { color: var(--text-xs); }
.border-custom { border-color: var(--border) !important; }

/* ── Listing Cards ───────────────────────────────────────────────────────── */
.listing-card {
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  overflow: hidden;
}
.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--primary) !important;
}
.listing-img {
  height: 160px;
  object-fit: cover;
  width: 100%;
}
.trade-type-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.filter-btn {
  padding: .4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-family: 'Figtree', sans-serif;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

/* ── Stats card ──────────────────────────────────────────────────────────── */
.stat-card { border-radius: var(--radius-xl); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
}

/* ── Auction timer ───────────────────────────────────────────────────────── */
.auction-timer {
  font-feature-settings: 'tnum';
  letter-spacing: .05em;
  font-weight: 700;
}

/* ── Flash / Toasts ──────────────────────────────────────────────────────── */
.flash-container { max-width: 380px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.footer-brand-name {
  font-family: 'Figtree', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}
.footer-brand-name span { color: var(--primary); }
.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text);
  margin-bottom: .75rem;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .85rem;
  display: block;
  margin-bottom: .4rem;
  transition: color .15s;
}
.footer-link:hover { color: var(--primary); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-xs); }

/* ── Misc ────────────────────────────────────────────────────────────────── */
@keyframes pulse { 0%,100% { opacity:.6 } 50% { opacity:1 } }
.loading { animation: pulse 1.5s infinite; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-hamburger { display: flex; }

  /* Hide currency dropdown button and theme toggle — both in mobile menu */
  #currencyDropdown { display: none !important; }
  .nav-right .theme-toggle { display: none; }

  /* Condense user button — avatar only, no text/chevron */
  .nav-user-btn .nav-username-text { display: none; }
  .nav-user-btn .chevron { display: none; }
  .nav-user-btn { padding: .2rem; border-radius: 50%; border-color: transparent; background: transparent; gap: 0; }
  .nav-user-btn:hover { border-color: var(--border); background: var(--bg-subtle); }

  .nav-mobile-menu {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--nav-bg);
    z-index: 999;
    padding: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .nav-mobile-menu.open { transform: translateX(0); }
  .nav-mobile-inner { padding: 1.25rem 1.25rem 2rem; }
}
@media (min-width: 992px) {
  .nav-mobile-menu { display: none !important; }
}
@media (max-width: 480px) {
  /* On very small screens, hide notif bell and brand badge (both in mobile menu) */
  .nav-notif-btn { display: none !important; }
  .nav-brand-badge { display: none; }
}
@media (max-width: 768px) {
  .hero-section { text-align: center; }
  /* Tighter container padding on mobile */
  .container-xxl { padding-left: 1rem; padding-right: 1rem; }
}

/* ── Listing Card: Quick View hover button ───────────────────────────────── */
.listing-card:hover .quick-view-btn { opacity: 1 !important; }

/* ── Quick View Modal ────────────────────────────────────────────────────── */
#quickViewModal .modal-dialog { max-width: 520px; }
#quickViewModal .qv-image { width: 100%; height: 220px; object-fit: cover; border-radius: 8px 8px 0 0; }
#quickViewModal .qv-no-image { width: 100%; height: 220px; display: flex; align-items: center; justify-content: center; background: var(--bg-subtle); border-radius: 8px 8px 0 0; }
