/* ============================================================
   Build My PC — Auto Build Modal  v4.2.0
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────────── */
.bmpc-ab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 10300;
  backdrop-filter: blur(3px);
}

/* ── Modal panel ─────────────────────────────────────────────── */
.bmpc-ab-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: 92%;
  max-width: 540px;
  max-height: 92vh;
  background: #13131a;
  border: 1px solid #2a2a36;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  z-index: 10301;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.bmpc-ab-modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Header ──────────────────────────────────────────────────── */
.bmpc-ab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a0a2e 0%, #0a1a3e 100%);
  border-bottom: 1px solid #2a2a36;
  flex-shrink: 0;
}
.bmpc-ab-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #00aaff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bmpc-ab-icon { font-size: 18px; }
.bmpc-ab-close {
  background: none;
  border: none;
  color: #666;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color .15s;
}
.bmpc-ab-close:hover { color: #fff; }

/* ── Scrollable body ─────────────────────────────────────────── */
.bmpc-ab-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.bmpc-ab-body::-webkit-scrollbar { width: 4px; }
.bmpc-ab-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* ── Field wrapper ───────────────────────────────────────────── */
.bmpc-ab-field { display: flex; flex-direction: column; gap: 8px; }
.bmpc-ab-field--inline { flex-direction: row; align-items: center; gap: 12px; }
.bmpc-ab-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #888;
  text-transform: uppercase;
}
.bmpc-ab-hint {
  font-size: 11px;
  color: #555;
  margin: 0;
  line-height: 1.4;
}

/* ── Budget input row ────────────────────────────────────────── */
.bmpc-ab-budget-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1e2a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 14px;
}
.bmpc-ab-currency {
  font-size: 12px;
  font-weight: 700;
  color: #00aaff;
}
.bmpc-ab-budget-num {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  width: 100%;
}
.bmpc-ab-budget-num::-webkit-outer-spin-button,
.bmpc-ab-budget-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bmpc-ab-budget-num[type=number] { -moz-appearance: textfield; }

/* ── Slider ──────────────────────────────────────────────────── */
.bmpc-ab-slider {
  width: 100%;
  accent-color: #00aaff;
  height: 4px;
  cursor: pointer;
}
.bmpc-ab-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #555;
  margin-top: -4px;
}

/* ── Budget preset buttons ───────────────────────────────────── */
.bmpc-ab-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bmpc-ab-preset {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #2a2a36;
  border-radius: 9999px;
  background: #1a1a26;
  color: #888;
  cursor: pointer;
  transition: all .15s;
}
.bmpc-ab-preset:hover { border-color: #00aaff; color: #00aaff; }
.bmpc-ab-preset.is-active { background: #00aaff; color: #fff; border-color: #00aaff; }

/* ── Toggle groups (condition / brand) ───────────────────────── */
.bmpc-ab-toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.bmpc-ab-toggle {
  flex: 1;
  min-width: 100px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid #2a2a36;
  border-radius: 8px;
  background: #1a1a26;
  color: #888;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.bmpc-ab-toggle:hover { border-color: #555; color: #ccc; }
.bmpc-ab-toggle.is-active { border-color: #00aaff; background: rgba(0, 170, 255, 0.12); color: #00aaff; }

/* ── GPU toggle switch ───────────────────────────────────────── */
.bmpc-ab-switch { position: relative; cursor: pointer; flex-shrink: 0; }
.bmpc-ab-switch input { display: none; }
.bmpc-ab-switch__track {
  display: block;
  width: 42px;
  height: 22px;
  background: #333;
  border-radius: 11px;
  position: relative;
  transition: background .2s;
}
.bmpc-ab-switch__track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
}
.bmpc-ab-switch input:checked ~ .bmpc-ab-switch__track { background: #00aaff; }
.bmpc-ab-switch input:checked ~ .bmpc-ab-switch__track::after { left: 22px; }
.bmpc-ab-gpu-label { font-size: 12px; color: #888; flex: 1; }

/* ── Component chips ─────────────────────────────────────────── */
.bmpc-ab-components { display: flex; flex-wrap: wrap; gap: 6px; }
.bmpc-ab-part {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 170, 255, 0.1);
  border: 1px solid rgba(0, 170, 255, 0.25);
  border-radius: 9999px;
  color: #7dd3fc;
}
.bmpc-ab-part.is-disabled {
  background: rgba(255, 60, 60, 0.08);
  border-color: rgba(255, 60, 60, 0.2);
  color: #f87171;
  text-decoration: line-through;
}

/* ── Budget allocation preview ───────────────────────────────── */
.bmpc-ab-alloc {
  font-size: 11px;
  color: #666;
  margin-bottom: 10px;
}
.bmpc-ab-alloc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bmpc-ab-alloc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bmpc-ab-alloc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #1e1e26;
}
.bmpc-ab-alloc-part { color: #666; }
.bmpc-ab-alloc-val  { color: #00aaff; font-weight: 700; }

/* ── Footer & run button ─────────────────────────────────────── */
.bmpc-ab-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid #1e1e2a;
  background: #0e0e16;
}
.bmpc-ab-run-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0055cc 0%, #00aaff 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity .2s, transform .1s;
  box-shadow: 0 4px 16px rgba(0, 170, 255, 0.3);
}
.bmpc-ab-run-btn:hover:not(:disabled) { opacity: 0.9; }
.bmpc-ab-run-btn:active:not(:disabled) { transform: scale(0.98); }
.bmpc-ab-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Auto Build trigger button in header ─────────────────────── */
#bmpc-auto-build-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #0055cc 0%, #00aaff 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 10px rgba(0, 170, 255, 0.25);
  white-space: nowrap;
}
#bmpc-auto-build-btn:hover { opacity: 0.88; }
#bmpc-auto-build-btn:active { transform: scale(0.97); }
#bmpc-auto-build-btn .ab-btn-icon { font-size: 14px; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .bmpc-ab-modal { width: 100%; max-width: 100%; top: auto; bottom: 0; left: 0; transform: translateY(30px); border-radius: 18px 18px 0 0; max-height: 90vh; }
  .bmpc-ab-modal.is-open { transform: translateY(0); }
  .bmpc-ab-toggle-group { gap: 6px; }
  .bmpc-ab-toggle { min-width: 80px; font-size: 11px; padding: 8px 6px; }
  .bmpc-ab-budget-num { font-size: 18px; }
}
