/* ==========================================================================
   JetPC PC Builder — Shared Dark Theme Styles
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-card:       #1c2333;
  --bg-hover:      #222b3a;
  --border:        #30363d;
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --accent:        #58a6ff;
  --accent-hover:  #79b8ff;
  --green:         #3fb950;
  --red:           #f85149;
  --orange:        #d29922;
  --yellow:        #e3b341;
  --radius:        8px;
  --shadow:        0 2px 8px rgba(0,0,0,.45);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ---------- Layout Helpers ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid { display: grid; gap: 20px; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: var(--text-primary);
}
.navbar-brand img { height: 36px; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius); font-size: 1rem;
  font-weight: 600; cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 80px 24px 60px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.hero h1 { font-size: 2.8rem; margin-bottom: 16px; line-height: 1.2; }
.hero p { font-size: 1.15rem; color: var(--text-secondary); max-width: 640px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Section Titles ---------- */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2rem; margin-bottom: 8px; }
.section-title p { color: var(--text-secondary); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: all .25s; cursor: pointer; position: relative; overflow: hidden;
}
.card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.card.selected { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.card-img { width: 100%; height: 160px; object-fit: cover; background: var(--bg-hover); border-radius: 6px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: .85rem; }
.card-title { font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.card-subtitle { font-size: .8rem; color: var(--text-secondary); margin-bottom: 8px; }
.card-price { font-size: 1.25rem; font-weight: 700; color: var(--green); }

/* ---------- Stock Badge ---------- */
.stock-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
}
.stock-in   { background: rgba(63,185,80,.15); color: var(--green); }
.stock-out  { background: rgba(248,81,73,.15); color: var(--red); }
.stock-unk  { background: rgba(227,179,65,.15); color: var(--yellow); }

/* ---------- Category Grid (Homepage) ---------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding: 40px 0 60px; }
.category-card { text-align: center; padding: 32px 20px; }
.category-icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-card h3 { font-size: 1rem; margin-bottom: 4px; }
.category-card p { font-size: .85rem; color: var(--text-secondary); }

/* ---------- Feature Grid (Homepage) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; padding: 40px 0 60px; }
.feature-card { text-align: center; padding: 36px 24px; }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: .9rem; }

/* ---------- Build Presets (Homepage) ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; padding: 40px 0 60px; }
.preset-card { text-align: center; }
.preset-card .price-tag { font-size: 1.8rem; font-weight: 700; color: var(--accent); margin: 12px 0; }
.preset-card ul { text-align: left; list-style: none; margin: 16px 0; }
.preset-card li { padding: 4px 0; font-size: .85rem; color: var(--text-secondary); }

/* ---------- Price Comparison Table (Builder) ---------- */
.price-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.price-row:last-child { border-bottom: none; }
.price-row.cheapest { background: rgba(63,185,80,.1); margin: 2px -8px; padding: 6px 8px; border-radius: 4px; }
.cheapest-label { font-size: .7rem; color: var(--green); font-weight: 600; text-transform: uppercase; }

/* ---------- Error / Warning Banner ---------- */
.banner { padding: 12px 20px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.banner-error { background: rgba(248,81,73,.12); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.banner-warning { background: rgba(227,179,65,.12); color: var(--yellow); border: 1px solid rgba(227,179,65,.3); }
.banner-success { background: rgba(63,185,80,.12); color: var(--green); border: 1px solid rgba(63,185,80,.3); }

/* ---------- Form ---------- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-control {
  width: 100%; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-primary); color: var(--text-primary); font-size: .95rem; transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }

/* ---------- Summary Panel (Builder) ---------- */
.summary-panel {
  position: sticky; top: 80px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }
.summary-total { border-top: 2px solid var(--border); margin-top: 10px; padding-top: 12px; font-size: 1.25rem; font-weight: 700; color: var(--accent); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 40px 0 24px; margin-top: 60px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-section h4 { margin-bottom: 12px; }
.footer-section p, .footer-section a { font-size: .85rem; color: var(--text-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .nav-links { gap: 16px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .35s ease both; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
