/* ESTILOS ESPECÍFICOS PARA CERTIFICADOS */

/* Hero Certificados */
.hero-certificados {
  padding: 80px 4% 40px 4%;
  text-align: center;
}

.hero-certificados h1 {
  color: #fff;
  font-size: 48px;
  margin-bottom: 20px;
}

.hero-certificados h1 span {
  color: #00ff08;
}

.hero-certificados p {
  color: #fff;
  font-size: 18px;
  margin-bottom: 40px;
}

/* Estatísticas */
.stats-certificados {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #111, #222);
  border-radius: 15px;
  border: 1px solid #333;
  min-width: 120px;
  transition: .3s;
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 255, 8, 0.2);
  border-color: #00ff08;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #00ff08;
  margin-bottom: 5px;
}

.stat-label {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* Filtros */
.filtros-certificados {
  padding: 40px 4%;
  background: #111;
}

.filtros-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filtro-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 25px;
  cursor: pointer;
  transition: .3s;
  font-weight: 500;
  font-size: 14px;
}

.filtro-btn:hover,
.filtro-btn.active {
  background: #00ff08;
  color: #000;
  border-color: #00ff08;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 8, 0.3);
}

.filtro-btn i {
  font-size: 16px;
}

/* Grid de Certificados */
.certificados-grid {
  padding: 60px 4%;
}

.certificados-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.certificado-card {
  background: linear-gradient(135deg, #111, #1a1a1a);
  border-radius: 20px;
  border: 1px solid #333;
  overflow: hidden;
  transition: .3s;
  position: relative;
}

.certificado-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 255, 8, 0.15);
  border-color: #00ff08;
}

.certificado-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00ff08, #00cc06);
}

/* Certificado Header Atualizado */
.certificado-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 25px 25px 15px 25px;
  gap: 20px;
}

.certificado-info {
  display: flex;
  gap: 15px;
  flex: 1;
}

.certificado-details h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
}

.certificado-details .instituicao {
  color: #00ff08;
  font-weight: 500;
  margin-bottom: 10px;
  font-size: 14px;
}

.certificado-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.certificado-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #00ff08, #00cc06);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #000;
}

.certificado-badge {
  background: rgba(0, 255, 8, 0.1);
  color: #00ff08;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0, 255, 8, 0.3);
}

.certificado-content {
  padding: 20px 25px;
}

.certificado-content h3 {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.instituicao {
  color: #00ff08;
  font-weight: 500;
  margin-bottom: 12px;
  font-size: 14px;
}

.descricao {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 14px;
}

.certificado-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.duracao,
.data {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #999;
  font-size: 13px;
}

.duracao i,
.data i {
  color: #00ff08;
}

.certificado-actions {
  display: flex;
  gap: 10px;
  padding: 0 25px 25px 25px;
}

.btn-visualizar,
.btn-download {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: .3s;
  font-weight: 500;
  font-size: 14px;
}

.btn-visualizar {
  background: rgba(0, 255, 8, 0.1);
  color: #00ff08;
  border: 1px solid rgba(0, 255, 8, 0.3);
}

.btn-visualizar:hover {
  background: #00ff08;
  color: #000;
  transform: translateY(-2px);
}

.btn-download {
  background: #333;
  color: #fff;
  border: 1px solid #444;
}

.btn-download:hover {
  background: #444;
  transform: translateY(-2px);
}

/* Botão Tela Cheia */
.btn-fullscreen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #333;
  color: #fff;
  border: 1px solid #444;
  border-radius: 10px;
  cursor: pointer;
  transition: .3s;
  font-weight: 500;
  font-size: 14px;
}

.btn-fullscreen:hover {
  background: #00ff08;
  color: #000;
  border-color: #00ff08;
  transform: translateY(-2px);
}

/* Modal */
.modal-certificado {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  height: 90%;
  background: #111;
  border-radius: 20px;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #333;
  background: #1a1a1a;
}

.modal-header h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.btn-fechar-modal {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: .2s;
}

.btn-fechar-modal:hover {
  background: #333;
  color: #00ff08;
}

.modal-body {
  flex: 1;
  padding: 0;
  position: relative;
}

#pdfViewer {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* PDF Container */
.pdf-container {
  margin: 20px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #333;
  background: #fff;
  position: relative;
}

.pdf-container embed {
  display: block;
  border: none;
  border-radius: 8px;
  min-height: 400px;
}

.pdf-fallback {
  display: none;
  text-align: center;
  padding: 40px 20px;
  background: #222;
  color: #fff;
  margin: 0;
}

.pdf-fallback a {
  color: #00ff08;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid #00ff08;
  border-radius: 8px;
  transition: .3s;
}

.pdf-fallback a:hover {
  background: #00ff08;
  color: #000;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #333;
  background: #1a1a1a;
  text-align: center;
}

.btn-download-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #00ff08;
  color: #000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: .3s;
}

.btn-download-modal:hover {
  background: #00cc06;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 8, 0.3);
}

/* Animações */
.certificado-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.certificado-card:nth-child(1) {
  animation-delay: 0.1s;
}
.certificado-card:nth-child(2) {
  animation-delay: 0.2s;
}
.certificado-card:nth-child(3) {
  animation-delay: 0.3s;
}
.certificado-card:nth-child(4) {
  animation-delay: 0.4s;
}
.certificado-card:nth-child(5) {
  animation-delay: 0.5s;
}
.certificado-card:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filtro ativo */
.certificado-card.hidden {
  display: none;
}

/* Responsividade */
@media screen and (max-width: 1020px) {
  .hero-certificados h1 {
    font-size: 36px;
  }

  .stats-certificados {
    gap: 30px;
  }

  .certificados-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .filtros-container {
    gap: 10px;
  }

  .filtro-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
    height: 85%;
  }
}

@media screen and (max-width: 768px) {
  .hero-certificados {
    padding: 60px 8% 30px 8%;
  }

  .hero-certificados h1 {
    font-size: 28px;
  }

  .stats-certificados {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .stat-item {
    min-width: 100px;
  }

  .certificados-grid {
    padding: 40px 8%;
  }

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

  .btn-visualizar,
  .btn-download {
    flex: none;
  }

  .filtros-certificados {
    padding: 30px 8%;
  }

  .filtros-container {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .filtro-btn {
    flex-shrink: 0;
  }

  .pdf-container embed {
    height: 300px;
  }

  .certificado-header {
    flex-direction: column;
    gap: 15px;
  }

  .certificado-info {
    flex-direction: column;
    gap: 10px;
  }

  .certificado-meta {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 480px) {
  .certificados-container {
    grid-template-columns: 1fr;
  }

  .certificado-card {
    margin: 0 10px;
  }

  .modal-content {
    width: 98%;
    height: 90%;
    border-radius: 10px;
  }

  .modal-header,
  .modal-footer {
    padding: 15px 20px;
  }

  .pdf-container embed {
    height: 250px;
  }

  .certificado-actions {
    flex-direction: column;
    gap: 10px;
  }
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #00ff08;
  font-size: 18px;
}

.loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #00ff08;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Loading para PDFs */
.pdf-container::before {
  content: "Carregando PDF...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
}

.pdf-container embed:not([src=""]) + .pdf-container::before {
  display: none;
}

/* Fallback para navegadores que não suportam embed */
@supports not (display: block) {
  .pdf-container embed {
    display: none;
  }

  .pdf-fallback {
    display: block;
  }
}
