/**
 * Techsoul AI Chat Widget - Enhanced Design
 */

/* Chat container */
#n8n-chat {
  --chat-primary-color: #30a77b;
  --chat-text-color: #333;
  --chat-bg-color: #f8f8f8;
  --chat-border-radius: 12px;
  --chat-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
}

/* Chat window */
.chat-window-wrapper .chat-window {
  border-radius: var(--chat-border-radius) !important;
  box-shadow: var(--chat-shadow) !important;
  overflow: hidden;
  border: none !important;
}

/* Chat layout */
.chat-window-wrapper .chat-window .chat-layout {
  border-radius: var(--chat-border-radius) !important;
  background: var(--chat-bg-color) !important;
  padding: 0 !important;
}

/* Chat header */
.chat-layout .chat-header {
  padding: 16px 20px !important;
  border-top-left-radius: var(--chat-border-radius) !important;
  border-top-right-radius: var(--chat-border-radius) !important;
  background: var(--chat-primary-color) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-layout .chat-header h1 {
  font-size: 18px !important;
  font-weight: 600 !important;
  margin: 0 0 4px 0 !important;
  color: white !important;
}

.chat-layout .chat-header p {
  font-size: 13px !important;
  margin: 0 !important;
  opacity: 0.9;
  color: white !important;
}

/* Messages area */
.chat-messages {
  padding: 20px !important;
  height: 320px !important;
  overflow-y: auto;
  background-color: white !important;
}

/* Bot messages */
.chat-message.chat-message-from-bot {
  background-color: #f0f0f0 !important;
  color: var(--chat-text-color) !important;
  border-radius: 16px 16px 16px 4px !important;
  padding: 12px 16px !important;
  margin-bottom: 12px !important;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.5;
  font-size: 14px;
  animation: fadeIn 0.3s ease-in-out;
}

/* User messages */
.chat-message.chat-message-from-user:not(.chat-message-transparent) {
  background-color: var(--chat-primary-color) !important;
  color: white !important;
  border-radius: 16px 16px 4px 16px !important;
  padding: 12px 16px !important;
  margin-bottom: 12px !important;
  margin-left: auto !important;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.5;
  font-size: 14px;
  animation: fadeIn 0.3s ease-in-out;
}

/* Input area */
.chat-input {
  display: flex;
  padding: 14px 16px !important;
  background-color: white !important;
  border-top: 1px solid #eaeaea;
  border-bottom-left-radius: var(--chat-border-radius) !important;
  border-bottom-right-radius: var(--chat-border-radius) !important;
}

.chat-input textarea {
  min-height: 46px !important;
  border-radius: 22px !important;
  padding: 12px 16px !important;
  margin-right: 10px !important;
  background-color: #f5f5f5 !important;
  border: 1px solid #eaeaea !important;
  resize: none;
  font-size: 14px;
  transition: border-color 0.2s;
  box-shadow: none !important;
}

.chat-input textarea:focus {
  border-color: var(--chat-primary-color) !important;
  outline: none;
  background-color: white !important;
}

/* Additional styles for the send button - target both class names */
.chat-input-send-button,
.chat-send-button {
  background-color: var(--chat-primary-color) !important;
  border-radius: 50% !important;
  border: none !important;
  width: 46px !important;
  height: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: transform 0.2s, background-color 0.2s !important;
}

/* Button hover effect */
.chat-input-send-button:hover,
.chat-send-button:hover {
  transform: scale(1.05) !important;
  background-color: #e6e6e6 !important;
}

/* Make both svg types larger */
.chat-input-send-button svg,
.chat-send-button svg {
  width: 30px !important;
  height: 30px !important;
}

/* Change the color of the path */
.chat-input-send-button svg path,
.chat-send-button svg path {
  fill:var(--chat-primary-color) !important;
}

/* Toggle button */
.chat-window-wrapper .chat-window-toggle {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background-color: var(--chat-primary-color) !important;
  box-shadow: var(--chat-shadow) !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.3s !important;
}

.chat-window-wrapper .chat-window-toggle:hover {
  transform: scale(1.05) !important;
}

.chat-window-wrapper .chat-window-toggle svg {
  width: 28px !important;
  height: 28px !important;
  fill: white !important;
}

/* Typing animation */
.chat-message-typing {
  padding: 14px 16px !important;
  background-color: #f0f0f0 !important;
  border-radius: 16px 16px 16px 4px !important;
  width: fit-content;
  margin-bottom: 12px;
}

.chat-message-typing-circle {
  background-color: var(--chat-primary-color) !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  margin: 0 2px !important;
  display: inline-block !important;
  animation: typing-bounce 1.5s infinite ease-in-out both !important;
}

.chat-message-typing-circle:nth-child(1) {
  animation-delay: -0.32s !important;
}

.chat-message-typing-circle:nth-child(2) {
  animation-delay: -0.16s !important;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chat-window-wrapper .chat-window {
    width: 90vw !important;
    max-width: 350px !important;
  }

  .chat-messages {
    height: 280px !important;
  }
}
