/**
 * PCB Upload Wizard Styles
 * Professional, modern design for Alledio dashboard
 * 
 * @package Alledio Production Dashboard
 * @version 3.0
 */

/* ==================== Variables ==================== */

.wizard-overlay {
  --wizard-primary: #2d8998;
  --wizard-primary-dark: #246b78;
  --wizard-primary-light: #e8f4f6;
  --wizard-primary-rgb: 45, 137, 152;
  --wizard-success: #34a853;
  --wizard-success-rgb: 52, 168, 83;
  --wizard-error: #ea4335;
  --wizard-error-rgb: 234, 67, 53;
  --wizard-warning: #f9ab00;
  --wizard-warning-rgb: 249, 171, 0;
  --wizard-info: #4285f4;
  --wizard-info-rgb: 66, 133, 244;
  --wizard-text: #202124;
  --wizard-text-secondary: #5f6368;
  --wizard-text-muted: #80868b;
  --wizard-bg: #ffffff;
  --wizard-bg-secondary: #f8f9fa;
  --wizard-bg-tertiary: #f1f3f4;
  --wizard-border: #e8eaed;
  --wizard-border-dark: #dadce0;
  --wizard-shadow: 0 1px 3px rgba(60,64,67,0.15);
  --wizard-shadow-lg: 0 8px 28px rgba(60,64,67,0.22), 0 2px 8px rgba(60,64,67,0.1);
  --wizard-radius: 8px;
  --wizard-radius-sm: 4px;
  --wizard-radius-lg: 12px;
}

/* ==================== Body Lock ==================== */

body.wizard-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ==================== Overlay & Container ==================== */

.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(32, 33, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayFadeIn 0.25s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wizard-container {
  background: var(--wizard-bg);
  border-radius: 14px;
  width: 95vw;
  max-width: 980px;
  height: 88vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--wizard-shadow-lg);
  overflow: hidden;
  animation: containerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes containerSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== Header ==================== */

.wizard-header {
  background: linear-gradient(to bottom, #ffffff, #fafbfc);
  padding: 0;
  border-bottom: 1px solid var(--wizard-border);
  flex-shrink: 0;
  position: relative;
}

/* Accent bar at the very top */
.wizard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wizard-primary), #3ab0c2, var(--wizard-primary));
  border-radius: 14px 14px 0 0;
}

.wizard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 0;
  margin-bottom: 14px;
}

.wizard-title h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--wizard-text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wizard-title h2 .title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--wizard-primary-light);
  border-radius: 7px;
  color: var(--wizard-primary);
  flex-shrink: 0;
}

.wizard-close-btn {
  background: none;
  border: none;
  color: var(--wizard-text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

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

/* ==================== Step Indicators ==================== */

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 24px 14px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: default;
  transition: all 0.25s ease;
}

.wizard-step .step-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.wizard-step.accessible {
  cursor: pointer;
}

.wizard-step.accessible:hover .step-inner {
  opacity: 0.65;
}

.wizard-step.active .step-inner {
  opacity: 1;
}

.wizard-step.completed .step-inner {
  opacity: 0.85;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
}

.step-number .step-num-text {
  transition: opacity 0.2s;
}

.step-number .step-check-icon {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-step.active .step-number {
  background: var(--wizard-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--wizard-primary-rgb), 0.35);
}

.wizard-step.completed .step-number {
  background: var(--wizard-success);
  color: #fff;
}

.wizard-step.completed .step-number .step-num-text {
  opacity: 0;
}

.wizard-step.completed .step-number .step-check-icon {
  opacity: 1;
}

.step-title {
  font-size: 12.5px;
  color: var(--wizard-text-muted);
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.25s;
}

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

.wizard-step.completed .step-title {
  color: var(--wizard-text-secondary);
}

.step-connector {
  width: 48px;
  height: 2px;
  background: var(--wizard-border);
  transition: background 0.4s ease;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
  flex-shrink: 0;
}

.step-connector.completed {
  background: var(--wizard-success);
}

/* ==================== Body ==================== */

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--wizard-bg-secondary);
}

.wizard-page {
  display: none;
}

