/* ────────────────────────────────────────────
   WolfaX – Main Styles
   ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-primary:   #0b0d18;
  --bg-secondary: #11142a;
  --bg-card:      #181b30;
  --bg-card2:     #1f2340;
  --accent-red:   #e63946;
  --accent-blue:  #4895ef;
  --accent-gold:  #f9c74f;
  --accent-green: #43d17a;
  --text-primary: #e8eaf0;
  --text-muted:   #8890aa;
  --border:       #252840;
  --shadow:       0 4px 24px rgba(0,0,0,.45);
  --radius:       10px;
  --transition:   .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: #78b4f8; }

img { max-width: 100%; object-fit: cover; border-radius: var(--radius); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Typography ── */
h1,h2,h3,h4 { font-family: 'Rajdhani', sans-serif; font-weight: 700; line-height: 1.2; }

/* ── Button ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius); border: none;
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary   { background: var(--accent-red);  color: #fff; }
.btn-primary:hover   { background: #c62d38; color: #fff; }
.btn-secondary { background: var(--accent-blue); color: #fff; }
.btn-secondary:hover { background: #357edc; color: #fff; }
.btn-gold      { background: var(--accent-gold); color: #111; }
.btn-gold:hover      { background: #e0ae3a; color: #111; }
.btn-ghost     { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover     { background: var(--bg-card2); color: var(--text-primary); }
.btn-success   { background: var(--accent-green); color: #111; }
.btn-danger    { background: var(--accent-red);   color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.badge-red    { background: rgba(230,57,70,.2);  color: var(--accent-red); }
.badge-blue   { background: rgba(72,149,239,.2); color: var(--accent-blue); }
.badge-gold   { background: rgba(249,199,79,.2); color: var(--accent-gold); }
.badge-green  { background: rgba(67,209,122,.2); color: var(--accent-green); }
.badge-muted  { background: var(--bg-card2); color: var(--text-muted); }

/* ── Card ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ── Header / Nav ── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(11,13,24,.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px; height: 64px;
  display: flex; align-items: center; gap: 20px;
}

.logo {
  font-family: 'Rajdhani', sans-serif; font-size: 1.7rem; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.logo span { color: var(--accent-red); }

.search-bar {
  flex: 1; max-width: 480px; position: relative;
}
.search-bar input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 24px; padding: 9px 16px 9px 42px; color: var(--text-primary);
  font-size: .9rem; outline: none; transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--accent-blue); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.user-menu { position: relative; }
.user-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card2); border: 1px solid var(--border); border-radius: 24px;
  padding: 6px 14px; cursor: pointer; color: var(--text-primary); font-size: .88rem;
  transition: var(--transition);
}
.user-avatar-btn:hover { border-color: var(--accent-blue); }
.user-avatar-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-avatar-btn .balance { color: var(--accent-gold); font-weight: 600; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 190px; overflow: hidden; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: var(--transition); z-index: 9999;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-primary); font-size: .88rem;
  background: none; border: none; width: 100%; cursor: pointer; text-align: left;
  transition: background var(--transition);
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-card2); color: #fff; }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0b0d18 0%, #1a0a20 50%, #0d1a30 100%);
  padding: 80px 40px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(230,57,70,.12) 0%, transparent 60%),
              radial-gradient(circle at 70% 50%, rgba(72,149,239,.1) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: 3.2rem; letter-spacing: -.02em; margin-bottom: 16px; }
.hero h1 span { color: var(--accent-red); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 32px; }

/* ── Section ── */
.section { padding: 60px 40px; max-width: 1280px; margin: 0 auto; }
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px;
}
.section-title {
  font-size: 1.6rem; display: flex; align-items: center; gap: 10px;
}
.section-title i { color: var(--accent-red); }

/* ── Grid ── */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }

/* ── Game Card ── */
.game-card { cursor: pointer; }
.game-card-img { width: 100%; height: 150px; object-fit: cover; }
.game-card-body { padding: 14px; }
.game-card-body h3 { font-size: 1.1rem; margin-bottom: 4px; }
.game-card-body .meta { color: var(--text-muted); font-size: .82rem; }

/* ── Item Card ── */
.item-card-img { width: 100%; height: 180px; object-fit: cover; }
.item-card-body { padding: 14px; }
.item-card-body h3 { font-size: 1rem; margin-bottom: 6px; }
.item-card-footer { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.item-price { font-family: 'Rajdhani', sans-serif; font-size: 1.2rem; color: var(--accent-gold); font-weight: 700; }
.item-stock { font-size: .8rem; color: var(--text-muted); }

/* ── Auction Card ── */
.auction-card-img { width: 100%; height: 160px; object-fit: cover; }
.auction-card-body { padding: 14px; }
.auction-timer { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; color: var(--accent-red); }
.current-bid { font-family: 'Rajdhani', sans-serif; font-size: 1.4rem; color: var(--accent-gold); font-weight: 700; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  transform: scale(.96); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.25rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.form-control {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--text-primary);
  font-size: .92rem; outline: none; font-family: inherit;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent-blue); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-secondary); }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: .9rem;
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.alert-error   { background: rgba(230,57,70,.15);  border: 1px solid rgba(230,57,70,.3);  color: #f07880; }
.alert-success { background: rgba(67,209,122,.15); border: 1px solid rgba(67,209,122,.3); color: #5de898; }
.alert-info    { background: rgba(72,149,239,.15); border: 1px solid rgba(72,149,239,.3); color: #78b4f8; }
.alert-warning { background: rgba(249,199,79,.15); border: 1px solid rgba(249,199,79,.3); color: var(--accent-gold); }

/* ── Loading Spinner ── */
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent-red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: flex; justify-content: center; padding: 60px 0; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 1rem; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border); text-align: center;
  padding: 28px 20px; color: var(--text-muted); font-size: .85rem;
  margin-top: auto;
}
.site-footer span { color: var(--accent-red); }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-card2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; min-width: 260px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow);
  animation: slideIn .25s ease;
}
.toast.toast-success { border-left: 3px solid var(--accent-green); }
.toast.toast-error   { border-left: 3px solid var(--accent-red); }
.toast.toast-info    { border-left: 3px solid var(--accent-blue); }
.toast-icon { font-size: 1rem; margin-top: 2px; }
.toast-success .toast-icon { color: var(--accent-green); }
.toast-error   .toast-icon { color: var(--accent-red); }
.toast-info    .toast-icon { color: var(--accent-blue); }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: .9rem; }
.toast-msg   { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .site-header { padding: 0 18px; gap: 12px; }
  .search-bar  { max-width: 260px; }
  .section     { padding: 40px 18px; }
  .hero        { padding: 56px 18px; }
  .hero h1     { font-size: 2.2rem; }
}

@media (max-width: 600px) {
  .search-bar { display: none; }
  .hero h1    { font-size: 1.8rem; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
