/**
 * Manufacturing Wizard Styles
 */

/* Overlay - full screen backdrop */
.manufacturing-wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* Main wizard container */
.manufacturing-wizard {
  background: var(--bg-primary);
  border-radius: 8px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.wizard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.wizard-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.wizard-project {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.wizard-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Content area */
.wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* Wizard Steps */
.wizard-step {
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.wizard-step.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.wizard-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
}

.wizard-step-header.clickable {
  cursor: pointer;
}

.wizard-step-header.clickable:hover {
  background: var(--bg-hover);
}

.wizard-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.wizard-step.active .wizard-step-number {
  background: var(--accent);
  color: white;
}

.wizard-step.complete .wizard-step-number {
  background: var(--success);
  color: white;
}

.wizard-step-check {
  stroke-width: 3px;
}

.wizard-step-title-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-step-title {
  font-weight: 500;
  color: var(--text-primary);
}

.wizard-step-summary {
  font-size: 12px;
  color: var(--text-secondary);
}

.wizard-step-chevron {
  color: var(--text-secondary);
  transform: rotate(-90deg);
  transition: transform 0.2s;
}

.wizard-step.active .wizard-step-chevron {
  transform: rotate(0deg);
}

.wizard-step-content {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Step Actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.step-btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.step-btn.primary {
  background: var(--accent);
  color: white;
  border: none;
}

.step-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.step-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.step-btn.secondary:hover {
  background: var(--bg-hover);
}

.step-btn.purchase {
  background: var(--success);
  color: white;
  border: none;
}

.step-btn.purchase:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Select Builds Step */
.select-builds-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Uncommitted warning */
.uncommitted-warning {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: 6px;
}

.uncommitted-warning-icon {
  color: var(--warning);
  flex-shrink: 0;
}

.uncommitted-warning-content {
  flex: 1;
}

.uncommitted-warning-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.uncommitted-warning-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.uncommitted-files {
  margin-top: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.uncommitted-file {
  padding: 2px 0;
}

.uncommitted-files-overflow {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.uncommitted-warning-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.warning-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.warning-btn.primary {
  background: var(--accent);
  color: white;
  border: none;
}

.warning-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.warning-btn.secondary:hover {
  background: var(--bg-hover);
}

/* Git status loading */
.git-status-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Builds selection */
.builds-selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.builds-selection-title {
  font-weight: 500;
  color: var(--text-primary);
}

.builds-selection-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.builds-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.builds-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.build-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.build-item:hover {
  background: var(--bg-hover);
}

.build-item.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.build-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-subtle);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.build-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.build-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-name {
  font-weight: 500;
  color: var(--text-primary);
}

.build-entry {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.build-last-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: capitalize;
}

.build-last-status.status-success {
  background: var(--success-bg);
  color: var(--success);
}

.build-last-status.status-failed {
  background: var(--error-bg);
  color: var(--error);
}

.build-last-status.status-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Build Review Step */
.build-review-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.build-review-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.build-review-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.progress-bar {
  width: 120px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.build-review-warning {
  font-size: 12px;
  color: var(--warning);
}

.build-review-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Build Review Card */
.build-review-card {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.build-review-card.status-confirmed {
  border-color: var(--success);
}

.build-review-card.status-failed {
  border-color: var(--error);
}

.build-review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
}

.build-review-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-spinner {
  animation: spin 1s linear infinite;
  color: var(--accent);
}

.status-ready {
  color: var(--warning);
}

.status-confirmed {
  color: var(--success);
}

.status-failed {
  color: var(--error);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.build-review-status-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.build-review-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.build-retry-btn,
.build-confirm-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.build-retry-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.build-confirm-btn {
  background: var(--accent);
  color: white;
  border: none;
}

.build-confirm-btn:hover {
  filter: brightness(1.1);
}

.build-confirmed-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--success);
  padding: 2px 8px;
  background: var(--success-bg);
  border-radius: 4px;
}

.build-review-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 12px;
}

.build-review-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.review-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.review-tab:hover {
  color: var(--text-primary);
}

.review-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.build-review-content {
  min-height: 200px;
  max-height: 400px;
  overflow: auto;
}

.review-bom-container {
  padding: 0;
}

.review-3d-container,
.review-layout-container {
  height: 300px;
}

.build-review-building,
.build-review-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 13px;
}

.building-spinner {
  animation: spin 1s linear infinite;
}

/* Export Step */
.export-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.export-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.export-directory-input {
  display: flex;
  gap: 8px;
}

.export-directory-input input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
}

.export-directory-input input::placeholder {
  color: var(--text-muted);
}

.browse-btn {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.browse-btn:hover {
  background: var(--bg-hover);
}

/* File types grid */
.file-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.file-type-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.file-type-option:hover {
  background: var(--bg-hover);
}

.file-type-option.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.file-type-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.file-type-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-subtle);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.file-type-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.file-type-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-type-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}

.file-type-description {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Cost Estimate Panel */
.cost-estimate-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
}

.cost-estimate-panel.loading,
.cost-estimate-panel.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100px;
  color: var(--text-secondary);
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

.cost-estimate-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.cost-title {
  font-weight: 600;
  color: var(--text-primary);
}

.cost-quantity {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cost-quantity input {
  width: 60px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  text-align: right;
}

.refresh-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.refresh-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.cost-label {
  color: var(--text-secondary);
  font-size: 13px;
}

.cost-value {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}

.cost-sub-breakdown {
  padding-left: 16px;
  margin-top: -4px;
  margin-bottom: 4px;
}

.cost-sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
}

.cost-total {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-bottom: 12px;
}

.cost-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cost-total-label {
  font-weight: 600;
  color: var(--text-primary);
}

.cost-total-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.cost-per-unit {
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.cost-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

/* Export error */
.export-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-size: 13px;
}

/* Export actions */
.export-actions {
  justify-content: space-between;
}

.export-buttons {
  display: flex;
  gap: 8px;
}

/* Spinner utility */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}
