/**
 * Facebook Popup - Niegles.fr
 * Popup d'invitation à rejoindre la page Facebook
 */

/* ===== Container du popup ===== */
.fb-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 320px;
  width: calc(100% - 40px);
  background: linear-gradient(135deg, #faf6f1 0%, #f5ede3 100%);
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(139, 69, 19, 0.1);
  border: 1px solid rgba(139, 69, 19, 0.15);
  overflow: hidden;

  /* Animation d'entrée */
  opacity: 0;
  transform: translateX(100%) scale(0.95);
  transition:
    opacity 0.4s ease-out,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fb-popup.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Animation de sortie */
.fb-popup.hiding {
  opacity: 0;
  transform: translateX(100%) scale(0.95);
  transition:
    opacity 0.3s ease-in,
    transform 0.3s ease-in;
}

/* ===== Header du popup ===== */
.fb-popup-header {
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-popup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.fb-popup-title img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

/* Bouton fermer */
.fb-popup-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.fb-popup-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== Corps du popup ===== */
.fb-popup-body {
  padding: 16px;
}

.fb-popup-message {
  color: #5a4a3a;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

/* ===== Bouton d'action ===== */
.fb-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1877F2 0%, #166FE5 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.fb-popup-btn:hover {
  background: linear-gradient(135deg, #166FE5 0%, #1469D8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.4);
}

.fb-popup-btn:active {
  transform: translateY(0);
}

.fb-popup-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

/* ===== Footer discret ===== */
.fb-popup-footer {
  padding: 8px 16px 12px;
  text-align: center;
}

.fb-popup-later {
  background: transparent;
  border: none;
  color: #8B7355;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fb-popup-later:hover {
  color: #5a4a3a;
}

/* ===== Theme sombre ===== */
.theme-dark .fb-popup {
  background: linear-gradient(135deg, #2a2520 0%, #1f1b18 100%);
  border-color: rgba(139, 69, 19, 0.3);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-dark .fb-popup-header {
  background: linear-gradient(135deg, #6B3410 0%, #7D3F15 100%);
}

.theme-dark .fb-popup-message {
  color: #d4c4b0;
}

.theme-dark .fb-popup-later {
  color: #a89880;
}

.theme-dark .fb-popup-later:hover {
  color: #d4c4b0;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .fb-popup {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .fb-popup-header {
    padding: 10px 14px;
  }

  .fb-popup-title {
    font-size: 0.95rem;
  }

  .fb-popup-body {
    padding: 14px;
  }

  .fb-popup-message {
    font-size: 0.85rem;
    margin-bottom: 14px;
  }

  .fb-popup-btn {
    padding: 11px 16px;
    font-size: 0.9rem;
  }
}

/* ===== Animation pulse subtile sur le bouton ===== */
@keyframes fb-pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(24, 119, 242, 0.5);
  }
}

.fb-popup.visible .fb-popup-btn {
  animation: fb-pulse 2s ease-in-out infinite;
  animation-delay: 0.5s;
}

.fb-popup-btn:hover {
  animation: none;
}
