/**
 * Estilos para o Sistema de Variações de Produtos
 * - Modal de upload de XML NF-e
 * - Interface de revisão de grupos
 * - Wizard de upload de fotos
 * - Editor de grade de variações
 * - Resumo e finalização
 */

/* ===== Modal NFe ===== */
.nfe-modal {
  max-width: 95vw;
  max-height: 90vh;
  width: 1400px;
}

.nfe-body {
  padding: 2rem;
  min-height: 500px;
}

/* ===== Split Button (Novo Produto com opções) ===== */
/* ===== Steps ===== */
.nfe-step {
  animation: fadeIn 0.3s ease-in;
}

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

.step-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-info h4 {
  margin: 0;
  font-size: 20px;
  color: #111827;
  font-weight: 600;
}

.step-info p {
  margin: 4px 0 0 0;
  color: #6b7280;
  font-size: 14px;
}

.nfe-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

/* ===== Upload Section (Step 1) ===== */
.nfe-upload-section {
  max-width: 700px;
  margin: 0 auto;
}

.nfe-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 1.5rem;
}

.nfe-dropzone:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.nfe-dropzone.dragover {
  border-color: #2563eb;
  background: #dbeafe;
  border-style: solid;
}

.nfe-dropzone.has-file {
  border-color: #10b981;
  background: #f0fdf4;
  border-style: solid;
}

.nfe-dropzone .dropzone-content {
  pointer-events: none;
}

.nfe-dropzone i {
  font-size: 48px;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.nfe-dropzone p {
  font-size: 16px;
  color: #475569;
  margin: 0.5rem 0;
}

.nfe-dropzone small {
  display: block;
  color: #94a3b8;
  margin-top: 0.5rem;
}

.nfe-dropzone .selected-file {
  display: block;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 8px;
  color: #64748b;
  font-weight: 400;
}

.nfe-dropzone .selected-file.has-file {
  color: #10b981;
  font-weight: 500;
  background: white;
  border: 1px solid #d1fae5;
}

.nfe-upload-actions {
  text-align: center;
}

.nfe-info-box {
  max-width: 700px;
  margin: 2rem auto 0;
  padding: 1rem 1.5rem;
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.nfe-info-box i {
  font-size: 20px;
  color: #2563eb;
  margin-top: 2px;
}

.nfe-info-box strong {
  display: block;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.nfe-info-box p {
  margin: 0;
  color: #1e40af;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Groups Container (Step 2) ===== */
.nfe-groups-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.nfe-group-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.nfe-group-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nfe-group-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nfe-group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
}

.nfe-group-header input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.nfe-group-info {
  flex: 1;
}

.nfe-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.nfe-group-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 13px;
  color: #6b7280;
}

.nfe-group-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nfe-group-expand {
  color: #6b7280;
  transition: transform 0.2s;
}

.nfe-group-card.expanded .nfe-group-expand {
  transform: rotate(180deg);
}

.nfe-group-body {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: none;
}

.nfe-group-card.expanded .nfe-group-body {
  display: block;
}

.nfe-variations-table {
  width: 100%;
  border-collapse: collapse;
}

.nfe-variations-table th {
  text-align: left;
  padding: 0.75rem;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nfe-variations-table td {
  padding: 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  color: #374151;
}

.nfe-variations-table tr:hover {
  background: #f8fafc;
}

.variation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.variation-badge.color {
  background: #dbeafe;
  color: #1e40af;
}

.variation-badge.size {
  background: #fce7f3;
  color: #9f1239;
}

/* ===== Photos Section (Step 3) ===== */
.nfe-photos-section {
  padding: 3rem;
  text-align: center;
  color: #9ca3af;
}

.nfe-photos-section i {
  font-size: 48px;
  margin-bottom: 1rem;
}

/* ===== Grid Container (Step 4) ===== */
.nfe-grid-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
}

.variation-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.variation-grid th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
}

.variation-grid td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.variation-grid tr:hover {
  background: #f8fafc;
}

.variation-grid input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
}

.variation-grid input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Success Stats (Step 5) ===== */
.nfe-success-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.success-stat-card {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 1.5rem;
  border-radius: 12px;
  color: white;
  text-align: center;
}

.success-stat-card i {
  font-size: 32px;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.success-stat-number {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.success-stat-label {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

/* ===== Loading & Progress ===== */
.nfe-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.nfe-loading i {
  font-size: 48px;
  color: #2563eb;
}

.nfe-loading p {
  color: #6b7280;
  font-size: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nfe-modal {
    max-width: 100vw;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .nfe-body {
    padding: 1rem;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nfe-step-actions {
    flex-direction: column;
  }

  .nfe-groups-container {
    max-height: 400px;
  }

  .nfe-group-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .variation-grid {
    font-size: 12px;
  }

  .variation-grid th,
  .variation-grid td {
    padding: 0.5rem;
  }

  .success-stat-card {
    padding: 1rem;
  }

  .success-stat-number {
    font-size: 28px;
  }
}

/* ===== SKU Dropdown na Tabela de Variações ===== */
.sku-dropdown {
  position: relative;
  display: inline-block;
}

.sku-dropdown-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sku-dropdown-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sku-dropdown-btn code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #333;
}

.sku-dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  z-index: 1000;
  top: 100%;
  left: 0;
  margin-top: 4px;
  padding: 8px 0;
  border: 1px solid #e0e0e0;
}

.sku-dropdown-content.show {
  display: block;
}

.sku-option {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sku-option:hover {
  background-color: #f5f5f5;
}

.sku-option code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #333;
}

.sku-option small {
  color: #666;
  font-size: 11px;
}

.sku-divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 8px 0;
}

.sku-label {
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
