/* ===== FLOW SELECTOR - Seleção de Método de Identificação ===== */

.flow-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.flow-card {
  background: var(--surface-primary);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.flow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0068E0 0%, #00a8e0 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-card:hover {
  transform: translateY(-8px);
  border-color: #0068E0;
  box-shadow: 0 12px 40px rgba(0, 104, 224, 0.2);
}

.flow-card:hover::before {
  transform: scaleX(1);
}

.flow-card:focus {
  outline: none;
  border-color: #0068E0;
  box-shadow: 0 0 0 4px rgba(0, 104, 224, 0.1);
}

/* Card Desabilitado */
.flow-card.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.flow-card.disabled * {
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.flow-card.disabled:hover {
  transform: none !important;
  border-color: var(--border-color) !important;
  box-shadow: none !important;
}

.flow-card.disabled:active {
  transform: none !important;
}

.flow-card.disabled::before {
  display: none !important;
}

.flow-card.disabled .flow-card-icon {
  color: var(--text-muted) !important;
}

.flow-card.disabled .flow-btn {
  background: var(--border-color) !important;
  cursor: not-allowed !important;
}

.flow-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 3.5rem;
  color: #0068E0;
}

.flow-card-icon i {
  animation: fadeInScale 0.5s ease-out;
}

.flow-plus {
  font-size: 2rem;
  color: var(--text-muted);
  animation-delay: 0.1s;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.flow-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.flow-card-description {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 2rem;
}

.flow-features {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 2rem;
}

.flow-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.flow-feature i {
  color: #10b981;
  font-size: 1.125rem;
}

.flow-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s;
}

.flow-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
}

.btn-back-section {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.btn-back-section:hover {
  background: var(--surface-primary);
  border-color: #0068E0;
  color: #0068E0;
  transform: translateX(-4px);
}

/* Responsive */
@media (max-width: 1024px) {
  .flow-selector-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .flow-card {
    padding: 2rem 1.5rem;
  }

  .flow-card-icon {
    font-size: 2.5rem;
  }

  .flow-card-title {
    font-size: 1.5rem;
  }
}

/* ===== IMAGE ONLY FLOW ===== */
.image-only-upload-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.upload-area-multi {
  background: var(--surface-primary);
  border: 3px dashed var(--border-color);
  border-radius: 16px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.upload-area-multi:hover {
  border-color: #0068E0;
  background: rgba(0, 104, 224, 0.02);
}

.upload-area-multi.drag-over {
  border-color: #0068E0;
  background: rgba(0, 104, 224, 0.05);
  transform: scale(1.02);
}

.upload-area-multi i {
  font-size: 4rem;
  color: #0068E0;
  margin-bottom: 1.5rem;
  display: block;
}

.upload-area-multi h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.upload-area-multi p {
  font-size: 1rem;
  color: var(--text-muted);
}

.upload-area-multi input[type="file"] {
  display: none;
}

.images-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.image-preview-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: all 0.3s;
}

.image-preview-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: #0068E0;
}

.image-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.3s;
}

.image-preview-card:hover .image-preview-overlay {
  opacity: 1;
}

.image-preview-overlay span {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.btn-remove-image {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-image:hover {
  background: #ef4444;
  transform: scale(1.1);
}

/* =================================================================
   GROUPING CONFIRMATION SECTION
   ================================================================= */

.grouping-confirmation-section {
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
}

.grouping-header {
  text-align: center;
  margin-bottom: 2rem;
}

.grouping-header h3 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.grouping-header h3 i {
  color: #3498db;
  margin-right: 0.5rem;
}

.grouping-header .text-muted {
  font-size: 1rem;
  color: #7f8c8d;
}

.groups-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.group-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.group-card:hover {
  border-color: #3498db;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.group-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.3rem;
  color: #2c3e50;
}

.group-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #3498db;
  color: white;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
}

.group-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.attr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #495057;
}

.attr-badge i {
  color: #3498db;
}

.variations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.variation-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.variation-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.variation-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.variation-image-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.variation-image-placeholder span {
  font-size: 0.85rem;
  font-weight: 500;
}

