/* ====================================
   WORKFLOW WIZARD - ESTRUTURA DE PÁGINAS
   ==================================== */

/* Container principal do wizard - FULL WIDTH */
.wizard-container,
.identification-container-fullwidth {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Ocultar header antigo - botão agora está nos breadcrumbs */
.workflow-header-compact {
  display: none;
}

.identification-wizard-steps {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.identification-step {
  width: 100%;
  display: none;
}

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

/* Form section quando é step final */
.form-section-container-fullwidth {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ====================================
   BREADCRUMBS NO TOPO
   ==================================== */

.wizard-breadcrumbs {
  background: var(--surface-color, #fff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-radius: 20px;
}

.wizard-breadcrumb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botão de Voltar ao lado dos Breadcrumbs */
.btn-back-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #f3f4f6;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  color: #374151;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-back-breadcrumb:hover {
  background: #0066ff;
  border-color: #0066ff;
  color: white;
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.btn-back-breadcrumb i {
  font-size: 18px;
}

.wizard-breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
}

.wizard-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  transition: all 0.3s ease;
}

/* Círculo numerado */
.wizard-breadcrumb-item .crumb-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--neutral-100, #f3f4f6);
  color: var(--neutral-500, #6b7280);
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--neutral-200, #e5e7eb);
  transition: all 0.3s ease;
}

/* Label do passo */
.wizard-breadcrumb-item .crumb-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600, #4b5563);
  transition: all 0.3s ease;
}

/* Seta entre passos */
.wizard-breadcrumb-item::after {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  color: var(--neutral-300, #d1d5db);
  margin-left: 1rem;
}

.wizard-breadcrumb-item:last-child::after {
  display: none;
}

/* Estado: Ativo */
.wizard-breadcrumb-item.active .crumb-index {
  background: white;
  color: #0066ff;
  border: 3px solid #0066ff;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.15);
}

.wizard-breadcrumb-item.active .crumb-label {
  color: #0066ff;
  font-weight: 600;
}

/* Estado: Completado */
.wizard-breadcrumb-item.completed .crumb-index {
  background: #01bb88;
  color: white;
  border-color: #01bb88;
}

.wizard-breadcrumb-item.completed .crumb-index::before {
  content: "";
  display: none;
}

.wizard-breadcrumb-item.completed .crumb-label {
  color: #64748b;
}

/* ====================================
   PÁGINAS DO WIZARD
   ==================================== */

.wizard-page {
  display: none;
  width: 100%;
  min-height: 60vh;
  animation: fadeInSlide 0.4s ease;
}

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

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

/* Container de conteúdo da página - FULL WIDTH */
.wizard-page-content {
  background: var(--surface-color, #fff);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 0;
  max-width: 100%;
}

/* Header de cada página */
.wizard-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.wizard-page-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.wizard-page-header h2 i {
  color: var(--primary-color, #3b82f6);
}

.wizard-page-header p {
  font-size: 16px;
  color: var(--text-secondary, #6b7280);
  margin: 0;
}

/* ====================================
   NAVEGAÇÃO DO WIZARD
   ==================================== */

.wizard-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.wizard-nav-left {
  display: flex;
  gap: 0.75rem;
}

.wizard-nav-right {
  display: flex;
  gap: 0.75rem;
}

/* Botões de navegação */
.wizard-btn {
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wizard-btn-primary {
  background: #0066ff;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
}

.wizard-btn-primary:hover {
  background: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.35);
}

.wizard-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.wizard-btn-secondary:hover {
  background: #e5e7eb;
}

.wizard-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ====================================
   PÁGINAS ESPECÍFICAS
   ==================================== */

/* Página 1: Upload XML */
.wizard-upload-area {
  max-width: 600px;
  margin: 0 auto;
}

/* Página 2: Variações detectadas */
.wizard-variations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.wizard-variation-card {
  background: var(--surface-secondary, #f9fafb);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.wizard-variation-card:hover {
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Página 3: Fotos */
.wizard-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.wizard-photo-upload-card {
  background: var(--surface-secondary, #f9fafb);
  border: 2px dashed var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wizard-photo-upload-card:hover {
  border-color: var(--primary-color, #3b82f6);
  background: var(--primary-light, #eff6ff);
}

/* Página 4: Seleção do produto */
.wizard-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.wizard-product-card {
  background: var(--surface-color, #fff);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wizard-product-card:hover {
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
  transform: translateY(-4px);
}

.wizard-product-card.selected {
  border-color: var(--primary-color, #3b82f6);
  background: var(--primary-light, #eff6ff);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Página 5: Formulário - FULL WIDTH */
.wizard-form-container {
  max-width: 100%;
  margin: 0;
}

/* ====================================
   ANIMAÇÃO DE LOADING NO BOTÃO
   ==================================== */

.wizard-btn .btn-loading {
  display: none;
}

.wizard-btn.loading .btn-text {
  display: none;
}

.wizard-btn.loading .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wizard-btn.loading {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}

.wizard-btn .fa-circle-notch {
  animation: spin 1s linear infinite;
}

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

/* ====================================
   RESPONSIVIDADE
   ==================================== */

@media (max-width: 768px) {
  .wizard-breadcrumbs {
    padding: 1rem;
  }

  .wizard-breadcrumbs ol {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .wizard-breadcrumb-item::after {
    content: "\f078";
    margin-left: 0;
    position: absolute;
    left: 18px;
    bottom: -12px;
  }

  .wizard-breadcrumb-item:last-child::after {
    display: none;
  }

  .wizard-page-content {
    padding: 1.5rem;
  }

  .wizard-page-header h2 {
    font-size: 22px;
  }

  .wizard-navigation {
    flex-direction: column;
  }

  .wizard-nav-left,
  .wizard-nav-right {
    width: 100%;
  }

  .wizard-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ====================================
   TEMA ESCURO
   ==================================== */

[data-theme="dark"] .wizard-breadcrumbs {
  background: var(--surface-color-dark, #1f2937);
  border-bottom-color: var(--border-color-dark, #374151);
}

[data-theme="dark"] .wizard-page-content {
  background: var(--surface-color-dark, #1f2937);
}

[data-theme="dark"] .wizard-breadcrumb-item .crumb-index {
  background: var(--neutral-700, #374151);
  color: var(--neutral-300, #d1d5db);
  border-color: var(--neutral-600, #4b5563);
}

[data-theme="dark"] .wizard-breadcrumb-item .crumb-label {
  color: var(--neutral-400, #9ca3af);
}

[data-theme="dark"] .wizard-variation-card,
[data-theme="dark"] .wizard-photo-upload-card {
  background: var(--surface-secondary-dark, #111827);
  border-color: var(--border-color-dark, #374151);
}

[data-theme="dark"] .wizard-product-card {
  background: var(--surface-color-dark, #1f2937);
  border-color: var(--border-color-dark, #374151);
}
