/* ==========================================================
   WISAXIS — WIZARD PROGRESS + SHARED UI COMPONENTS (2026 SaaS)
   Wizard tracker, bottom toolbar, form inputs, template grid.
   ========================================================== */

/* ===== WIZARD PROGRESS TRACKER ===== */
.wizard-sticky {
  position: sticky;
  top: var(--desktop-navbar-height, 76px);
  z-index: 100;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.25rem var(--space-4);
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-default);
}

.wizard-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: default;
  position: relative;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* Active Step */
.wizard-step[aria-current="step"] .step-num,
.wizard-step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow:
    0 0 20px var(--primary-glow),
    0 0 0 4px var(--primary-light);
  transform: scale(1.12);
}

.wizard-step[aria-current="step"] .step-label,
.wizard-step.active .step-label {
  color: var(--primary);
  font-weight: 800;
}

/* Completed Step */
.wizard-step.completed .step-num {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

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

/* Connector Line */
.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  margin: 0 8px 24px;
  transition: background 0.35s ease;
  position: relative;
  overflow: hidden;
}

.wizard-connector::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.wizard-step.completed + .wizard-connector::after {
  transform: scaleX(1);
}

/* ===== STICKY BOTTOM TOOLBAR ===== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  margin-top: 2.5rem;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  position: sticky;
  bottom: 1.5rem;
  z-index: 90;
}

html[data-theme="light"] .bottom-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--border-default);
}

/* ===== FORM SECTION TITLE WITH ICON ===== */
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.form-section-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== PHOTO UPLOAD COMPONENT ===== */
.photo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.photo-preview {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px dashed var(--border-strong);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.photo-preview.has-photo {
  border-style: solid;
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.photo-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-file-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  transition: all 0.2s var(--ease-spring);
}

.btn-file-upload:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-remove-photo {
  background: none;
  border: none;
  color: var(--danger);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: opacity 0.2s ease;
}

.btn-remove-photo:hover {
  text-decoration: underline;
}

.photo-upload-hint {
  font-size: var(--text-2xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== LANGUAGES COMPONENT ===== */
.languages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.language-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-item input {
  flex: 1;
}

.btn-item-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--danger-light);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.btn-item-delete:hover {
  background: var(--danger);
  color: #ffffff;
  transform: scale(1.05);
}

/* ===== FIELDSET & LEGEND ===== */
.template-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.template-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-4);
  width: 100%;
  padding: 0;
}

/* ===== VISUAL TEMPLATE GRID (Step 4) ===== */
.template-visual-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.template-visual-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.template-visual-card .template-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.tvc-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: top center;
  background-color: var(--surface-2);
  border: 2px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.template-visual-card:hover .tvc-thumb {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.template-visual-card:has(.template-radio:checked) .tvc-thumb,
.template-visual-card.selected .tvc-thumb {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px var(--primary-light),
    0 12px 28px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px) scale(1.03);
}

.template-visual-card:has(.template-radio:checked) .tvc-name,
.template-visual-card.selected .tvc-name {
  color: var(--primary);
  font-weight: 800;
}

.tvc-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.25s ease;
  text-align: center;
}

.tvc-tag {
  font-size: var(--text-2xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 768px) {
  .template-visual-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .wizard-sticky {
    top: var(--mobile-navbar-height, 72px);
    padding: 0.85rem var(--space-2);
    margin-bottom: 1.5rem;
  }

  .step-num {
    width: 34px;
    height: 34px;
    font-size: var(--text-xs);
  }

  .step-label {
    font-size: 0.625rem;
  }

  .bottom-bar {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }
}

/* ==========================================================
   MINIMALIST SAAS COMPONENTS (Interactive Chips, Accordions, ATS)
   ========================================================== */

/* ===== SKILLS CHIP / TAG INPUT ===== */
.skills-input-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 52px;
  transition: all 0.2s ease;
}

.skills-chips-wrapper:focus-within {
  border-color: var(--primary);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  color: var(--text-main);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  user-select: none;
  animation: chipPopIn 0.28s var(--ease-spring) both;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}

.skill-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  transition: all 0.15s ease;
}

.skill-chip-remove:hover {
  background: var(--danger);
  color: #ffffff;
}

.skill-tag-input {
  flex: 1;
  min-width: 140px;
  background: transparent !important;
  border: none !important;
  padding: 4px 0 !important;
  color: var(--text-main) !important;
  font-size: var(--text-sm) !important;
  box-shadow: none !important;
  outline: none !important;
}

.skill-suggestions-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.skill-suggestions-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.skill-suggestions-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.skill-suggestion-pill:hover {
  background: var(--surface-card-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ===== ACCORDION CARD SYSTEM (Experience & Education) ===== */
.accordion-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease-out-smooth),
    box-shadow 0.25s var(--ease-out-smooth),
    transform 0.25s var(--ease-spring);
}

.accordion-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.accordion-card.is-open {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--surface-1);
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: var(--surface-2);
}

.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.accordion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 800;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring);
}

.accordion-card:hover .accordion-badge {
  transform: scale(1.08);
}

.accordion-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accordion-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.accordion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-spring);
}

.accordion-card.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-0);
  animation: pageReveal 0.28s var(--ease-out-smooth) both;
}

/* ===== ATS HEALTH SCORECARD WIDGET ===== */
.ats-scorecard {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  animation: pageReveal 0.4s var(--ease-out-smooth) both;
}

.ats-scorecard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ats-excellent), var(--primary), var(--accent));
}

.ats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ats-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: var(--text-sm);
  transition: transform 0.3s var(--ease-spring);
}

.ats-scorecard:hover .ats-score-badge {
  transform: scale(1.04);
}

.ats-score-badge.excellent {
  background: var(--ats-excellent-bg);
  color: var(--ats-excellent);
  border: 1px solid var(--ats-excellent);
}

.ats-score-badge.good {
  background: var(--ats-good-bg);
  color: var(--ats-good);
  border: 1px solid var(--ats-good);
}

.ats-score-badge.warning {
  background: var(--ats-warning-bg);
  color: var(--ats-warning);
  border: 1px solid var(--ats-warning);
}

.ats-score-badge.danger {
  background: var(--ats-danger-bg);
  color: var(--ats-danger);
  border: 1px solid var(--ats-danger);
}

.ats-insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .ats-insights-grid {
    grid-template-columns: 1fr;
  }
}

.ats-insight-box {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: transform 0.2s var(--ease-spring);
}

.ats-insight-box:hover {
  transform: translateY(-2px);
}

.ats-insight-title {
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ats-insight-box.strengths .ats-insight-title {
  color: var(--ats-excellent);
}

.ats-insight-box.improvements .ats-insight-title {
  color: var(--ats-warning);
}

.ats-insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ats-insight-list li {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
  position: relative;
  padding-left: 14px;
  transition: color 0.15s ease;
}

.ats-insight-list li:hover {
  color: var(--text-main);
}

.ats-insight-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ===== INLINE AI PROMPT TOOLBAR ===== */
.ai-inline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-glow);
  color: var(--text-main);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  user-select: none;
  animation: chipPopIn 0.28s var(--ease-spring) both;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}

.skill-chip:hover {
  transform: translateY(-1px) scale(1.03);
}
