/* Gallery Container */
.gp-gallery-container {
  margin: 30px 0;
  max-width: 100%;
}

.gp-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  padding: 0;
  margin: 0;
}

/* Responsive columns */
.gp-gallery-container[data-columns="1"] .gp-gallery-grid {
  grid-template-columns: 1fr;
}

.gp-gallery-container[data-columns="2"] .gp-gallery-grid {
  grid-template-columns: repeat(2, 1fr);
}

.gp-gallery-container[data-columns="4"] .gp-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
}

.gp-gallery-container[data-columns="5"] .gp-gallery-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* Gallery Items */
.gp-gallery-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  height: 380px;
  width: 100%;
  display: flex;
  align-items: stretch;
}

.gp-gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.gp-gallery-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.gp-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.3s ease;
  cursor: pointer;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 8px;
  min-width: 100%;
  min-height: 100%;
}

.gp-gallery-item:hover .gp-gallery-image {
  transform: scale(1.05);
}

/* Overlay - CORRIGIDO: Aparece apenas no clique */
.gp-gallery-overlay {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
	background-color: #050505;
  /* background: rgba(0, 0, 0, 0.85); */
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-height: 130px;
  min-height: 100px;
  z-index: 10;
  pointer-events: none;
  visibility: hidden;
}

/* Classe para mostrar o overlay quando clicado */
.gp-gallery-item.show-overlay .gp-gallery-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* Elementos dentro do overlay podem ser clicados */
.gp-gallery-overlay * {
  pointer-events: auto;
}

/* CORRIGIDO: Imagem de link externo no canto superior direito do overlay */
.gp-external-link-image {
  position: absolute;
  top: -15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 40px;
  padding: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 15;
  pointer-events: auto; /* NOVO: Sempre clicável */
  text-decoration: none; /* Remove decoração do link */
}

.gp-external-link-image:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gp-external-link-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.gp-gallery-title {
  margin: 0 0 3px 0;
  font-size: 14px;
  font-weight: 600;
  color: white;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 30px);
}

.gp-gallery-description {
  margin: 0 0 6px 0;
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-wrap: break-word;
  hyphens: auto;
  max-width: calc(100% - 30px);
}

/* Overlay Actions */
.gp-gallery-overlay-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 4px;
  flex-shrink: 0;
}

.gp-like-btn {
  background: transparent;
  border: none;
  padding: 3px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
  pointer-events: auto; /* NOVO: Sempre clicável */
}

.gp-like-btn:hover {
  transform: scale(1.1);
}

.gp-like-btn.liked {
  color: #818181;
}

.gp-like-btn.liked:hover {
  color: #818181;
  transform: scale(1.1);
}

.gp-like-btn.liked .gp-heart {
  animation: heartBeat 0.3s ease;
}

/* REMOVIDO: Antigo estilo do botão de link externo */
.gp-external-link {
  display: none; /* Oculta o antigo botão */
}

/* Lightbox */
.gp-lightbox {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.gp-lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
}

.gp-lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
}

.gp-lightbox-close:hover {
  color: #ff6b6b;
}

.gp-lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: white;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 8px;
}

.gp-lightbox-caption h4 {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: white;
}

.gp-lightbox-caption p {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
}

.gp-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 24px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  padding: 15px 20px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.gp-lightbox-prev {
  left: 30px;
}

.gp-lightbox-next {
  right: 30px;
}

