/**
 * Styles CSS pour le pop-up de contact Drupal 9
 * À ajouter dans votre thème ou module personnalisé
 */

/* Overlay du modal */
.contact-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

/* Contenu du modal */
.contact-popup-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
  direction: rtl;
  text-align: right;
}

/* En-tête du modal */
.contact-popup-header {
  text-align: center;
  margin-bottom: 25px;
}

.contact-popup-title {
  color: #333;
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: bold;
}

.contact-popup-subtitle {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Bouton de fermeture */
.contact-popup-close {
  position: absolute;
  top: 15px;
  left: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.contact-popup-close:hover {
  background: #f0f0f0;
  color: #333;
}

/* Formulaire */
.contact-popup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-popup-form .form-group {
  display: flex;
  flex-direction: column;
}

.contact-popup-form label {
  margin-bottom: 5px;
  color: #333;
  font-weight: 500;
  text-align: right;
}

.contact-popup-form input,
.contact-popup-form textarea {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  direction: rtl;
  text-align: right;
}

.contact-popup-form input:focus,
.contact-popup-form textarea:focus {
  outline: none;
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.contact-popup-form textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Boutons d'action */
.contact-popup-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.contact-popup-actions .btn {
  flex: 1;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
}

.contact-popup-email-btn {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
}

.contact-popup-email-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.contact-popup-whatsapp-btn {
  background: linear-gradient(45deg, #25D366, #128C7E);
  color: white;
}

.contact-popup-whatsapp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Message de succès */
.contact-popup-success {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  text-align: center;
  font-weight: 500;
}

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

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

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

/* Empêcher le défilement du body quand le modal est ouvert */
body.contact-popup-open {
  overflow: hidden;
}

/* Boutons CTA pour déclencher le pop-up */
/* .contact-popup-trigger {
  background: linear-gradient(45deg, #ff9a56, #ff6b35);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  text-decoration: none;
  display: inline-block;
  text-align: center;
} */

/* .contact-popup-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  color: white;
  text-decoration: none;
} */

.contact-popup-trigger {
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .contact-popup-content {
    padding: 20px;
    margin: 20px;
    width: calc(100% - 40px);
  }

  .contact-popup-actions {
    flex-direction: column;
  }

  .contact-popup-title {
    font-size: 20px;
  }

  .contact-popup-form input,
  .contact-popup-form textarea {
    font-size: 16px;
    /* Éviter le zoom sur iOS */
  }
}

@media (max-width: 480px) {
  .contact-popup-content {
    padding: 15px;
    margin: 10px;
    width: calc(100% - 20px);
  }

  .contact-popup-actions .btn {
    padding: 15px 20px;
    font-size: 14px;
  }
}

/* Styles pour l'intégration avec les thèmes Drupal populaires */

/* Bootstrap compatibility */
.contact-popup-form .form-group label {
  margin-bottom: 0.5rem;
}

.contact-popup-form .form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Amélioration de l'accessibilité */
.contact-popup-overlay:focus-within .contact-popup-content {
  outline: 2px solid #ff6b35;
  outline-offset: 2px;
}

.contact-popup-form input:invalid,
.contact-popup-form textarea:invalid {
  border-color: #dc3545;
}

.contact-popup-form input:valid,
.contact-popup-form textarea:valid {
  border-color: #28a745;
}

/* Loading state */
.contact-popup-form.loading .btn {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.contact-popup-form.loading .btn::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

  100% {
    transform: rotate(360deg);
  }
}