/* Styles pour le Personal Shopper Chat Widget */
:root {
  --ps-gradient-color1: #667eea;
  --ps-gradient-color2: #764ba2;
  --ps-secondary-color: #f0f0f0;
  --ps-text-color: #333333;
}

p {
  margin-bottom: 0;
}

.personal-shopper-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "Open Sans", Arial, sans-serif;
}

/* Bouton de chat */
.ps-chat-button {
  background: linear-gradient(
    135deg,
    var(--ps-gradient-color1) 0%,
    var(--ps-gradient-color2) 100%
  );
  color: white;
  padding: 15px 20px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.ps-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.ps-chat-button i {
  font-size: 20px;
}

/* Fenêtre de chat */
.ps-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e1e8ed;
}

/* Header du chat */
.ps-chat-header {
  background: linear-gradient(
    135deg,
    var(--ps-gradient-color1) 0%,
    var(--ps-gradient-color2) 100%
  );
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: grab;
  user-select: none;
  position: relative;
}

.ps-chat-header:active {
  cursor: grabbing;
}

.ps-chat-header-content {
  flex: 1;
}

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

.ps-chat-subtitle {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
  display: block;
}

.ps-chat-header-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ps-chat-clear,
.ps-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.ps-chat-clear i {
  font-size: 18px;
}

.ps-chat-close {
  font-size: 24px;
}

.ps-chat-clear:hover,
.ps-chat-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Zone des messages */
.ps-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #f8f9fa;
}

/* Messages */
.ps-message {
  margin-bottom: 15px;
  animation: fadeInUp 0.3s ease;
}

.ps-message-user {
  text-align: right;
}

.ps-message-assistant {
  text-align: left;
}

.ps-message-content {
  display: inline-block;
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.4;
  word-wrap: break-word;
}

.ps-message-user .ps-message-content {
  background: linear-gradient(
    135deg,
    var(--ps-gradient-color1) 0%,
    var(--ps-gradient-color2) 100%
  );
  color: white;
  border-bottom-right-radius: 5px;
}

.ps-message-assistant .ps-message-content {
  background: var(--ps-secondary-color);
  color: var(--ps-text-color);
  border: 1px solid #e1e8ed;
  border-bottom-left-radius: 5px;
}

/* Produits recommandés */
.ps-recommended-products {
  margin-top: 10px;
}

.ps-products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ps-product-card {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.ps-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
}

.ps-product-image {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 8px;
}

.ps-product-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.3;
  color: rgb(51, 51, 51);
}

.ps-product-price {
  color: var(--ps-gradient-color1);
  font-weight: bold;
  font-size: 14px;
}

/* Zone de saisie */
.ps-chat-input-container {
  padding: 15px 20px;
  background: white;
  border-top: 1px solid #e1e8ed;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ps-chat-input-container textarea {
  flex: 1;
  border: 1px solid #e1e8ed;
  border-radius: 20px;
  padding: 12px 16px;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
}

.ps-chat-input-container textarea:focus {
  border-color: var(--ps-gradient-color1);
}

.ps-chat-send {
  background: linear-gradient(
    135deg,
    var(--ps-gradient-color1) 0%,
    var(--ps-gradient-color2) 100%
  );
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ps-chat-send:hover {
  transform: scale(1.05);
}

.ps-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Indicateur de chargement */
.ps-chat-loading {
  padding: 15px 20px;
  background: white;
  border-top: 1px solid #e1e8ed;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-size: 14px;
}

.ps-loading-dots {
  display: flex;
  gap: 4px;
}

.ps-loading-dots div {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--ps-gradient-color1);
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.ps-loading-dots div:nth-child(1) {
  animation-delay: -0.32s;
}
.ps-loading-dots div:nth-child(2) {
  animation-delay: -0.16s;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loadingDots {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .ps-chat-window {
    width: 100vw;
    bottom: 0;
    right: 0;
    border-radius: 0;
    position: fixed;
    height: 75vh;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }

  .ps-chat-button {
    bottom: 20px;
    right: 20px;
  }
}

/* Scrollbar personnalisée */
.ps-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ps-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ps-chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.ps-chat-messages::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}
