/**
 * Estilos do Frontend - PDF Manuals Manager (Layout Lista/Tabela)
 */

/* Container principal */
.pdf-manuals-container {
  margin: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

/* Parágrafo inicial */
.pdf-manuals-intro {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #185b72;
  color: #495057;
  line-height: 1.6;
}

.pdf-manuals-intro p {
  margin: 0;
  font-size: 1rem;
}

/* Cabeçalho da tabela */
.pdf-manuals-header {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdf-manuals-header .header-icon {
  text-align: center;
}

.pdf-manuals-header .header-name {
  text-align: left;
}

.pdf-manuals-header .header-date {
  text-align: center;
  min-width: 100px;
}

.pdf-manuals-header .header-download {
  text-align: center;
  min-width: 120px;
}

/* Lista de manuais */
.pdf-manuals-list {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Item da lista */
.pdf-manual-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f3f4;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pdf-manual-item:last-child {
  border-bottom: none;
}

.pdf-manual-item:hover {
  background: #f8f9fa;
  transform: translateX(2px);
}

/* Ícone PDF pequeno e vermelho */
.manual-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #dc3545;
  border-radius: 4px;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
}

.manual-icon svg {
  width: 14px;
  height: 14px;
}

/* Conteúdo do manual */
.manual-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.manual-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #212529;
  margin: 0;
  line-height: 1.3;
}

.manual-description {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.2;
}

/* Data */
.manual-date {
  font-size: 0.85rem;
  color: #6c757d;
  text-align: center;
  min-width: 100px;
}

/* Botão de download */
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #185b72;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  min-width: 100px;
}

.download-button:hover {
  background: #0f4a5c;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(24, 91, 114, 0.3);
}

.download-button:focus {
  outline: 2px solid #185b72;
  outline-offset: 2px;
}

.download-button svg {
  width: 12px;
  height: 12px;
}

/* Estados de loading */
.download-button.downloading {
  background: #6c757d;
  cursor: not-allowed;
}

.download-button.downloaded {
  background: #28a745;
}

/* Mensagem quando não há manuais */
.no-manuals-found {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.no-results-icon {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-manuals-found h3 {
  margin: 0 0 0.5rem 0;
  color: #495057;
}

.no-manuals-found p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .pdf-manuals-container {
    margin: 1rem 0;
  }

  .pdf-manuals-intro {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .pdf-manuals-header {
    grid-template-columns: 30px 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
  }

  .pdf-manuals-header .header-date {
    display: none;
  }

  .pdf-manual-item .manual-date {
    display: none;
  }

  .pdf-manual-item {
    grid-template-columns: 40px 1fr auto;
  }

  .manual-icon {
    width: 20px;
    height: 20px;
  }

  .manual-icon svg {
    width: 12px;
    height: 12px;
  }

  .manual-title {
    font-size: 0.9rem;
  }

  .manual-description {
    font-size: 0.75rem;
  }

  .manual-date {
    display: none;
  }

  .download-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .pdf-manuals-header {
    padding: 0.5rem;
  }

  .pdf-manual-item {
    padding: 0.5rem;
  }

  .manual-content {
    gap: 0.1rem;
  }

  .download-button {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    min-width: 70px;
  }
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pdf-manual-item {
  animation: fadeIn 0.3s ease-out;
}

/* Acessibilidade */
.download-button:focus-visible {
  outline: 2px solid #185b72;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .pdf-manuals-container {
    break-inside: avoid;
  }

  .pdf-manual-item {
    border: 1px solid #000;
    break-inside: avoid;
  }
}

/* Paginação */
.pdf-manuals-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px 0 20px;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-link:hover {
  background: #f8f9fa;
  border-color: #007cba;
  color: #007cba;
  text-decoration: none;
}

.pagination-link svg {
  width: 16px;
  height: 16px;
}

.pagination-numbers {
  display: flex;
  gap: 5px;
}

.pagination-current {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: #007cba;
  color: white;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.pagination-info {
  text-align: center;
  margin-top: 10px;
}

.pagination-info p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Responsividade da paginação */
@media (max-width: 480px) {
  .pdf-manuals-pagination {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pagination-numbers {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }

  .pagination-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .pagination-current {
    padding: 6px 10px;
    font-size: 13px;
  }
}
