#modern-ai-chat-widget {
  background: #fff;
  width: 360px;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
#chat-header {
  background: linear-gradient(135deg, #4f8ef7, #3b6dd4);
  color: white;
  padding: 20px;
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  user-select: none;
  letter-spacing: 0.03em;
}
#messages {
  flex-grow: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #e9f0fb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.message {
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.4;
  font-size: 0.95rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  word-wrap: break-word;
  user-select: text;
  animation: fadeIn 0.3s ease forwards;
}
.user {
  align-self: flex-end;
  background: #4f8ef7;
  color: white;
  border-bottom-right-radius: 4px;
}
.bot {
  align-self: flex-start;
  background: white;
  color: #222;
  border-bottom-left-radius: 4px;
}
#chat-form {
  display: flex;
  padding: 12px 20px;
  border-top: 1px solid #ddd;
  background: white;
}
#chat-input {
  flex: 1;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 30px;
  padding: 12px 20px;
  transition: border-color 0.3s;
  outline: none;
}
#chat-input:focus {
  border-color: #4f8ef7;
  box-shadow: 0 0 6px rgba(79, 142, 247, 0.5);
}
#chat-submit {
  background: #4f8ef7;
  border: none;
  color: white;
  padding: 0 24px;
  margin-left: 12px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1rem;
}
#chat-submit:hover {
  background: #3b6dd4;
}
#chat-submit:disabled {
  background: #9bbcf9;
  cursor: not-allowed;
}
@keyframes fadeIn {
  from {opacity: 0; transform: translateY(10px);}
  to {opacity: 1; transform: translateY(0);}
}
@media (max-width: 400px) {
  #modern-ai-chat-widget {
    width: 100%;
    border-radius: 0;
    height: 100vh;
  }
  #chat-header {
    font-size: 1rem;
    padding: 14px;
  }
  #chat-form {
    padding: 10px 14px;
  }
  #chat-input {
    padding: 10px 14px;
  }
  #chat-submit {
    padding: 0 18px;
    font-size: 0.9rem;
  }
}


#modern-ai-chat-widget {
  position: fixed !important;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 360px;
  max-width: 100%;
  box-sizing: border-box;
}

#messages {
  flex-grow: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #e9f0fb;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;

  /* Set fixed height for chat area */
  max-height: 400px;
  height: 400px;
}
