/* build.css — combined Builds page (builder + saved builds), dark theme.
   Tokens (--primary-color #cc630d, --primary-hover #ff7300, --darker-bg #1d1d1d,
   --text-light, --transition) come from home.css, which loads first. */

/* ===== Page shell ===== */
.builds-page {
  min-height: calc(100vh - 73px);
  padding: 3rem 1.5rem 5rem;
  color: var(--text-light);
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(204, 99, 13, 0.13), transparent 60%),
    linear-gradient(180deg, var(--darker-bg) 0%, #141416 100%);
}

.builds-inner {
  max-width: 860px;
  margin: 0 auto;
}

.builds-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.builds-head h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0 0 0.4rem;
}

.builds-sub {
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ===== Messages ===== */
.builds-messages { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.builds-msg {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  text-align: center;
}
.builds-msg.success { background: rgba(46, 204, 113, 0.12); color: #86e3ab; border: 1px solid rgba(46, 204, 113, 0.3); }
.builds-msg.error   { background: rgba(231, 76, 60, 0.12);  color: #f1a8a0; border: 1px solid rgba(231, 76, 60, 0.3); }
.builds-msg.info    { background: rgba(52, 152, 219, 0.12); color: #9fcfef; border: 1px solid rgba(52, 152, 219, 0.3); }

/* ===== Tabs ===== */
.builds-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  margin-bottom: 1.75rem;
}

.builds-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.builds-tab:hover { color: var(--text-light); }

.builds-tab.active {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 6px 18px rgba(204, 99, 13, 0.3);
}

.builds-panel[hidden] { display: none; }

/* ===== Builder card ===== */
.form-container {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  padding: 2.25rem;
}

.form-section {
  margin-bottom: 1.5rem;
  padding: 1.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: var(--transition);
}

.form-section:hover { border-color: rgba(204, 99, 13, 0.35); }

.form-section h3 {
  margin: 0 0 1rem;
  color: var(--text-light);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.component-icon {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  vertical-align: middle;
}

.form-container label {
  font-weight: 600;
  margin: 0.5rem 0;
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

.help-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.84rem;
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

.help-text.error { color: #f1a8a0; }

/* Native inputs / selects (select gets replaced by Choices, but keep fallback) */
.form-container select,
.form-container input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.4rem;
  font-size: 0.95rem;
  font-family: inherit;
  background-color: rgba(0, 0, 0, 0.25);
  color: var(--text-light);
  transition: var(--transition);
}

.form-container select:focus,
.form-container input[type="text"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(204, 99, 13, 0.18);
  outline: none;
  background-color: rgba(0, 0, 0, 0.35);
}

.form-container input::placeholder { color: rgba(255, 255, 255, 0.4); }

.build-name-field { margin-bottom: 1.75rem; }
.build-name-input { font-size: 1.05rem !important; padding: 0.9rem 1rem !important; }

/* ===== Submit ===== */
.submit-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  margin-top: 2rem;
  box-shadow: 0 10px 26px rgba(204, 99, 13, 0.32);
  transition: var(--transition);
}

.submit-button:hover { background: var(--primary-hover); transform: translateY(-2px); }
.submit-button:active { transform: translateY(1px); }

/* ===== Progress tracker ===== */
.build-progress {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  position: relative;
}

.build-progress:before {
  content: '';
  position: absolute;
  top: 25px;
  left: 5%;
  right: 5%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
}

.progress-step { position: relative; z-index: 1; width: 50px; text-align: center; }

.step-icon {
  width: 50px;
  height: 50px;
  background: #26272a;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  transition: var(--transition);
}

.step-icon img { width: 24px; height: 24px; opacity: 0.45; transition: var(--transition); }

.step-label { font-size: 0.72rem; color: rgba(255, 255, 255, 0.5); font-weight: 600; transition: var(--transition); }

.progress-step.active .step-icon { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(204, 99, 13, 0.25); }
.progress-step.active .step-icon img { opacity: 1; }
.progress-step.active .step-label { color: var(--primary-hover); }

.progress-step.completed .step-icon { background: var(--primary-color); border-color: var(--primary-color); }
.progress-step.completed .step-icon img { filter: brightness(0) invert(1); opacity: 1; }

/* ===== Compatibility / error notes ===== */
.compatibility-info {
  background: rgba(52, 152, 219, 0.1);
  border-left: 4px solid #4a90e2;
  padding: 0.9rem 1rem;
  margin: 1.25rem 0 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}
.compatibility-info p { margin: 0; }
.compatibility-issue { background: rgba(231, 76, 60, 0.1); border-left-color: #e74c3c; }

.error-box {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-left: 4px solid #e74c3c;
  padding: 1.1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  color: #f1a8a0;
  font-size: 0.92rem;
}
.error-box a { color: var(--primary-hover); text-decoration: underline; font-weight: 600; }

/* ===== Price summary ===== */
.price-summary {
  background: rgba(204, 99, 13, 0.08);
  border: 1px solid rgba(204, 99, 13, 0.25);
  border-radius: 12px;
  padding: 1.4rem;
  margin-top: 2rem;
}
.price-summary h3 { color: var(--primary-hover); margin: 0 0 0.75rem; font-size: 1.15rem; }
.price-table { width: 100%; border-collapse: collapse; }
.price-table th, .price-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}
.price-table th { font-weight: 600; color: rgba(255, 255, 255, 0.55); }
.total-row td { font-weight: 800; color: var(--primary-hover); border-bottom: none; font-size: 1.05rem; }

/* ===== Choices.js dark overrides ===== */
.choices { margin-bottom: 0; }
.choices__inner {
  background-color: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  color: var(--text-light);
  min-height: 46px;
  padding: 9px 30px 5px 12px !important;
  box-sizing: border-box !important;
}
.is-focused .choices__inner, .is-open .choices__inner {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(204, 99, 13, 0.18);
}
.choices__list--single { color: var(--text-light); padding: 4px 0; }
.choices__placeholder { color: rgba(255, 255, 255, 0.4); opacity: 1; }
.choices__input { background-color: transparent !important; color: var(--text-light) !important; }
.choices[data-type*="select-one"]::after { border-color: rgba(255, 255, 255, 0.5) transparent transparent transparent; }

.choices__list--dropdown,
.choices__list[aria-expanded] {
  background-color: #232427 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  z-index: 999 !important;
}
.choices__list--dropdown .choices__item { color: rgba(255, 255, 255, 0.85); padding: 10px 12px; }
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: rgba(204, 99, 13, 0.18);
  color: var(--primary-hover);
}
.choices__list--dropdown .choices__input {
  background-color: rgba(0, 0, 0, 0.3) !important;
  color: var(--text-light) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.choices__list--dropdown.is-active { z-index: 9999 !important; }

/* ===== Saved builds grid ===== */
.builds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.build-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 3px solid var(--primary-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}
.build-card:hover { transform: translateY(-5px); border-color: rgba(204, 99, 13, 0.4); }

.build-card-header {
  padding: 1.1rem 1.3rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.build-card-header h3 { margin: 0; color: var(--text-light); font-size: 1.1rem; font-weight: 700; }

.build-price {
  background: var(--primary-color);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.build-card-body { padding: 1.3rem; }
.build-specs { display: flex; flex-direction: column; gap: 0.7rem; }
.spec-item { display: flex; align-items: center; gap: 0.7rem; color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }
.spec-item i { color: var(--primary-hover); width: 20px; text-align: center; }

.build-card-footer {
  padding: 0.9rem 1.3rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.timestamp { color: rgba(255, 255, 255, 0.5); font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }

/* ===== Empty / login states ===== */
.empty-builds {
  text-align: center;
  padding: 3.5rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.7);
}
.empty-icon { font-size: 2.6rem; color: var(--primary-hover); margin-bottom: 1.25rem; }
.empty-builds h3 { margin: 0 0 0.6rem; color: var(--text-light); }
.empty-builds p { margin: 0 auto 1.75rem; max-width: 380px; }

.start-building-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(204, 99, 13, 0.32);
  transition: var(--transition);
}
.start-building-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .form-container { padding: 1.5rem; }
  .builds-head h1 { font-size: 2rem; }
  .build-progress { overflow-x: auto; padding-bottom: 12px; gap: 0.5rem; }
  .build-progress:before { left: 0; right: 0; }
  .builds-tab span, .builds-tab { font-size: 0.88rem; }
}
