/* ============================================================
   PackCraft — style.css
   Mobile-first, production-grade CSS
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --brand-bg: #0d0f14;
  --brand-surface: #161920;
  --brand-border: #252830;
  --brand-accent: #f5c542;
  --brand-accent2: #e8774a;
  --brand-text: #eef0f6;
  --brand-muted: #7a7e8e;
  --brand-radius: 14px;
  --brand-radius-sm: 8px;
  --step-active: #f5c542;
  --step-done: #3ecf8e;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--brand-bg);
  color: var(--brand-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- App Shell ---- */
#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 80px;
}

/* ============================================================
   HEADER
   ============================================================ */
#app-header {
  padding: 28px 24px 0;
  position: relative;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.6rem;
  color: var(--brand-accent);
  animation: suitcase-bounce 2.8s ease-in-out infinite;
}

@keyframes suitcase-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--brand-muted);
  letter-spacing: 0.03em;
}

/* ---- Steps Bar ---- */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 8px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.steps-bar::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.step.active, .step.done { opacity: 1; }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-border);
  border: 2px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-muted);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.step.active .step-num {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #000;
}

.step.done .step-num {
  background: var(--step-done);
  border-color: var(--step-done);
  color: #fff;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.step.active .step-label { color: var(--brand-accent); }
.step.done .step-label { color: var(--step-done); }

.step-divider {
  width: 28px;
  height: 1px;
  background: var(--brand-border);
  flex-shrink: 0;
  margin-bottom: 20px;
}

/* ============================================================
   WIZARD STEPS
   ============================================================ */
.wizard-step {
  display: none;
  padding: 0 16px;
  animation: stepIn 0.3s ease both;
}

.wizard-step.active { display: block; }

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

.step-content {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  padding: 32px 24px;
}

.step-content.wide { padding: 24px 20px; }

.step-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-text);
  margin-bottom: 8px;
  line-height: 1.25;
}

.step-subtitle {
  font-size: 0.88rem;
  color: var(--brand-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ---- Form Groups ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--brand-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.15);
}

.form-group input::placeholder { color: var(--brand-muted); opacity: 0.7; }

/* ---- Step Actions ---- */
.step-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent2));
  color: #000;
  border: none;
  border-radius: var(--brand-radius-sm);
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--brand-muted);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.btn-secondary:hover { color: var(--brand-text); border-color: var(--brand-muted); }
.btn-secondary.small { padding: 9px 14px; font-size: 0.82rem; }



/* ============================================================
   PURPOSE CARDS (Step 2)
   ============================================================ */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--brand-bg);
  border: 2px solid var(--brand-border);
  border-radius: var(--brand-radius);
  padding: 24px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  user-select: none;
}

.choice-card i {
  font-size: 1.8rem;
  color: var(--brand-muted);
  transition: color var(--transition);
}

.choice-card span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-muted);
  transition: color var(--transition);
}

.choice-card:hover {
  border-color: rgba(245, 197, 66, 0.4);
  transform: translateY(-2px);
}

.choice-card.selected {
  border-color: var(--brand-accent);
  background: rgba(245, 197, 66, 0.08);
}

.choice-card.selected i,
.choice-card.selected span {
  color: var(--brand-accent);
}

/* ============================================================
   ADD-ON TAGS (Step 3)
   ============================================================ */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-bg);
  border: 1.5px solid var(--brand-border);
  border-radius: 50px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand-muted);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.tag-chip:hover {
  border-color: var(--brand-accent);
  color: var(--brand-text);
}

.tag-chip.selected {
  background: rgba(245, 197, 66, 0.12);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

/* ============================================================
   THEME CARDS (Step 4)
   ============================================================ */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--brand-radius-sm);
  padding: 10px 6px;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition);
}

.theme-card:hover { transform: translateY(-2px); }

.theme-card.selected { border-color: var(--brand-accent); border-radius: var(--brand-radius-sm); }

.theme-preview {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  overflow: hidden;
}

.tp-line {
  height: 4px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.5;
}
.tp-line.short { width: 60%; }

.tp-block {
  height: 14px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.5;
}

/* Theme preview swatches */
.white-preview  { background: #f9fafb; color: #374151; }
.pink-preview   { background: #fce7f3; color: #ec4899; }
.violet-preview { background: #1e1b4b; color: #a78bfa; }
.red-preview    { background: #fff1f2; color: #e11d48; }
.blue-preview   { background: #eff6ff; color: #3b82f6; }
.notebook-preview {
  background: #fffef5;
  background-image: repeating-linear-gradient(#fffef5 0px, #fffef5 23px, #93c5fd 24px);
  color: #374151;
}
.redline-preview { background: #fff; color: #ef4444; border: 1px solid #e5e7eb; }
.blocks-preview {
  background: #1e293b;
  color: #e2e8f0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 8px;
}

.theme-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-text);
}

.theme-desc {
  font-size: 0.65rem;
  color: var(--brand-muted);
  text-align: center;
}

/* ============================================================
   STEP 5: REVIEW / EDIT
   ============================================================ */
.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.review-actions-top {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Inline per-category add row */
.cat-add-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px dashed var(--brand-border);
}

.cat-add-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--brand-border);
  border-radius: 0;
  padding: 5px 4px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--brand-muted);
  outline: none;
  transition: border-color var(--transition), color var(--transition);
}

.cat-add-input::placeholder { color: var(--brand-border); font-style: italic; }

.cat-add-input:focus {
  border-bottom-color: var(--brand-accent);
  color: var(--brand-text);
}

.cat-add-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-border);
  background: transparent;
  color: var(--brand-muted);
  border-radius: 5px;
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.cat-add-btn:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #000;
}

/* Inline packing list preview */
#list-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-block {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--brand-border);
}

.category-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(245, 197, 66, 0.12);
  color: var(--brand-accent);
}

.category-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-text);
  flex: 1;
}

.category-count {
  font-size: 0.75rem;
  color: var(--brand-muted);
  background: var(--brand-border);
  padding: 2px 8px;
  border-radius: 50px;
}

.item-list { padding: 8px 0; }

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  transition: background var(--transition);
  border-radius: 4px;
}

.item-row:hover { background: rgba(255,255,255,0.03); }

.item-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: transparent;
  font-size: 0.6rem;
}

.item-check.checked {
  background: var(--step-done);
  border-color: var(--step-done);
  color: #fff;
}

.item-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--brand-text);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  outline: none;
  min-width: 0;
}

.item-text:focus {
  background: rgba(245,197,66,0.07);
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
}

.item-delete {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--brand-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: color var(--transition), background var(--transition);
  opacity: 0;
  transition: opacity var(--transition);
}

.item-row:hover .item-delete { opacity: 1; }
.item-delete:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1f28;
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-sm);
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--brand-text);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--step-done); }
.toast.error   { border-color: #ff6b6b; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .step-content { padding: 24px 16px; }
  .step-title   { font-size: 1.25rem; }
  .theme-grid   { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .theme-preview { height: 52px; }
  .theme-label  { font-size: 0.68rem; }
  .theme-desc   { font-size: 0.58rem; }
  .choice-grid  { gap: 10px; }
  .choice-card  { padding: 20px 12px; }
  .choice-card i { font-size: 1.5rem; }
  .step-actions { flex-direction: column-reverse; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .review-actions-top { width: 100%; }
  .review-header { flex-direction: column; }

}

@media (min-width: 600px) {
  .theme-grid { grid-template-columns: repeat(4, 1fr); }
  .step-content { padding: 40px 36px; }
  .step-title { font-size: 1.75rem; }
}
