/* AI Chat Widget */
.chat-widget-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: var(--theme-color-1, #e94b59);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.chat-widget-btn:hover {
  transform: scale(1.1);
}

.chat-widget-btn svg {
  width: 30px;
  height: 30px;
  fill: white;
}

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 500px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.chat-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.chat-header {
  background-color: var(--theme-color-1, #e94b59);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: #f8f9fa;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat-msg.user {
  background-color: var(--theme-color-1, #e94b59);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.chat-input-area {
  padding: 15px;
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s;
}

.chat-input-area input:focus {
  border-color: var(--theme-color-1, #e94b59);
}

.chat-input-area button {
  background-color: var(--theme-color-1, #e94b59);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

.chat-input-area button:hover {
  background-color: #d84351;
}

.chat-input-area button svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.chat-loading {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  align-self: flex-start;
  border-radius: 15px;
  border-bottom-left-radius: 5px;
}

.chat-loading.active {
  display: flex;
}

.chat-loading span {
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.chat-loading span:nth-child(2) { animation-delay: -0.16s; }

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

@media (max-width: 480px) {
  .chat-window {
    width: calc(100% - 40px);
    right: 20px;
    bottom: 90px;
  }
}
