/**
 * Compartilhamento - Estilos para Links Compartilhados
 *
 * Componentes:
 * - Alert de compartilhamento
 * - Card com destaque e animação
 * - Badge "Compartilhado"
 * - Botão "Ver Mais Similares"
 * - Loading e erro
 *
 * Data: Janeiro 2025
 */

/* ========================================
   ALERT DE COMPARTILHAMENTO
   ======================================== */

.shared-alert {
  grid-column: 1 / -1; /* Ocupar toda a largura do grid */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  animation: slideInDown 0.5s ease-out;
}

.shared-alert-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shared-alert-content i {
  font-size: 2rem;
  opacity: 0.9;
}

.shared-alert-content strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.shared-alert-content p {
  margin: 0;
  opacity: 0.95;
  font-size: 0.95rem;
}

/* ========================================
   CARD COM DESTAQUE
   ======================================== */

.compartilhamento-highlight {
  position: relative;
  /* Borda sutil para indicar compartilhamento */
  border: 2px solid #f18719 !important;
  transition: all 0.3s ease;
}

.compartilhamento-loaded {
  /* Animação leve ao carregar */
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: forwards; /* Manter estado final da animação */
  opacity: 1 !important; /* Garantir visibilidade após animação */
}

/* Badge "Compartilhado" */
.compartilhamento-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f18719;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(241, 135, 25, 0.3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.compartilhamento-badge i {
  font-size: 0.9rem;
}

/* ========================================
   BOTÃO "VER MAIS SIMILARES"
   ======================================== */

.more-similar-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.btn-more-similar {
  background: #f18719;
  color: white;
  border: none;
  padding: 1.2rem 2.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(241, 135, 25, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.btn-more-similar:hover {
  background: #d97410;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(241, 135, 25, 0.4);
}

.btn-more-similar:active {
  transform: translateY(-1px);
}

.btn-more-similar i {
  font-size: 1.3rem;
  margin-right: 0.5rem;
}

.btn-more-similar small {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

/* ========================================
   LOADING E ERRO
   ======================================== */

.shared-loading,
.shared-error {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.shared-loading .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

.shared-loading p {
  font-size: 1.1rem;
  color: #666;
}

.shared-error {
  background: #fff5f5;
  border: 2px solid #fc8181;
  border-radius: 12px;
  padding: 3rem;
}

.shared-error i {
  font-size: 4rem;
  color: #fc8181;
  margin-bottom: 1.5rem;
}

.shared-error h3 {
  color: #c53030;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.shared-error p {
  color: #742a2a;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.btn-voltar-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #667eea;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-voltar-home:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* ========================================
   OPÇÕES DE COMPARTILHAMENTO (CHECKBOX)
   ======================================== */

.share-options {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: center;
}

.share-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  transition: color 0.2s ease;
}

.share-checkbox-label:hover {
  color: #212529;
}

/* Esconder o checkbox nativo mas manter funcionalidade */
.share-checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Checkbox customizado idêntico ao do menu de filtros */
.share-checkbox-label .filtro-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: white;
  flex-shrink: 0;
}

/* Estado selecionado */
.share-checkbox-label input[type="checkbox"]:checked ~ .filtro-checkbox {
  background: white;
  border-color: #f18719;
}

.share-checkbox-label input[type="checkbox"]:checked ~ .filtro-checkbox::after {
  content: '✓';
  color: #f18719;
  font-size: 12px;
  font-weight: bold;
}

.share-checkbox-label span {
  user-select: none;
  line-height: 1.4;
}

.share-hint {
  display: block;
  margin-top: 0.5rem;
  margin-left: 1.8rem;
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
  line-height: 1.3;
}

/* ========================================
   BOTÃO GERAR LINK
   ======================================== */

.share-generate-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.btn-generate-share {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 300px;
  justify-content: center;
}

.btn-generate-share:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.btn-generate-share:active {
  transform: translateY(-1px);
}

.btn-generate-share i {
  font-size: 1.1rem;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
  .shared-alert {
    padding: 1rem;
  }

  .shared-alert-content {
    flex-direction: column;
    text-align: center;
  }

  .shared-alert-content i {
    font-size: 1.5rem;
  }

  .compartilhamento-badge {
    top: 5px;
    right: 5px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .btn-more-similar {
    padding: 1.2rem 2rem;
    font-size: 1rem;
  }

  .shared-error {
    padding: 2rem 1rem;
  }

  .shared-error i {
    font-size: 3rem;
  }

  .shared-error h3 {
    font-size: 1.2rem;
  }
}

