/* ==========================================================================
   Star Wars D6 1E Creation Wizard
   Scoped to .creation-wizard.swd6 — mirrors d5e-wizard.css structure.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Outer wrapper
   --------------------------------------------------------------------------- */

.creation-wizard.swd6 {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

/* ---------------------------------------------------------------------------
   Step indicator — mirrors d5e-wizard.css layout
   --------------------------------------------------------------------------- */

.creation-wizard.swd6 .wizard-step-indicator {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-primary);
  overflow-x: auto;
}

.creation-wizard.swd6 .wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  cursor: default;
  position: relative;
}

.creation-wizard.swd6 .wizard-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: calc(50% + 0.75rem);
  width: calc(100% - 1.5rem);
  height: 1px;
  background: var(--border-primary);
  z-index: 0;
}

.creation-wizard.swd6 .wizard-step.completed::after {
  background: var(--success);
  opacity: 0.5;
}

.creation-wizard.swd6 .wizard-step.completed {
  cursor: pointer;
}

.creation-wizard.swd6 .wizard-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.creation-wizard.swd6 .wizard-step.active .wizard-dot {
  border-color: var(--accent-red);
  background: var(--accent-red);
  color: #fff;
}

.creation-wizard.swd6 .wizard-step.completed .wizard-dot {
  border-color: transparent;
  background: transparent;
  color: var(--success);
}

.creation-wizard.swd6 .wizard-dot svg {
  display: block;
  flex-shrink: 0;
}

.creation-wizard.swd6 .wizard-step-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 0.25rem;
  transition: color 0.2s ease;
}

.creation-wizard.swd6 .wizard-step.active .wizard-step-label {
  color: var(--text-primary);
}

.creation-wizard.swd6 .wizard-step.completed .wizard-step-label {
  color: var(--success);
}

/* ---------------------------------------------------------------------------
   Step content area
   --------------------------------------------------------------------------- */

.creation-wizard.swd6 .wizard-step-content {
  min-height: 220px;
  margin-bottom: 1.25rem;
}

.creation-wizard.swd6 .wizard-step-content h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.15rem;
}

.creation-wizard.swd6 .wizard-step-content .text-secondary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.creation-wizard.swd6 .wizard-step-content h4 {
  margin: 1rem 0 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------------------
   Two-column split layout — dropdown on left, detail panel on right
   --------------------------------------------------------------------------- */

.swd6-wizard-split {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.swd6-wizard-left {
  flex: 0 0 14rem;
}

.swd6-wizard-right {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.swd6-wizard-hint {
  color: var(--text-muted);
  font-style: italic;
}

/* ---------------------------------------------------------------------------
   Template detail panel (Step 1 right column)
   --------------------------------------------------------------------------- */

.swd6-template-detail h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
}

.swd6-template-detail strong {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.swd6-template-detail p {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.swd6-template-quote {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border-primary);
  padding-left: 0.75rem;
  margin: 0.5rem 0 0.75rem 0 !important;
}

.swd6-template-attrs-block,
.swd6-template-force-block {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-primary);
}

.swd6-template-attrs {
  font-family: var(--font-monospace, monospace);
  font-size: 0.9rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.swd6-template-force {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.swd6-template-gear {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.swd6-template-gear strong {
  display: inline;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.swd6-template-credits {
  color: var(--text-muted);
}

.swd6-template-detail > div {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.swd6-template-detail > div strong {
  display: inline;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  margin-right: 0.35rem;
}

/* ---------------------------------------------------------------------------
   Step 3: Skill allocation — budget header + grouped skill rows
   --------------------------------------------------------------------------- */

.swd6-skill-budget {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.swd6-budget-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.swd6-budget-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.swd6-budget-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.swd6-budget-stat.exhausted .swd6-budget-value {
  color: var(--success);
}

.swd6-skills-grouped {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.swd6-skill-group {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.swd6-skill-group h4 {
  margin: 0 0 0.5rem 0 !important;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.swd6-group-base {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: normal;
}

.swd6-skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 0.88rem;
}

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

.swd6-skill-name {
  color: var(--text-primary);
  text-transform: capitalize;
}

.swd6-skill-base {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-monospace, monospace);
}

.swd6-skill-final {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-monospace, monospace);
  min-width: 3.5rem;
  text-align: right;
}

.swd6-skill-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.swd6-skill-alloc {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------------------
   Step 4: Force skills — re-uses skill-row styles above
   --------------------------------------------------------------------------- */

.swd6-force-skills {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

/* ---------------------------------------------------------------------------
   Step 5: Equipment
   --------------------------------------------------------------------------- */

.swd6-starting-credits {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.swd6-equipment-list h4 {
  margin: 0 0 0.5rem 0 !important;
}

.swd6-equipment-list ul {
  margin: 0;
  padding-left: 1.25rem;
}

.swd6-equipment-list li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

/* ---------------------------------------------------------------------------
   Step 6: Connections — inline prompt chips + textarea
   --------------------------------------------------------------------------- */

.swd6-template-hook {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.swd6-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------------------
   Step 7: Summary
   --------------------------------------------------------------------------- */

.swd6-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
}

.swd6-summary-row {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  padding: 0.2rem 0;
}

.swd6-summary-label {
  min-width: 8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.swd6-summary-value {
  color: var(--text-primary);
  font-weight: 500;
  white-space: pre-line;
}

/* ---------------------------------------------------------------------------
   Navigation bar
   --------------------------------------------------------------------------- */

.creation-wizard.swd6 .wizard-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary);
}

.creation-wizard.swd6 .wizard-nav-spacer {
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .swd6-wizard-split {
    flex-direction: column;
    gap: 0.75rem;
  }

  .swd6-wizard-left {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .creation-wizard.swd6 {
    padding: 1rem 0.75rem;
  }

  .creation-wizard.swd6 .wizard-step-label {
    display: none;
  }

  .creation-wizard.swd6 .wizard-step::after {
    top: 0.6rem;
  }

  .swd6-skill-budget {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .swd6-summary-label {
    min-width: 6rem;
  }
}

@media (max-width: 480px) {
  .creation-wizard.swd6 {
    padding: 0.5rem;
  }

  .creation-wizard.swd6 input,
  .creation-wizard.swd6 select {
    min-height: 44px;
    font-size: 16px;
  }
}