.wizard-page.active {
  display: block;
  animation: pageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wizard-page.active.slide-back {
  animation: pageSlideBack 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pageSlideBack {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.page-content {
  max-width: 820px;
  margin: 0 auto;
}

.page-content h3 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--wizard-text);
  letter-spacing: -0.3px;
}

.page-description {
  margin: 0 0 20px 0;
  color: var(--wizard-text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ==================== File Upload (Page 1) ==================== */

.main-drop-zone {
  position: relative;
  min-height: 100%;
}

.main-drop-zone.drag-over .drop-overlay {
  opacity: 1;
  pointer-events: auto;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45, 137, 152, 0.95);
  border-radius: var(--wizard-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.drop-overlay-content {
  text-align: center;
  color: #fff;
}

.drop-overlay-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  animation: dropPulse 1.5s ease-in-out infinite;
}

@keyframes dropPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.drop-overlay-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.drop-overlay-hint {
  font-size: 13px;
  opacity: 0.85;
}

.upload-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.upload-title h3 {
  margin: 0 0 2px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--wizard-text);
}

.upload-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--wizard-text-muted);
}

.btn-upload-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--wizard-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(var(--wizard-primary-rgb), 0.2);
}

.btn-upload-all:hover {
  background: var(--wizard-primary-dark);
  box-shadow: 0 2px 6px rgba(var(--wizard-primary-rgb), 0.3);
}

.file-slots-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .file-slots-container {
    grid-template-columns: 1fr;
  }
}

.file-slot {
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.file-slot:hover {
  border-color: rgba(var(--wizard-primary-rgb), 0.35);
  box-shadow: 0 2px 8px rgba(var(--wizard-primary-rgb), 0.06);
}

.slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--wizard-bg);
  border-bottom: 1px solid var(--wizard-border);
}

.slot-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.slot-badge.fab { background: var(--wizard-primary); color: #fff; }
.slot-badge.asm { background: var(--wizard-success); color: #fff; }
.slot-badge.src { background: var(--wizard-warning); color: #fff; }
.slot-badge.des { background: #8e44ad; color: #fff; }

.slot-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--wizard-text);
}

.slot-required {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--wizard-error);
  font-weight: 600;
}

.slot-optional {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--wizard-text-muted);
}

.slot-content {
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-content:hover {
  background: var(--wizard-bg-secondary);
}

.slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--wizard-text-muted);
  border: 2px dashed var(--wizard-border-dark);
  border-radius: var(--wizard-radius);
  padding: 14px 20px;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}

.slot-content:hover .slot-empty {
  border-color: rgba(var(--wizard-primary-rgb), 0.4);
  background: rgba(var(--wizard-primary-rgb), 0.02);
}

.slot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wizard-text-muted);
  opacity: 0.45;
}

.slot-text {
  font-size: 12px;
}

.slot-file {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: var(--wizard-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--wizard-border);
}

.slot-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text-muted);
  flex-shrink: 0;
}

.slot-file-info {
  flex: 1;
  min-width: 0;
}

.slot-file-name {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--wizard-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.slot-file-size {
  font-size: 11px;
  color: var(--wizard-text-muted);
}

.slot-file-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.slot-file-status.status-pending,
.slot-file-status.status-checking {
  background: rgba(var(--wizard-warning-rgb), 0.12);
  color: #b8860b;
}

.slot-file-status.status-ready {
  background: rgba(var(--wizard-success-rgb), 0.12);
  color: var(--wizard-success);
}

.slot-file-status.status-reuse {
  background: rgba(var(--wizard-info-rgb), 0.12);
  color: var(--wizard-info);
}

.slot-file-status.status-staged {
  background: rgba(var(--wizard-info-rgb), 0.12);
  color: var(--wizard-info);
}

.slot-file-status.status-conflict {
  background: rgba(var(--wizard-error-rgb), 0.12);
  color: var(--wizard-error);
}

.slot-remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--wizard-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.slot-remove-btn:hover {
  color: var(--wizard-error);
  background: rgba(var(--wizard-error-rgb), 0.08);
}

/* ASM Files List */
.asm-files-list {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asm-files-list:empty {
  display: none;
}

.asm-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--wizard-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--wizard-border);
}

.asm-file-item .file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wizard-success);
  flex-shrink: 0;
}