.gp-lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #ff6b6b;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .gp-gallery-container[data-columns="4"] .gp-gallery-grid,
  .gp-gallery-container[data-columns="5"] .gp-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gp-gallery-item {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .gp-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .gp-gallery-item {
    height: 280px;
    width: 100%;
  }

  .gp-gallery-image-wrapper {
    border-radius: 8px;
  }

  .gp-gallery-image {
    border-radius: 8px;
  }

  .gp-gallery-overlay {
    max-height: 115px;
    min-height: 85px;
    padding: 16px 10px;
    bottom: 6px;
    left: 6px;
    right: 6px;
  }

  .gp-gallery-title {
    font-size: 13px;
    max-width: calc(100% - 25px);
  }

  .gp-gallery-description {
    font-size: 12px;
    max-width: calc(100% - 25px);
  }

  .gp-like-btn {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* Imagem de link externo responsiva   */
  .gp-external-link-image {
    width: 30px !important;
    height: 30px !important;
    top: -15px;
    right: 15px;
  }

  .gp-lightbox-content {
    max-width: 95%;
    max-height: 70%;
  }

  .gp-lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }

  .gp-lightbox-caption {
    bottom: 10px;
    left: 10px;
    right: 10px;
    padding: 15px;
  }

  .gp-lightbox-nav {
    font-size: 20px;
    padding: 12px 15px;
  }

  .gp-lightbox-prev {
    left: 15px;
  }

  .gp-lightbox-next {
    right: 15px;
  }
}

@media (max-width: 480px) {
  .gp-gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 6px;
  }

  .gp-gallery-item {
    height: 320px;
    width: 100%;
  }

  .gp-gallery-overlay {
    max-height: 100px;
    min-height: 75px;
    bottom: 4px;
    left: 4px;
    right: 4px;
  }

  .gp-gallery-title,
  .gp-gallery-description {
    font-size: 11px;
    max-width: calc(100% - 20px);
  }

  /* Imagem de link externo ainda menor em mobile */
  .gp-external-link-image {
    width: 18px;
    height: 18px;
    top: -10px;
    right: 17px;
  }
}

/* Loading states */
.gp-gallery-item.loading {
  opacity: 0.7;
}

.gp-like-btn.processing {
  pointer-events: none;
  opacity: 0.6;
}

/* Custom scrollbar for modal */
.gp-lightbox-caption::-webkit-scrollbar {
  width: 6px;
}

.gp-lightbox-caption::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.gp-lightbox-caption::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* Prevent body scroll when lightbox is open */
body.gp-lightbox-open {
  overflow: hidden;
}

/* Like Popup Message */
.gp-like-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #333;
  color: white;
  padding: 20px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  z-index: 100000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 250px;
}

.gp-like-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gp-like-popup::before {
  content: "❤️";
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
}

/* Responsividade para Mobile (2 colunas) */
@media (max-width: 768px) {
    .gp-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Correção para o botão de like em mobile */
@media (max-width: 480px) {
    .gp-gallery-overlay-actions {
        position: absolute;
        bottom: 10px;
        right: 10px;
        /* Alinha os itens para a direita se houver mais de um */
        display: flex;
        justify-content: flex-end;
    }
}

/* Correção de alinhamento de texto em mobile */
@media (max-width: 480px) {
    .gp-gallery-content {
        text-align: left !important;
    }

    .gp-gallery-title,
    .gp-gallery-description {
        text-align: left !important;
    }
}

/* Oculta a descrição do portfolio em mobile */
@media (max-width: 480px) {
    .gp-gallery-description {
        display: none !important;
    }
}

/* NOVO: Estilos para o ícone de 'ver agora' */
.gp-see-now-overlay {
    position: absolute;
    bottom: 0; /* Começa na base */
    left: 50%;
    transform: translateX(-50%) translateY(100%); /* Oculta para baixo */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Animação suave */
    z-index: 10;
    padding: 10px; /* Margem interna */
}

.gp-see-now-icon {
    width: 32px !important;
    height: 32px !important;
    display: block; /* Para garantir que as dimensões sejam respeitadas */
}

/* Animação no hover do item */
.gp-gallery-item:hover .gp-see-now-overlay {
    transform: translateX(-50%) translateY(0); /* Sobe para a posição */
    opacity: 1; /* Fade-in */
}

/* NOVO: Popup de Agradecimento com Imagem */
.gp-like-image-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 100000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  pointer-events: none; /* Impede que o usuário clique no popup */
}

.gp-like-image-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gp-like-image-popup img {
  display: block;
  width: 100%;
  max-width: 180px; /* Ajuste o tamanho da imagem se necessário */
  height: auto;
}

