/* Styles CSS pour le bouton flottant extensible - Version corrigée v1.1.0 */

/* Bouton flottant de base */
.xplore-float-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9998;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  min-width: 50px;
  width: 50px;
  height: 50px;
  max-width: 400px;
  overflow: hidden;
  animation: xplore-pulse 2s infinite;
}

/* Couleurs personnalisées via CSS custom properties */
.xplore-float-button {
  background: linear-gradient(
    135deg,
    var(--xplore-button-color, #667eea) 0%,
    var(--xplore-background-color, #764ba2) 100%
  ) !important;
}

/* Appliquer les couleurs personnalisées au bouton de soumission */
.xplore-float-button .xplore-btn-primary {
  background: linear-gradient(
    135deg,
    var(--xplore-button-color, #667eea) 0%,
    var(--xplore-background-color, #764ba2) 100%
  ) !important;
}

/* Contenu du bouton principal */
.xplore-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  transition: all 0.3s ease;
  width: 100%;
  height: 100%;
}

.xplore-float-button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
}

.xplore-phone-icon {
  opacity: 1;
  transition: opacity 0.3s ease, color 0.3s ease;
  color: var(--xplore-phone-color, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
}

.xplore-phone-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Bouton de fermeture en haut à droite */
.xplore-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
}

.xplore-close-button:hover {
  background: none;
  transform: scale(1.1);
}

.xplore-close-icon {
  color: #6b7280;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

/* Quand le bouton est étendu, masquer l'icône téléphone et afficher la croix */
.xplore-float-button.expanded .xplore-phone-icon {
  opacity: 0;
}

.xplore-float-button.expanded .xplore-close-button {
  opacity: 1;
  visibility: visible;
  top: 10px;
  right: 10px;
}

.xplore-float-button-text {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Formulaire étendu */
.xplore-expanded-form {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border-radius: 0 0 25px 25px;
}

/* État étendu */
.xplore-float-button.expanded {
  border-radius: 25px 25px 25px 25px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  max-height: 600px;
  width: auto;
  min-width: 300px;
  height: auto;
}

.xplore-float-button.expanded .xplore-expanded-form {
  max-height: 500px;
  padding: 0 20px 20px 20px;
}

.xplore-float-button.expanded .xplore-button-content {
  padding: 15px 20px 10px 20px;
}

/* En-tête du formulaire */
.xplore-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0 8px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.xplore-form-header h4 {
  margin: 0 0 0 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* Contenu du formulaire */
.xplore-form-content {
  color: #374151;
}

.xplore-form-description {
  margin: 0 0 15px 0;
  color: #6b7280;
  line-height: 1.5;
  font-size: 13px;
}

/* Formulaire */
.xplore-callback-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.xplore-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xplore-form-group label {
  font-weight: 500;
  color: #374151;
  font-size: 13px;
}

.required {
  color: #ef4444;
}

.xplore-form-input,
.xplore-form-select {
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

.xplore-form-input:focus,
.xplore-form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.xplore-form-select option.disabled-time {
  color: #9ca3af;
  background-color: #f3f4f6;
}

.xplore-form-input.error,
.xplore-form-select.error {
  border-color: #ef4444;
}

.xplore-field-error {
  color: #ef4444;
  font-size: 11px;
  margin-top: 2px;
  display: none;
}

.xplore-field-error.show {
  display: block;
}

/* Actions du formulaire */
.xplore-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.xplore-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.xplore-btn-primary {
  background: linear-gradient(
    135deg,
    var(--xplore-button-color, #667eea) 0%,
    var(--xplore-background-color, #764ba2) 100%
  );
  color: white;
}

.xplore-btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--xplore-button-color-hover, #5a6fd8) 0%,
    var(--xplore-background-color-hover, #6a4190) 100%
  );
  transform: translateY(-1px);
}

.xplore-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.xplore-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.xplore-btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.xplore-btn-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Animation de pulsation */
@keyframes xplore-pulse {
  0% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4),
      0 0 0 10px rgba(102, 126, 234, 0.1);
  }
  100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }
}

/* Message de succès */
.xplore-success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  animation: xplore-success-slide 0.3s ease-out;
  max-width: 300px;
  min-width: 250px;
}

@keyframes xplore-success-slide {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.xplore-success-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  position: relative;
}

.xplore-success-icon {
  width: 32px;
  height: 32px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

.xplore-success-text h4 {
  margin: 0 0 3px 0;
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
}

.xplore-success-text p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.3;
}

.xplore-success-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: white;
  border: none;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.xplore-success-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Responsive */
@media (max-width: 768px) {
  .xplore-float-button {
    bottom: 15px;
    left: 15px;
    right: 15px;
    max-width: none;
    width: 50px;
    height: 50px;
  }

  .xplore-float-button.expanded {
    max-height: 70vh;
    width: auto;
    min-width: calc(100vw - 30px);
    height: auto;
  }

  .xplore-float-button.expanded .xplore-expanded-form {
    max-height: 60vh;
    overflow-y: auto;
  }

  .xplore-button-content {
    padding: 12px 16px;
    font-size: 13px;
  }

  .xplore-float-button-text {
    display: none;
  }

  .xplore-form-actions {
    flex-direction: column;
  }

  .xplore-success-message {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .xplore-float-button {
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
  }

  .xplore-float-button.expanded {
    width: auto;
    min-width: calc(100vw - 20px);
    height: auto;
  }

  .xplore-button-content {
    padding: 10px 12px;
    min-width: 50px;
  }

  .xplore-form-header h4 {
    font-size: 14px;
  }

  .xplore-expanded-form {
    padding: 0 15px 15px 15px;
  }
}

/* Animation d'entrée du bouton */
.xplore-float-button {
  animation: xplore-bounce-in 0.6s ease-out, xplore-pulse 2s infinite 1s;
}

@keyframes xplore-bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  70% {
    transform: scale(0.95) translateY(5px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* Effet de survol pour le bouton principal */
.xplore-button-content:hover {
  transform: translateY(-1px);
}

/* Transition douce pour l'expansion */
.xplore-float-button.expanding {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