.asm-file-item .file-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--wizard-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asm-file-item .file-size {
  font-size: 10.5px;
  color: var(--wizard-text-muted);
}

.asm-file-item .file-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.asm-file-item .file-remove-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--wizard-text-muted);
  cursor: pointer;
  border-radius: var(--wizard-radius-sm);
  transition: all 0.15s;
}

.asm-file-item .file-remove-btn:hover {
  color: var(--wizard-error);
  background: rgba(var(--wizard-error-rgb), 0.08);
}

/* Bulk mode banner */
.bulk-mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--wizard-primary-light);
  border: 1px solid rgba(var(--wizard-primary-rgb), 0.2);
  border-radius: 8px;
  margin-top: 14px;
  color: var(--wizard-primary-dark);
  font-size: 13px;
}

.bulk-mode-banner svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.bulk-mode-banner strong {
  font-weight: 600;
}

/* ==================== Device Type (Page 2) ==================== */

.device-type-section {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  padding: 20px;
}

.device-type-section .form-group {
  flex: 1;
  max-width: 340px;
  margin: 0;
}

.device-type-section .form-group label {
  margin-bottom: 6px;
}

.wizard-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--wizard-text);
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border-dark);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2380868b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wizard-select:hover {
  border-color: var(--wizard-primary);
}

.wizard-select:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 3px rgba(var(--wizard-primary-rgb), 0.1);
}

.device-type-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--wizard-bg-secondary);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  min-width: 200px;
}

.device-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--wizard-bg);
  padding: 6px;
  border: 1px solid var(--wizard-border);
}

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

.device-name {
  color: var(--wizard-text);
  font-size: 14px;
  font-weight: 500;
}

.device-short {
  color: var(--wizard-text-muted);
  font-size: 12px;
}

#createDeviceTypeBtn {
  margin-left: auto;
  padding: 10px 16px;
  font-size: 13px;
}

/* ==================== Variations (Page 3) ==================== */

.no-asm-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--wizard-primary-light);
  border-radius: var(--wizard-radius-lg);
  color: var(--wizard-primary-dark);
  font-size: 13.5px;
  border: 1px solid rgba(var(--wizard-primary-rgb), 0.15);
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(var(--wizard-primary-rgb), 0.12);
  border-radius: 8px;
  color: var(--wizard-primary);
  flex-shrink: 0;
}

.variations-list {
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  overflow: hidden;
}

.variation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--wizard-border);
  transition: background 0.15s;
}

.variation-row:last-child {
  border-bottom: none;
}

.variation-row:hover {
  background: var(--wizard-bg-secondary);
}

