/**
 * YuiaNF - Tabela de Pré-visualização e Ações
 */

.results-section {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

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

/* Controles de Filtro e Busca */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.6rem 0.85rem 0.6rem 2.4rem;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(229, 46, 64, 0.3);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(229, 46, 64, 0.35);
}

/* Tabela */
.table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.table-scroll {
  max-height: 520px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  background: rgba(14, 15, 22, 0.98);
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(229, 46, 64, 0.03);
}

.col-orig {
  width: 38%;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.825rem;
  word-break: break-all;
}

.col-new {
  width: 44%;
}

.col-status {
  width: 18%;
  white-space: nowrap;
}

/* Input editável de nome */
.editable-name-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.name-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  outline: none;
  transition: all 0.2s;
}

.name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(229, 46, 64, 0.3);
}

.name-input.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

.input-error-msg {
  display: none;
  color: #f87171;
  font-size: 0.725rem;
  margin-top: 0.25rem;
  font-family: var(--font-sans);
}

.name-input.is-invalid + .input-error-msg {
  display: block;
}

/* Badges de Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.775rem;
  font-weight: 600;
}

.status-renamed {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #34d399;
}

.status-duplicate {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: #38bdf8;
}

.status-unidentified {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #fbbf24;
}

.status-badge svg {
  width: 13px;
  height: 13px;
}

/* Barra Inferior Fixa de Ações */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1rem 1.75rem;
  position: sticky;
  bottom: 1.5rem;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.action-bar-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.action-bar-info strong {
  color: #ff6b82;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .action-bar {
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .action-bar-info {
    justify-content: center;
  }
  .action-buttons {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}

/* Tags de Formato na Tabela */
.format-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  width: fit-content;
  transition: all 0.2s ease;
}

.format-tag svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.format-tag-convert {
  background: rgba(229, 46, 64, 0.14);
  border: 1px solid rgba(229, 46, 64, 0.3);
  color: #ff6578;
}

.format-tag-pdf {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.format-tag-orig {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

/* Informações extras da Action Bar */
.action-info-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.action-format-status {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.action-format-status strong {
  font-weight: 700;
  color: #ff4d6d;
}

