/**
 * Correções para a Seção de Certificações
 * Data: 7 de Janeiro de 2025
 */

/* ========================================
   1. TAMANHO DAS IMAGENS DOS BADGES
   ======================================== */

/* Limitar tamanho das imagens na lista de certificações */
.section.works .box-items .box-item .image img {
  max-width: 160px;
  max-height: 160px;
  width: auto !important;
  height: auto !important;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

/* Sobrescrever width: 100% do CSS principal para certificações */
.section.works .box-items .box-item .image a img {
  width: auto !important;
  max-width: 160px !important;
  height: auto !important;
}

/* Regra específica para garantir que SVGs não sejam afetados pelo width 100% */
.section.works .box-items .box-item .image a img[src$=".svg"],
.section.works .box-items .box-item .image img[src$="scrum-psm1-badge.svg"],
.section.works .box-items .box-item .image img[src*="scrum-psm1"] {
  width: auto !important;
  max-width: 160px !important;
  height: auto !important;
  max-height: 160px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
}

/* Garantir que SVGs apareçam corretamente e sejam responsivos */
.section.works .box-items .box-item .image img[src$=".svg"] {
  background: transparent;
  max-width: 160px !important;
  max-height: 160px !important;
  width: auto !important;
  height: auto !important;
  min-width: auto !important;
  min-height: auto !important;
  padding: 0;
  object-fit: contain;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Garantir que o link do SVG também permita a exibição */
.section.works .box-items .box-item .image a[href*="cert-popup"] img[src$=".svg"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ajustar container da imagem para centralizar */
.section.works .box-items .box-item .image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #ffffff;
  border-radius: 8px;
  padding: 0px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: visible;
}

/* Garantir que o container permita exibição de SVG */
.section.works .box-items .box-item .image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Ícone do hover com cor visível */
.section.works .box-items .box-item .image .info .icon {
  color: #ffffff !important;
  background: rgba(59, 130, 246, 0.9);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 24px;
}

/* ========================================
   2. POPUP - BACKGROUND E CONTRASTE
   ======================================== */

/* Mudar background do popup de escuro para claro */
.popup-box {
  background: #ffffff !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
}

/* Ajustar cor do título no popup */
.popup-box .desc h4 {
  color: #1e293b !important;
  font-weight: 600;
}

/* Ajustar cor da categoria no popup */
.popup-box .category {
  color: #3b82f6 !important;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ajustar cor do texto no popup */
.popup-box .single-post-text,
.popup-box .single-post-text p,
.popup-box .single-post-text li {
  color: #475569 !important;
}

/* Ajustar cor dos títulos strong no popup */
.popup-box .single-post-text strong {
  color: #1e293b !important;
}

/* Limitar tamanho da imagem dentro do popup */
.popup-box .image img {
  max-width: 300px;
  max-height: 300px;
  width: auto !important;
  height: auto !important;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  padding: 20px;
}

/* SVG no popup com fundo transparente e responsivo */
.popup-box .image img[src$=".svg"] {
  background: transparent;
  max-width: 300px !important;
  max-height: 300px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Ajustar background da área da imagem no popup */
.popup-box .image {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 10px 30px 10px 30px;
}

/* ========================================
   3. BOTÃO "VER CREDENCIAL" NO POPUP
   ======================================== */

.popup-box .btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 15px 30px;
  background: #3b82f6;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.popup-box .btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.popup-box .btn .animated-button {
  display: block;
  width: 100%;
  text-align: center;
}

.popup-box .btn .animated-button span {
  color: #ffffff !important;
  display: inline-block;
  text-align: center;
}

/* ========================================
   4. BOTÃO DE FECHAR DO POPUP
   ======================================== */

.mfp-close-btn-in .mfp-close {
  color: #1e293b !important;
  background: #f1f5f9;
  border-radius: 50%;
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  top: 20px !important;
  right: 20px !important;
  opacity: 0.8;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.mfp-close-btn-in .mfp-close:hover {
  opacity: 1;
  background: #e2e8f0;
  transform: rotate(90deg);
}

/* ========================================
   5. RESPONSIVIDADE
   ======================================== */

@media (max-width: 720px) {
  /* Reduzir tamanho das imagens em mobile */
  .section.works .box-items .box-item .image img {
    max-width: 130px;
    max-height: 130px;
  }

  /* Garantir que SVGs também sejam responsivos em mobile */
  .section.works .box-items .box-item .image img[src$=".svg"] {
    max-width: 130px !important;
    max-height: 130px !important;
    width: auto !important;
    height: auto !important;
  }

  .section.works .box-items .box-item .image {
    min-height: 170px;
    padding: 15px;
  }

  /* Ajustar popup em mobile */
  .popup-box {
    width: 90% !important;
    margin: 20px auto;
  }

  .popup-box .image img {
    max-width: 200px;
    max-height: 200px;
    padding: 15px;
  }

  /* SVG no popup em mobile */
  .popup-box .image img[src$=".svg"] {
    max-width: 200px !important;
    max-height: 200px !important;
    width: auto !important;
    height: auto !important;
  }

  .popup-box .image {
    min-height: 180px;
    padding: 20px;
  }

  .popup-box .desc {
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  /* Ainda menor em telas muito pequenas */
  .section.works .box-items .box-item .image img {
    max-width: 110px;
    max-height: 110px;
  }

  /* Garantir que SVGs também sejam responsivos em telas muito pequenas */
  .section.works .box-items .box-item .image img[src$=".svg"] {
    max-width: 110px !important;
    max-height: 110px !important;
    width: auto !important;
    height: auto !important;
  }

  .section.works .box-items .box-item .image {
    min-height: 140px;
    padding: 10px;
  }

  .popup-box .image img {
    max-width: 150px;
    max-height: 150px;
    padding: 10px;
  }

  /* SVG no popup em telas muito pequenas */
  .popup-box .image img[src$=".svg"] {
    max-width: 150px !important;
    max-height: 150px !important;
    width: auto !important;
    height: auto !important;
  }

  .popup-box .image {
    min-height: 150px;
    padding: 15px;
  }
}

/* ========================================
   6. MELHORIAS VISUAIS ADICIONAIS
   ======================================== */

/* Adicionar sombra suave nas imagens da lista */
.section.works .box-items .box-item .image img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.section.works .box-items .box-item:hover .image img {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  transform: scale(1.05);
}

/* Melhorar espaçamento das listas no popup */
.popup-box .single-post-text ul {
  padding-left: 20px;
  margin: 15px 0;
}

.popup-box .single-post-text li {
  margin: 8px 0;
  line-height: 1.6;
}

/* Melhorar espaçamento dos parágrafos no popup */
.popup-box .single-post-text p {
  margin: 12px 0;
  line-height: 1.7;
}

/* Overlay do popup mais suave */
.mfp-fade.mfp-bg {
  background: rgba(0, 0, 0, 0.85) !important;
}
