/**
 * Impact Imprimerie Chat Widget Styles
 */

/* Bouton flottant */
.impact-chat-button {
  position: fixed;
  z-index: 9998;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(0, 134, 205, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: pulse 2s infinite;
}

.impact-chat-button svg {
  width: 28px;
  height: 28px;
}

.impact-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 134, 205, 0.4);
}

.impact-chat-button:active {
  transform: scale(0.95);
}

.impact-chat-button.hidden {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(0, 134, 205, 0.4);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(0, 134, 205, 0);
  }
}

/* Overlay */
.impact-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.impact-chat-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.impact-chat-modal {
  position: fixed;
  z-index: 10000;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.impact-chat-modal.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Desktop */
@media (min-width: 768px) {
  .impact-chat-modal {
    bottom: 20px;
    right: 20px;
    transform: scale(0.9) translateY(20px);
    width: 420px;
    height: 650px;
    max-height: 90vh;
  }
  
  .impact-chat-modal.active {
    transform: scale(1) translateY(0);
  }
}

/* Mobile */
@media (max-width: 767px) {
  .impact-chat-modal {
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 400px;
    height: 80vh;
    max-height: 600px;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
  }
  
  .impact-chat-modal.active {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Header */
.impact-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0086CD, #ACC8E5);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.impact-chat-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.impact-chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.impact-chat-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.impact-chat-close svg {
  width: 24px;
  height: 24px;
}

/* Content */
.impact-chat-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Loading */
.impact-chat-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  z-index: 1;
}

.impact-chat-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #0086CD;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.impact-chat-loading p {
  margin-top: 16px;
  color: #64748b;
  font-size: 14px;
}

/* Iframe */
#impact-chat-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Focus trap pour accessibilité */
.impact-chat-modal:focus {
  outline: none;
}

/* Améliorer la lisibilité sur fond sombre */
@media (prefers-color-scheme: dark) {
  .impact-chat-modal {
    background-color: #1e293b;
  }
  
  .impact-chat-loading {
    background-color: #1e293b;
  }
  
  .impact-chat-loading p {
    color: #94a3b8;
  }
}
