/* =========================================================
   Design a Gaming PC — styles just for this page.
   A budget slider, an animated build preview, part-picker cards for six
   categories, and a simple educational "bottleneck simulator" that shows
   which part would hold the others back. All values in js/gaming-pc.js
   are made up for teaching purposes, not real benchmark numbers.
   ========================================================= */

.pc-builder-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 820px) {
  .pc-builder-wrap {
    grid-template-columns: 1fr;
  }
}

.budget-panel,
.preview-panel,
.parts-section,
.bottleneck-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.budget-panel {
  grid-column: 1 / -1;
}

.parts-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.bottleneck-panel {
  grid-column: 1 / -1;
}

.pc-builder-wrap h2 {
  font-size: 0.85rem;
  margin: 0 0 1rem;
  color: var(--text);
}

/* ---------- Budget ---------- */

.budget-slider-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.budget-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--neon-yellow);
  height: 6px;
  cursor: pointer;
}

.budget-amount {
  font-family: 'Press Start 2P', sans-serif;
  font-size: 1rem;
  color: var(--neon-yellow);
  min-width: 6.5ch;
  text-align: right;
}

.budget-status {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.budget-status.over {
  color: #ff8fa8;
  border-color: #ff3ec9;
  background: rgba(255, 62, 201, 0.08);
}

.budget-status.under {
  color: #7fffcf;
  border-color: var(--neon-green);
  background: rgba(57, 255, 136, 0.06);
}

/* ---------- Build preview ---------- */

.preview-stage {
  display: flex;
  justify-content: center;
}

.pc-svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.preview-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0.75rem 0 0;
}

/* RGB parts pulse gently through colors on their own; JS also sets a
   base fill per tier so higher tiers glow brighter. */
#rgbStrip,
#gpuGlow {
  animation: rgb-pulse 3.5s ease-in-out infinite;
}

@keyframes rgb-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

#coolerBlades,
#frontBlades {
  transform-origin: center;
  transform-box: fill-box;
  animation: fan-spin 1.4s linear infinite;
}

.pc-svg.cooling-high #coolerBlades {
  animation-duration: 0.6s;
}

.pc-svg.cooling-low #coolerBlades {
  animation-duration: 2.4s;
}

@keyframes fan-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Parts ---------- */

.part-category h3 {
  font-size: 0.75rem;
  color: var(--text);
  margin: 0 0 0.25rem;
}

.part-category .part-category-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0 0 0.85rem;
}

.part-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}

.part-card {
  text-align: left;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.part-card:hover {
  transform: translateY(-2px);
}

.part-card.selected {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.part-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.part-card-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.part-card-price {
  font-size: 0.75rem;
  color: var(--neon-yellow);
  white-space: nowrap;
}

.part-card-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---------- Bottleneck simulator ---------- */

.bottleneck-intro {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.meter-row {
  display: grid;
  grid-template-columns: 130px 1fr 3ch;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.meter-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.meter-cpu { background: linear-gradient(90deg, #39c3ff, #00f5d4); }
.meter-gpu { background: linear-gradient(90deg, #b967ff, #ff3ec9); }
.meter-ram { background: linear-gradient(90deg, #ffd60a, #ff9e2c); }
.meter-storage { background: linear-gradient(90deg, #39ff88, #00c46a); }
.meter-cooling { background: linear-gradient(90deg, #7fdcff, #3a8fff); }

.meter-value {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
}

.bottleneck-verdict {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
}

.bottleneck-verdict .verdict-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--neon-yellow);
}
