/* Estilos para a listagem de notas fiscais */
.wcfm_nota_fiscal_table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

.wcfm_nota_fiscal_table th,
.wcfm_nota_fiscal_table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #e5e5e5;
}

.wcfm_nota_fiscal_table th {
  background-color: #f8f8f8;
  font-weight: 600;
}

.wcfm_nota_fiscal_table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.wcfm_nota_fiscal_table tr:hover {
  background-color: #f0f0f0;
}

/* Estilos para o ícone de DANFE */
.wcfm-action-icon .fa-file-pdf {
  color: #e74c3c;
  font-size: 16px;
}

.wcfm-action-icon .fa-file-code {
  color: #3498db;
  font-size: 16px;
}

.wcfm-action-icon {
  margin-right: 8px;
}

/* Estilos para a visualização detalhada */
.wcfm_nota_fiscal_details_table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.wcfm_nota_fiscal_details_table th,
.wcfm_nota_fiscal_details_table td {
  padding: 12px;
  border: 1px solid #e5e5e5;
}

.wcfm_nota_fiscal_details_table th {
  background-color: #f8f8f8;
  width: 200px;
  text-align: left;
  font-weight: 600;
}

/* Status de nota fiscal */
.nota-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.nota-status-autorizado {
  background-color: #dff0d8;
  color: #3c763d;
}

.nota-status-processando,
.nota-status-contingencia {
  background-color: #fcf8e3;
  color: #8a6d3b;
}

.nota-status-erro,
.nota-status-rejeitado {
  background-color: #f2dede;
  color: #a94442;
}

/* Botões de ação */
.nota-fiscal-btn {
  display: inline-block;
  margin-right: 10px;
  padding: 8px 12px;
  background-color: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.3s;
}

.nota-fiscal-btn:hover {
  background-color: #555;
  color: #fff;
}

.nota-fiscal-btn .wcfmfa {
  margin-right: 5px;
}

.nota-fiscal-btn-danfe {
  background-color: #e74c3c;
}

.nota-fiscal-btn-danfe:hover {
  background-color: #c0392b;
}

.nota-fiscal-btn-xml {
  background-color: #3498db;
}

.nota-fiscal-btn-xml:hover {
  background-color: #2980b9;
}

/* Tabela responsiva */
@media screen and (max-width: 782px) {
  .wcfm_nota_fiscal_table {
    display: block;
    overflow-x: auto;
  }

  .wcfm_nota_fiscal_details_table th {
    width: 120px;
  }
}

.wcfm_webhook_logs_table .webhook-url-cell,
.wcfm_webhook_logs_table .webhook-error-cell {
  position: relative;
  max-width: 200px;
}

.webhook-url-truncated,
.webhook-error-truncated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.webhook-url-tooltip,
.webhook-error-tooltip {
  display: none;
  position: absolute;
  background: #fff;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  z-index: 1000;
  max-width: 300px;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  top: 100%;
  left: 0;
}

.webhook-url-cell:hover .webhook-url-tooltip,
.webhook-error-cell:hover .webhook-error-tooltip {
  display: block;
}

/* Estilos para os badges de status */
.webhook-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.webhook-status-badge.status-success {
  background-color: #4caf50;
  color: white;
}

.webhook-status-badge.status-error {
  background-color: #f44336;
  color: white;
}

/* Estilos para a linha de detalhes do webhook */
.webhook-details-content {
  padding: 15px;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
}

.webhook-details-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.webhook-details-section {
  flex: 1 1 45%;
  min-width: 300px;
}

.webhook-details-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #00798b;
  font-size: 14px;
}

.webhook-json-data {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 12px;
  margin: 0;
}

/* Estilos para status das notas fiscais */
.nota-status {
  padding: 5px 10px;
  border-radius: 3px;
  font-weight: bold;
  display: inline-block;
}

.nota-status-autorizado {
  background-color: #dff0d8;
  color: #3c763d;
}

.nota-status-processando {
  background-color: #fcf8e3;
  color: #8a6d3b;
}

.nota-status-rejeitado {
  background-color: #f2dede;
  color: #a94442;
}

/* Estilos para as linhas de detalhes de webhook */
.webhook-details-row td {
  padding: 0 !important; /* Remover padding padrão da célula */
}

.webhook-details-content {
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.webhook-details-wrapper {
  padding: 15px;
  max-height: 500px;
  overflow-y: auto;
}

.webhook-details-section {
  margin-bottom: 15px;
}

.webhook-details-section h4 {
  margin-bottom: 10px;
  font-size: 14px;
  color: #17a2b8;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.webhook-json-data {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* Status badges para os logs de webhook */
.webhook-status-badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}

.status-success {
  background-color: #dff0d8;
  color: #3c763d;
}

.status-error {
  background-color: #f2dede;
  color: #a94442;
}

.status-pending {
  background-color: #fcf8e3;
  color: #8a6d3b;
}

/* Melhorias para células com conteúdo truncado */
.webhook-url-cell,
.webhook-error-cell {
  position: relative;
}

.webhook-url-truncated,
.webhook-error-truncated {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-url-tooltip,
.webhook-error-tooltip {
  display: none;
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 3px;
  z-index: 1000;
  max-width: 300px;
  word-break: break-all;
  font-size: 12px;
  left: 0;
  top: 100%;
}

.webhook-url-cell:hover .webhook-url-tooltip,
.webhook-error-cell:hover .webhook-error-tooltip {
  display: block;
}

/* Estilos para botões de ação */
.toggle-webhook-details .wcfmfa {
  transition: transform 0.2s ease;
}

.toggle-webhook-details:hover {
  background-color: #f5f5f5;
}

/* Animação para o ícone de dropdown */
.toggle-webhook-details .fa-chevron-up {
  transform: rotate(180deg);
}