.variation-file {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.file-badge {
  padding: 3px 8px;
  background: rgba(var(--wizard-success-rgb), 0.1);
  color: var(--wizard-success);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.variation-file .file-name {
  font-size: 12.5px;
  color: var(--wizard-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.variation-select {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-add-variation {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--wizard-border-dark);
  background: var(--wizard-bg);
  color: var(--wizard-text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-add-variation:hover {
  border-color: var(--wizard-primary);
  color: var(--wizard-primary);
  background: var(--wizard-primary-light);
}

.auto-match-badge {
  font-size: 10.5px;
  color: var(--wizard-text-muted);
  background: var(--wizard-bg-tertiary);
  padding: 3px 8px;
  border-radius: var(--wizard-radius-sm);
  flex-shrink: 0;
}

.variation-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(var(--wizard-error-rgb), 0.05);
  border: 1px solid rgba(var(--wizard-error-rgb), 0.2);
  border-radius: var(--wizard-radius-lg);
  margin-top: 12px;
}

.error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(var(--wizard-error-rgb), 0.1);
  border-radius: 6px;
  color: var(--wizard-error);
  flex-shrink: 0;
}

.error-text {
  color: var(--wizard-error);
  font-size: 13px;
}

/* ==================== Project Info (Page 4) ==================== */

.project-info-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 18px;
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  margin-bottom: 20px;
}

.form-row {
  display: contents;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}

.form-group.full-width {
  flex: 2;
  min-width: 200px;
}

.form-group label {
  color: var(--wizard-text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group label .required {
  color: var(--wizard-error);
}

.form-group input {
  padding: 10px 12px;
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border-dark);
  border-radius: 8px;
  color: var(--wizard-text);
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 3px rgba(var(--wizard-primary-rgb), 0.1);
}

.field-hint {
  display: none;
}

.versions-section h4 {
  margin: 0 0 4px 0;
  color: var(--wizard-text);
  font-size: 15px;
  font-weight: 600;
}

.section-hint {
  color: var(--wizard-text-muted);
  font-size: 12.5px;
  margin: 0 0 12px 0;
}

.versions-table {
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  overflow: hidden;
}

.versions-header {
  display: grid;
  grid-template-columns: 28px 100px 60px 1fr 40px;
  gap: 8px;
  padding: 10px 14px;
  background: var(--wizard-bg-tertiary);
  font-size: 11px;
  color: var(--wizard-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.version-item {
  border-bottom: 1px solid var(--wizard-border);
}

.version-item:last-child {
  border-bottom: none;
}

.version-row {
  display: grid;
  grid-template-columns: 28px 100px 60px 1fr 40px;
  gap: 8px;
  padding: 10px 14px;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}

.version-row:hover {
  background: var(--wizard-bg-secondary);
}

.col-expand {
  display: flex;
  justify-content: center;
}

.expand-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wizard-bg-secondary);
  border: 1px solid var(--wizard-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--wizard-text-muted);
}

.expand-btn:hover {
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text);
}

.expand-icon {
  transition: transform 0.2s;
}

.version-item.expanded .expand-icon {
  transform: rotate(180deg);
}

.variation-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(var(--wizard-success-rgb), 0.1);
  color: var(--wizard-success);
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
}

.version-input {
  width: 100%;
  max-width: 60px;
  padding: 6px 8px;
  background: var(--wizard-bg-secondary);
  border: 1px solid var(--wizard-border-dark);
  border-radius: 6px;
  color: var(--wizard-text);
  font-size: 12.5px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.version-input:focus {
  outline: none;
  border-color: var(--wizard-primary);
  box-shadow: 0 0 0 2px rgba(var(--wizard-primary-rgb), 0.1);
}

.project-id-preview {
  display: block;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 11px;
  color: var(--wizard-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-status {
  display: flex;
  justify-content: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
}

.status-indicator.valid {
  background: rgba(var(--wizard-success-rgb), 0.12);
  color: var(--wizard-success);
}

.status-indicator.invalid {
  background: rgba(var(--wizard-error-rgb), 0.12);
  color: var(--wizard-error);
}

/* Expandable details */
.version-details {
  display: none;
  padding: 0 14px 12px 42px;
  background: var(--wizard-bg-secondary);
}

.version-item.expanded .version-details {
  display: block;
}

.details-title {
  font-size: 11px;
  color: var(--wizard-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.details-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--wizard-bg);
  border-radius: 8px;
  border: 1px solid var(--wizard-border);
}

.detail-file.detail-missing {
  border-color: rgba(var(--wizard-error-rgb), 0.25);
  background: rgba(var(--wizard-error-rgb), 0.02);
}

.detail-file.detail-none {
  opacity: 0.5;
}

.detail-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.detail-badge.fab { background: var(--wizard-primary); color: #fff; }
.detail-badge.asm { background: var(--wizard-success); color: #fff; }
.detail-badge.src { background: var(--wizard-warning); color: #fff; }
.detail-badge.des { background: #8e44ad; color: #fff; }

.detail-name {
  flex: 1;
  font-size: 11.5px;
  color: var(--wizard-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text-muted);
  flex-shrink: 0;
}

.detail-status.reuse {
  background: rgba(var(--wizard-info-rgb), 0.1);
  color: var(--wizard-info);
}

/* ==================== Upload Report (Page 5) ==================== */

.upload-log-container {
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  padding: 14px;
  height: 280px;
  overflow-y: auto;
  margin-bottom: 18px;
}

.upload-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  background: var(--wizard-bg-secondary);
}

.log-time {
  color: var(--wizard-text-muted);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.log-info {
  color: var(--wizard-text-secondary);
  border-left-color: var(--wizard-border-dark);
}

.log-success {
  color: #1e7e34;
  background: rgba(var(--wizard-success-rgb), 0.06);
  border-left-color: var(--wizard-success);
}

.log-error {
  color: #c5221f;
  background: rgba(var(--wizard-error-rgb), 0.06);
  border-left-color: var(--wizard-error);
}

.log-warning {
  color: #b8860b;
  background: rgba(var(--wizard-warning-rgb), 0.06);
  border-left-color: var(--wizard-warning);
}

.upload-progress-container {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: var(--wizard-bg-tertiary);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wizard-primary), var(--wizard-success));
  border-radius: 5px;
  transition: width 0.3s ease-out;
}

/* Animated progress bar during upload */
.progress-bar.uploading .progress-fill {
  background: linear-gradient(
    90deg,
    var(--wizard-primary) 0%,
    var(--wizard-success) 50%,
    var(--wizard-primary) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-text {
  color: var(--wizard-text);
  font-size: 14px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

.upload-summary {
  padding: 16px 20px;
  background: var(--wizard-bg);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
}

.summary-success,
.summary-errors {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.summary-success .success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--wizard-success-rgb), 0.1);
  color: var(--wizard-success);
}

.summary-success .success-text {
  color: var(--wizard-success);
  font-size: 13.5px;
  font-weight: 500;
}

.summary-errors .error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(var(--wizard-error-rgb), 0.1);
  color: var(--wizard-error);
}

.summary-errors .error-text {
  color: var(--wizard-error);
  font-size: 13.5px;
  font-weight: 500;
}

/* ==================== Footer ==================== */

.wizard-footer {
  background: var(--wizard-bg);
  border-top: 1px solid var(--wizard-border);
  flex-shrink: 0;
}

.wizard-preview {
  border-bottom: 1px solid var(--wizard-border);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  cursor: pointer;
}

.preview-title {
  color: var(--wizard-text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.preview-toggle {
  background: none;
  border: none;
  color: var(--wizard-text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.preview-toggle:hover {
  background: var(--wizard-bg-tertiary);
}

.preview-content {
  padding: 0 24px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-height: 80px;
  overflow-y: auto;
  transition: all 0.2s;
}

.preview-content.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.preview-section-title {
  color: var(--wizard-text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.preview-file,
.preview-project {
  font-size: 11.5px;
  color: var(--wizard-text-secondary);
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-file .badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  margin-right: 6px;
}

.preview-file .badge.fab { background: rgba(var(--wizard-primary-rgb), 0.1); color: var(--wizard-primary); }
.preview-file .badge.asm { background: rgba(var(--wizard-success-rgb), 0.1); color: var(--wizard-success); }
.preview-file .badge.src { background: rgba(var(--wizard-warning-rgb), 0.1); color: var(--wizard-warning); }
.preview-file .badge.des { background: rgba(142, 68, 173, 0.1); color: #8e44ad; }

.preview-empty {
  color: var(--wizard-text-muted);
  font-size: 11.5px;
  font-style: italic;
}

.wizard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
}

.nav-spacer {
  flex: 1;
}

/* ==================== Buttons ==================== */

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--wizard-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(var(--wizard-primary-rgb), 0.2);
}

.btn-primary:hover {
  background: var(--wizard-primary-dark);
  box-shadow: 0 2px 6px rgba(var(--wizard-primary-rgb), 0.3);
}

.btn-primary:disabled {
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary.btn-upload {
  background: var(--wizard-success);
  box-shadow: 0 1px 3px rgba(var(--wizard-success-rgb), 0.2);
}

.btn-primary.btn-upload:hover {
  background: #2d9249;
  box-shadow: 0 2px 6px rgba(var(--wizard-success-rgb), 0.3);
}

.btn-secondary {
  background: var(--wizard-bg);
  color: var(--wizard-text-secondary);
  border: 1px solid var(--wizard-border-dark);
}

.btn-secondary:hover {
  background: var(--wizard-bg-secondary);
  color: var(--wizard-text);
  border-color: var(--wizard-text-muted);
}

.btn-icon {
  margin-right: 2px;
}

/* ==================== Resume Dialog ==================== */

.wizard-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(32, 33, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wizard-dialog .dialog-content {
  background: var(--wizard-bg);
  border-radius: var(--wizard-radius-lg);
  padding: 28px 36px;
  max-width: 420px;
  min-width: 320px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--wizard-border);
  animation: containerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wizard-dialog .dialog-content h3 {
  margin: 0 0 12px 0;
  color: var(--wizard-text);
  font-size: 18px;
  font-weight: 600;
}

.wizard-dialog .dialog-content p {
  margin: 0 0 24px 0;
  color: var(--wizard-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.wizard-dialog .dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.wizard-dialog .dialog-actions .btn-secondary {
  background: var(--wizard-bg-tertiary);
  color: var(--wizard-text);
  border: 1px solid var(--wizard-border-dark);
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.wizard-dialog .dialog-actions .btn-secondary:hover {
  background: var(--wizard-border);
}

.wizard-dialog .dialog-actions .btn-primary {
  background: var(--wizard-primary);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(var(--wizard-primary-rgb), 0.2);
}

.wizard-dialog .dialog-actions .btn-primary:hover {
  background: var(--wizard-primary-dark);
}

/* Close dialog icon */
.wizard-dialog .dialog-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: var(--wizard-primary-light);
  border-radius: 12px;
  color: var(--wizard-primary);
}

/* Stacked dialog actions (Save / Discard / Cancel) */
.wizard-dialog .dialog-actions-stacked {
  flex-direction: column;
  gap: 8px;
}

.wizard-dialog .dialog-actions-stacked .btn-primary,
.wizard-dialog .dialog-actions-stacked .btn-secondary {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wizard-dialog .dialog-actions-stacked .btn-danger {
  color: var(--wizard-error);
  border-color: rgba(var(--wizard-error-rgb), 0.3);
  background: rgba(var(--wizard-error-rgb), 0.04);
}

.wizard-dialog .dialog-actions-stacked .btn-danger:hover {
  background: rgba(var(--wizard-error-rgb), 0.08);
  border-color: rgba(var(--wizard-error-rgb), 0.5);
  color: #c5221f;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
  .wizard-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .wizard-header::before {
    border-radius: 0;
  }

  .wizard-steps {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .step-title {
    display: none;
  }

  .file-slots-container {
    grid-template-columns: 1fr;
  }

  .device-type-section {
    flex-direction: column;
  }

  .device-type-section .form-group {
    max-width: none;
    width: 100%;
  }

  #createDeviceTypeBtn {
    margin-left: 0;
  }

  .project-info-form {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
    min-width: auto;
  }

  .preview-content {
    grid-template-columns: 1fr;
  }

  .versions-header,
  .version-row {
    grid-template-columns: 24px 80px 50px 1fr 32px;
    gap: 4px;
    font-size: 11px;
    padding: 8px 10px;
  }

  .version-details {
    padding: 0 10px 8px 34px;
  }
}

/* ==================== Scrollbar ==================== */

.wizard-body::-webkit-scrollbar,
.upload-log-container::-webkit-scrollbar,
.preview-content::-webkit-scrollbar {
  width: 5px;
}

.wizard-body::-webkit-scrollbar-track,
.upload-log-container::-webkit-scrollbar-track,
.preview-content::-webkit-scrollbar-track {
  background: transparent;
}

.wizard-body::-webkit-scrollbar-thumb,
.upload-log-container::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb {
  background: var(--wizard-border-dark);
  border-radius: 3px;
}

.wizard-body::-webkit-scrollbar-thumb:hover,
.upload-log-container::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover {
  background: var(--wizard-text-muted);
}

/* ==================== Combined ZIP Processing Overlay ==================== */

.combined-zip-processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--wizard-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.processing-content {
  text-align: center;
  padding: 40px;
}

.processing-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--wizard-border);
  border-top-color: var(--wizard-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.processing-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--wizard-text);
  margin-bottom: 8px;
}

.processing-filename {
  font-size: 13px;
  color: var(--wizard-text-secondary);
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  background: var(--wizard-bg-secondary);
  padding: 6px 12px;
  border-radius: var(--wizard-radius-sm);
  display: inline-block;
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.processing-hint {
  font-size: 12px;
  color: var(--wizard-text-muted);
}
