/* ============================================
   In-Game Marketplace — Gaming Shop Theme
   High contrast, readable, Bootstrap-friendly
   ============================================ */

:root {
  --bg: #0f1117;
  --bg-2: #161b26;
  --bg-3: #1c2333;
  --card: #1a2030;
  --border: #2d3748;
  --text: #f0f4f8;
  --text-2: #c5d0de;
  --text-3: #8b9bb4;
  --purple: #9b6dff;
  --purple-2: #7c4dff;
  --cyan: #2ee7ff;
  
  --gold: #ffc14a;
  --green: #3dd68c;
  --red: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: var(--purple); }
a:hover { color: #b794ff; }

/* ---- Navbar ---- */
.navbar-marketplace {
  background: var(--bg-2) !important;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.navbar-marketplace .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.1rem;
}

.navbar-marketplace .navbar-brand i {
  color: var(--purple);
  margin-right: 6px;
}

.navbar-marketplace .nav-link {
  color: var(--text-2) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem !important;
}

.navbar-marketplace .nav-link:hover {
  color: #fff !important;
}

.navbar-marketplace .form-control {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 20px;
  font-size: 0.875rem;
}

.navbar-marketplace .form-control::placeholder {
  color: var(--text-3);
}

.navbar-marketplace .dropdown-menu {
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.navbar-marketplace .dropdown-item {
  color: var(--text-2);
}

.navbar-marketplace .dropdown-item:hover {
  background: var(--bg-3);
  color: #fff;
}

.btn-register {
  background: var(--gold) !important;
  color: #1a1a1a !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 0.35rem 1rem !important;
  font-size: 0.85rem;
}

.btn-register:hover {
  filter: brightness(1.1);
  color: #000 !important;
}

/* ---- Buttons ---- */
.btn-accent {
  background: var(--purple-2) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
}

.btn-accent:hover {
  background: var(--purple) !important;
  color: #fff !important;
}

.btn-outline-light {
  border-color: var(--border) !important;
  color: var(--text-2) !important;
  border-radius: 8px;
}

.btn-outline-light:hover {
  background: var(--bg-3) !important;
  color: #fff !important;
  border-color: var(--purple) !important;
}

/* ---- Hero ---- */
.hero-box {
  background: linear-gradient(135deg, #1a1430 0%, var(--bg-2) 50%, #121a28 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
}

.hero-box .live-pill {
  display: inline-block;
  background: rgba(61, 214, 140, 0.15);
  color: var(--green);
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero-box h1 {
  color: #fff !important;
  font-weight: 800;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.hero-box h1 .highlight {
  color: var(--gold);
}

.hero-box .lead-text {
  color: var(--text-2) !important;
  font-size: 0.95rem;
  max-width: 560px;
  margin-bottom: 1.25rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.hero-stats .stat strong {
  display: block;
  color: #fff !important;
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-stats .stat span {
  color: var(--text-3) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Section titles ---- */
.section-title {
  color: #fff !important;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--purple);
}

.section-title a {
  color: var(--gold) !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  float: right;
}

.section-title a:hover {
  color: #ffd780 !important;
}

/* ---- Product cards ---- */
.card-product {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.card-product:hover {
  transform: translateY(-4px);
  border-color: var(--purple) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-product .img-box {
  background: var(--bg-2);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-product .img-box img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.card-product .img-box .placeholder-icon {
  font-size: 2.5rem;
  color: var(--text-3);
  opacity: 0.4;
}

.card-product .stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.card-product .low-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
}

.card-product .card-body {
  padding: 0.85rem 1rem 0.5rem;
}

.card-product .item-name {
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.card-product .item-cat {
  display: inline-block;
  background: rgba(155, 109, 255, 0.15);
  color: var(--purple) !important;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  margin-bottom: 0.5rem;
}

.card-product .item-price {
  color: var(--gold) !important;
  font-weight: 800;
  font-size: 1.1rem;
}

.card-product .card-footer {
  background: transparent !important;
  border: none !important;
  padding: 0.5rem 1rem 1rem;
}

.card-product .btn-buy {
  width: 100%;
  background: var(--purple-2) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 0.45rem;
}

.card-product .btn-buy:hover {
  background: var(--purple) !important;
  color: #fff !important;
}

.card-product .btn-buy.disabled,
.card-product .btn-buy:disabled {
  background: var(--border) !important;
  color: var(--text-3) !important;
}

/* ---- Forms ---- */
.form-control, .form-select {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px;
}

.form-control:focus, .form-select:focus {
  background: var(--bg-3) !important;
  border-color: var(--purple) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(155, 109, 255, 0.25) !important;
}

.form-control::placeholder {
  color: var(--text-3) !important;
}

.form-label {
  color: var(--text-2) !important;
  font-weight: 500;
}

.form-text {
  color: var(--text-3) !important;
}

/* ---- Cards / panels ---- */
.card {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  color: var(--text) !important;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  color: #fff !important;
  font-weight: 600;
}

.list-group-item {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* ---- Tables ---- */
.table {
  color: var(--text) !important;
  --bs-table-bg: var(--card);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: var(--bg-2);
  --bs-table-hover-bg: var(--bg-3);
}

.table thead th {
  color: var(--text-2) !important;
  font-weight: 600;
  font-size: 0.8rem;
  border-color: var(--border) !important;
}

.table td {
  border-color: var(--border) !important;
  vertical-align: middle;
}

/* ---- Status badges ---- */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: capitalize;
  display: inline-block;
}

.status-awaiting_payment { background: rgba(255, 193, 74, 0.2); color: var(--gold) !important; }
.status-awaiting_confirmation { background: rgba(96, 165, 250, 0.2); color: #60a5fa !important; }
.status-processing { background: rgba(61, 214, 140, 0.2); color: var(--green) !important; }
.status-delivered { background: rgba(61, 214, 140, 0.25); color: #6eebaf !important; }
.status-cancelled { background: rgba(255, 107, 107, 0.2); color: var(--red) !important; }

/* ---- Auth pages ---- */
.auth-body {
  background: var(--bg) !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--bg-2) !important;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(124, 77, 255, 0.15);
}

.auth-card h1, .auth-card .h3 {
  color: #fff !important;
}

/* ---- Admin ---- */
.admin-sidebar {
  width: 230px;
  min-height: 100vh;
  background: var(--bg-2) !important;
  border-right: 1px solid var(--border);
}

.admin-sidebar .nav-link {
  color: var(--text-2) !important;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.admin-sidebar .nav-link:hover {
  background: rgba(155, 109, 255, 0.12);
  color: var(--purple) !important;
}

.admin-content {
  background: var(--bg);
  min-height: 100vh;
}

/* ---- Alerts ---- */
.alert-success {
  background: rgba(61, 214, 140, 0.15) !important;
  color: #6eebaf !important;
  border: 1px solid rgba(61, 214, 140, 0.3) !important;
}

.alert-danger {
  background: rgba(255, 107, 107, 0.15) !important;
  color: #ff9a9a !important;
  border: 1px solid rgba(255, 107, 107, 0.3) !important;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-3) !important;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.4;
}

/* ---- Pagination ---- */
.page-link {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}

.page-item.active .page-link {
  background: var(--purple-2) !important;
  border-color: var(--purple-2) !important;
  color: #fff !important;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  color: var(--text-3) !important;
  font-size: 0.8rem;
  margin-top: auto;
}

/* ---- Utilities ---- */
.text-muted { color: var(--text-3) !important; }
.text-white { color: #fff !important; }
.text-gold { color: var(--gold) !important; }
.text-accent { color: var(--purple) !important; }

.bg-dark-panel { background: var(--bg-2) !important; }

code {
  color: var(--cyan) !important;
  background: var(--bg-3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.qr-preview {
  max-width: 200px;
  border-radius: 10px;
  border: 2px solid var(--border);
}

/* Product detail price */
.detail-price {
  color: var(--gold) !important;
  font-size: 1.75rem;
  font-weight: 800;
}

@media (max-width: 768px) {
  .hero-box h1 { font-size: 1.4rem; }
  .admin-sidebar { width: 100%; min-height: auto; }
}

/* ---- Order stepper ---- */
.order-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  overflow-x: auto;
}
.order-stepper .step {
  flex: 0 0 auto;
  text-align: center;
  min-width: 64px;
}
.order-stepper .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--text-3);
  border: 2px solid var(--border);
}
.order-stepper .step.active .step-dot {
  background: var(--purple-2);
  border-color: var(--purple);
  color: #fff;
}
.order-stepper .step.done .step-dot {
  background: rgba(61, 214, 140, 0.2);
  border-color: var(--green);
  color: var(--green);
}
.order-stepper .step-label {
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 600;
}
.order-stepper .step.active .step-label,
.order-stepper .step.done .step-label {
  color: var(--text);
}
.order-stepper .step-line {
  flex: 1 1 20px;
  height: 2px;
  background: var(--border);
  margin-top: 13px;
  min-width: 12px;
}
.order-stepper .step-line.done {
  background: var(--green);
}

/* ---- Mobile sticky action bar ---- */
.mobile-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(22, 27, 38, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
body { padding-bottom: 0; }
@media (max-width: 991.98px) {
  body.has-sticky-bar,
  .member-body { padding-bottom: 72px; }
}

/* ---- Lightbox ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lightbox-img { cursor: zoom-in; }
