/* ==========================================================================
   ShiftyBuilds — Components
   Buttons, cards, forms, badges, tables, notifications, accordion, spinner
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-bright); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-bright); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(248,113,113,0.4);
}
.btn-danger:hover:not(:disabled) { background: rgba(248,113,113,0.1); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.02rem; }

.btn-discord {
  background: #5865F2;
  color: #fff;
}
.btn-discord:hover:not(:disabled) { background: #6f78f5; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--border-light); }

/* ---------- Build Card ---------- */
.build-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.build-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}

.build-card__image {
  aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.build-card__image img { width: 100%; height: 100%; object-fit: cover; }

.build-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.build-card__name { margin: 0; font-size: 1.2rem; }
.build-card__desc { font-size: 0.9rem; margin-bottom: var(--space-2); }

.spec-line {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: var(--space-1) 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-muted);
}
.spec-line:last-child { border-bottom: none; }
.spec-line span:first-child { color: var(--text-faint); }
.spec-line span:last-child { color: var(--text); text-align: right; }

.build-card__price {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin: var(--space-2) 0;
}

.build-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}
.build-card__actions .btn { flex: 1; }

/* ---------- Badges / Status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  background: var(--surface-2);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success { color: var(--success); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
.badge-warning { color: var(--warning); border-color: rgba(250,204,21,0.3); background: rgba(250,204,21,0.08); }
.badge-danger  { color: var(--danger); border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }
.badge-info    { color: var(--info); border-color: rgba(96,165,250,0.3); background: rgba(96,165,250,0.08); }
.badge-accent  { color: var(--accent-bright); border-color: rgba(139,92,246,0.35); background: rgba(139,92,246,0.1); }

/* ---------- Forms ---------- */
.field {
  margin-bottom: var(--space-5);
}
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}
.field .hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: var(--space-1);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
}
.field textarea { resize: vertical; min-height: 100px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.radio-group, .checkbox-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.radio-option, .checkbox-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.92rem;
  color: var(--text-muted);
}
.radio-option input, .checkbox-option input { accent-color: var(--accent); width: 16px; height: 16px; }

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: var(--space-1);
  display: none;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}
.field.has-error .field-error { display: block; }

/* ---------- Alerts / Notifications ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  font-size: 0.92rem;
  margin-bottom: var(--space-5);
}
.alert-error { border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.08); color: #ffd7d7; }
.alert-success { border-color: rgba(74,222,128,0.35); background: rgba(74,222,128,0.08); color: #d5ffe4; }
.alert-info { border-color: rgba(96,165,250,0.35); background: rgba(96,165,250,0.08); color: #dbeaff; }

.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 340px;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: toast-in 180ms ease;
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Loading ---------- */
.loading-state {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-4);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  justify-content: center;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-bright);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state, .error-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}
.empty-state h3, .error-state h3 { color: var(--text); }

/* ---------- Accordion (FAQ) ---------- */
.accordion-item {
  border-bottom: 1px solid var(--border);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  padding: var(--space-5) 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
}
.accordion-trigger .icon {
  font-family: var(--font-mono);
  color: var(--accent-bright);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: var(--space-4);
}
.accordion-trigger[aria-expanded="true"] .icon { transform: rotate(45deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}
.accordion-panel p { padding-bottom: var(--space-5); margin: 0; }

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}
.data-table td {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.data-table tr:hover td { color: var(--text); }
.data-table td a { color: var(--accent-bright); font-weight: 600; }

/* ---------- Progress / Order status ---------- */
.status-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: var(--space-6) 0;
}
.status-step {
  flex: 1;
  min-width: 110px;
  text-align: center;
  position: relative;
  padding-top: var(--space-5);
}
.status-step::before {
  content: '';
  position: absolute;
  top: 8px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}
.status-step:first-child::before { display: none; }
.status-step .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-light);
  margin: 0 auto var(--space-2);
  position: relative;
  z-index: 1;
}
.status-step.done .dot { background: var(--accent); border-color: var(--accent); }
.status-step.done::before { background: var(--accent); }
.status-step.current .dot { border-color: var(--accent-bright); box-shadow: 0 0 0 4px rgba(139,92,246,0.15); }
.status-step .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.status-step.done .label, .status-step.current .label { color: var(--text); }

/* ---------- Stat / Summary rows ---------- */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-faint); }
.summary-row .value { color: var(--text); font-weight: 600; }
.summary-row.total { font-size: 1.15rem; padding-top: var(--space-4); }
.summary-row.total .value { color: var(--accent-bright); font-family: var(--font-mono); }

/* ---------- Step indicator (process) ---------- */
.process-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 480px;
}
.process-step {
  display: flex;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  position: relative;
}
.process-step::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 0;
  width: 1px;
  background: var(--border-light);
}
.process-step:last-child::before { display: none; }
.process-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-dim);
  background: var(--surface-2);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.process-text h4 { margin: 0 0 var(--space-1); font-size: 1.02rem; }
.process-text p { margin: 0; font-size: 0.9rem; }
