/* ============================================================
   GunplaDB — Military/Mecha Aesthetic
   Dark background, orange/gold accent, mechanical headings
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Rajdhani:wght@400;500;600;700&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --bg-card:     #12121a;
  --bg-surface:  #1a1a26;
  --bg-elevated: #22223a;
  --accent:      #f59e0b;
  --accent-dim:  #b97d09;
  --accent-glow: rgba(245,158,11,0.15);
  --text:        #f0f0f5;
  --text-muted:  #8888a8;
  --text-faint:  #555570;
  --border:      #2a2a40;
  --border-accent: rgba(245,158,11,0.4);
  --radius:      6px;
  --radius-lg:   10px;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-head:   'Rajdhani', 'Impact', sans-serif;
  --shadow:      0 4px 24px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 20px rgba(245,158,11,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fbbf24; text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--text);
}

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 60px;
}

.navbar-brand {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent) !important;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  text-transform: uppercase;
  white-space: nowrap;
}
.navbar-brand:hover { color: #fbbf24 !important; text-decoration: none !important; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
}

.navbar-nav a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--accent);
  background: var(--accent-glow);
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  padding: 5rem 1.25rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245,158,11,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  max-width: 600px;
  margin: 0 auto 1rem;
  gap: 0;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-accent);
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.85rem 1.25rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-faint); }

.search-bar button {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.search-bar button:hover { background: #fbbf24; }

.search-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
}
.search-hint a { color: var(--accent); }

/* ── Grade Pills ── */
.grade-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.grade-pill {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  background: var(--accent-glow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.grade-pill:hover, .grade-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  text-decoration: none;
}

/* ── Section Heading ── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 1rem;
}
.section-head h2 {
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-head h2 span { color: var(--accent); }
.section-head a { font-size: 0.85rem; color: var(--text-muted); }
.section-head a:hover { color: var(--accent); }

/* ── Model Card Grid ── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding-bottom: 2rem;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.model-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow), var(--shadow-accent);
  text-decoration: none;
  color: inherit;
}

.card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-surface);
}

.card-body { padding: 0.85rem; }

.card-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-grade { background: var(--accent); color: #000; }
.badge-scale { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.badge-available { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-discontinued { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-limited { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-pre-order { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

.card-name {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.35;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.card-series {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.card-price {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.card-buy {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
  transition: background 0.15s;
  text-decoration: none;
}
.card-buy:hover { background: #fbbf24; text-decoration: none; color: #000; }

/* ── Search Page ── */
.search-page { padding: 2rem 1.25rem; }
.search-page .search-bar { margin: 0 auto 2rem; }

#search-results-count {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.no-results h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* ── Advanced Search ── */
.advanced-page { padding: 2rem 1.25rem; }
.advanced-page h1 { font-size: 2rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.advanced-page h1 span { color: var(--accent); }
.advanced-page .subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.filter-group label.group-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.checkbox-list { display: flex; flex-direction: column; gap: 0.35rem; }

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.checkbox-list label:hover { color: var(--text); }

.checkbox-list input[type=checkbox] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.filter-group select,
.filter-group input[type=number],
.filter-group input[type=text] {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--accent); }
.filter-group select option { background: var(--bg-card); }

.price-range, .year-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.price-range input, .year-range input {
  flex: 1;
  min-width: 0;
}
.range-sep { color: var(--text-faint); font-size: 0.8rem; }

.filter-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #fbbf24; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* ── Sort Bar ── */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.sort-bar select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 0;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pagination button:hover,
.pagination button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.pagination button.active { font-weight: 700; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.8;
}

footer .footer-brand {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

footer p { max-width: 600px; margin: 0.25rem auto; }

footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.hidden { display: none !important; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .navbar-inner { gap: 1rem; }
  .navbar-nav { gap: 0; }
  .navbar-nav a { padding: 0.35rem 0.5rem; font-size: 0.8rem; }

  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.8rem; }

  .models-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }

  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .navbar-nav { display: none; }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
  .grade-pills { gap: 0.35rem; }
  .grade-pill { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
  .filter-grid { grid-template-columns: 1fr; }
}

/* ── Friend Link ── */
.nav-friend {
  color: var(--accent) !important;
  font-weight: 600;
  border: 1px solid var(--accent);
  padding: .2rem .6rem;
  border-radius: 4px;
  transition: background .2s;
}
.nav-friend:hover { background: var(--accent-glow); text-decoration: none !important; }