.variation-info {
  padding: 1rem;
  font-size: 0.9rem;
}

.variation-info div {
  margin-bottom: 0.5rem;
}

.variation-info strong {
  color: #2c3e50;
}

.confidence-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.confidence-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
  transition: width 0.3s;
}

.confidence-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: bold;
  color: #2c3e50;
  z-index: 1;
}

.grouping-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}

.grouping-actions .btn {
  flex: 1;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s;
}

.grouping-actions .btn i {
  margin: 0 0.5rem;
}

.grouping-actions .btn-outline-secondary:hover {
  background: #6c757d;
  color: white;
}

.grouping-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.grouping-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .variations-grid {
    grid-template-columns: 1fr;
  }

  .grouping-actions {
    flex-direction: column;
  }

  .grouping-actions .btn {
    width: 100%;
  }
}

/* =================================================================
   PROFESSIONAL IMAGE-ONLY FLOW
   ================================================================= */

.image-only-professional {
  padding: 2rem;
}

.image-only-upload-container-pro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Upload Section Card */
.upload-section-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
}

.upload-section-card:hover {
  border-color: #3498db;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

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

.upload-section-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.upload-section-title h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2c3e50;
  font-weight: 600;
}

.upload-section-title p {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* Upload Area Pro */
.upload-area-pro {
  border: 3px dashed #cbd5e0;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8f9fa;
  position: relative;
}

.upload-area-pro:hover {
  border-color: #3498db;
  background: #f0f8ff;
}

.upload-area-pro.drag-over {
  border-color: #2ecc71;
  background: #e8f8f0;
  transform: scale(1.02);
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.upload-dropzone i {
  font-size: 3rem;
  color: #3498db;
  margin-bottom: 0.5rem;
}

.upload-dropzone h4 {
  margin: 0;
  font-size: 1.2rem;
  color: #2c3e50;
  font-weight: 600;
}

.upload-dropzone p {
  margin: 0;
  font-size: 1rem;
  color: #7f8c8d;
}

.upload-hint {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #6c757d;
}

/* Images Gallery */
.images-gallery {
  display: none; /* Mostrado quando tiver imagens */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f8f9fa;
}

.gallery-image-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.gallery-image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  border-color: #3498db;
}

.gallery-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* Aspect ratio 1:1 */
  background: #f8f9fa;
  overflow: hidden;
}

.gallery-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-image-card:hover .gallery-image-overlay {
  opacity: 1;
}

.btn-gallery-action {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: white;
  color: #2c3e50;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1rem;
}

.btn-gallery-action:hover {
  transform: scale(1.1);
}

.btn-gallery-view:hover {
  background: #3498db;
  color: white;
}

.btn-gallery-remove:hover {
  background: #ef4444;
  color: white;
}

.gallery-image-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gallery-image-name {
  font-size: 0.85rem;
  color: #2c3e50;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-image-size {
  font-size: 0.75rem;
  color: #7f8c8d;
}

/* Upload Summary Card */
.upload-summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2rem;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.upload-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-stat-item i {
  font-size: 2rem;
  opacity: 0.9;
}

.upload-stat-item span {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
}

.upload-stat-item label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

.upload-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.upload-actions .btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s;
}

.upload-actions .btn-outline-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.upload-actions .btn-outline-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.upload-actions .btn-primary {
  background: white;
  color: #667eea;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0 0.5rem;
}

/* Image Preview Modal */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.image-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
}

.image-preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.image-preview-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.btn-close-preview {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.btn-close-preview:hover {
  transform: scale(1.1);
  background: #dc2626;
}

.image-preview-info {
  text-align: center;
}

.image-preview-info h4 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 1.2rem;
}

.image-preview-info p {
  margin: 0.25rem 0;
  color: #7f8c8d;
  font-size: 0.9rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .image-only-upload-container-pro {
    grid-template-columns: 1fr;
  }

  .images-gallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .upload-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .upload-actions {
    flex-direction: column;
  }

  .upload-actions .btn {
    width: 100%;
  }
}
