#ai-chat-widget-wrapper {
  position: fixed;
  bottom: 0;
  right: 0; /* Changed from left: 0 */
  width: 360px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2); /* Shadow on left side now */
  padding: 20px 15px 70px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  transition: transform 0.3s ease;
}

#ai-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#ai-chat-log {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 10px;
  max-height: unset;
}

#ai-chat-input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

#ai-chat-send {
  margin-top: 8px;
  padding: 8px 12px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#ai-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px; /* Changed from left: 20px */
  background: #0073aa;
  color: white;
  padding: 10px 16px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-weight: bold;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

#ai-chat-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #d54e21;
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
body.chat-open {
  margin-right: 360px; /* Changed from margin-left */
  transition: margin-right 0.3s ease; /* Changed from margin-left */
}

.user-msg, .ai-msg, .ai-error {
  margin: 6px 0;
  line-height: 1.4;
}

.user-msg strong {
  color: #0073aa;
}
.ai-msg strong {
  color: #d54e21;
}
.ai-error {
  color: red;
}

.ai-waiting {
  display: flex;
  align-items: center;
  font-style: italic;
  color: #555;
  margin: 6px 0;
}

.ai-waiting .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.ai-msg, .user-msg, .ai-error, .ai-waiting {
  animation: fadeIn 0.25s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
