.chat-wrapper {
  --primary-color: #6366f1;
  --secondary-color: #4f46e5;
  --background: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
 
 .chat-wrapper .chat-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  border: none;
  background: transparent;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
   padding:0px;
}
 
.chat-wrapper  .chat-toggle:hover {
  background:transparent;
  transform: scale(1.1);
}
 
.chat-wrapper .chat-toggle.hidden {
  display: none;
}
 
.chat-wrapper  .chat-container {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 360px;
  height: 70vh;
  max-height: 700px;
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  z-index: 9999;
}
 
.chat-wrapper  .chat-container.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
 
 
.chat-wrapper  .chat-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--primary-color);
  border-radius: 1rem 1rem 0 0;
  color: white;
 
}
 
.chat-wrapper  .chat-header h3{
  color:white !important;
}
 
.chat-wrapper  .ai-avatar {
  background: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}
 
.chat-wrapper  .ai-icon {
  color: var(--primary-color);
  font-size: 1.25rem;
}
 
.chat-wrapper  .close-button {
  background: none;
  border: none;
  color: white;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0.8;
}
 
.chat-wrapper  .close-button:hover {
  opacity: 1;
}
.chat-wrapper  .maximize-button {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0.8;
}
 
.chat-wrapper  .maximize-button:hover {
  opacity: 1;
}
 
.chat-wrapper .chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: var(--background);
}
 
.chat-wrapper .message-bubble {
max-width: 80%;
  margin: 0.5rem 0;
  animation: fadeIn 0.3s ease;
  word-break: break-word;
}
 
.chat-wrapper .message-bubble.user {
  margin-left: auto;
}
 
.chat-wrapper  .message-content {
font-size: 18px;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: var(--primary-color);
  color: white;
  overflow-wrap: break-word; /* Modern replacement for word-wrap */
  white-space: pre-wrap; /* Preserve spaces and wrap text naturally */
  word-break: break-word; /* Break long words to prevent overflow */
}
 
.message-bubble.bot .message-content {
background: white;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  overflow-wrap: break-word; /* Ensure wrapping for bot messages */
  white-space: pre-wrap; /* Preserve spaces and wrap text */
  word-break: break-word; /* Break long words */
}
 
.typing-indicator {
  display: flex;
  padding: 1rem;
  justify-content: center;
}
 
.chat-wrapper  .dot {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}
 
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
 
.chat-wrapper  .message-form {
  display: flex;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  gap: 0.5rem;
}
 
.chat-wrapper  .message-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 14px;
  transition: border-color 0.2s ease;
}
 
.message-form input:focus {
  outline: none;
}
 
 .chat-wrapper .send-button {
  background: var(--primary-color);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
   padding:0px
}
 
.send-button:hover {
  background: var(--secondary-color);
}
 
.send-button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}
 
.hello-help-text{
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  background: #fff;
  font-size: 16px;
  padding: 5px 20px;
  cursor: pointer; /* Show clickable hand cursor */
  transition: opacity 0.3s ease, transform 0.3s ease;
}
 
.chatbot-footer-text{
  font-size: 11px;
    text-align: center;
    padding: 0px 12px 10px;
    color: gray;
}
 
 
/* Chatboat css */
header.chat-header h3 {
    margin: 0px;
	padding:0px;
}
.message-bubble.bot .message-content {
    width: fit-content;
}
.message-bubble.user .message-content {
    width: fit-content;
}
.message-bubble.user {
    display: flex;
    justify-content: end;
}
.message-content a {
    color: #1868db;
}
.chat-container.open.maximized {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0px !important;
    min-height:100%;
}
.chat-container.open.maximized header.chat-header {
    border-radius: 0px!important;
}
.chat-container.open.maximized button.chat-toggle{
  display:none;
}
.chat-container .pipedriveWebForms{
  overflow: visible;
}
.chat-container .pipedriveform{
  overflow: scroll;
  padding: 20px;
  overflow-x: hidden;
}
.chat-container div.pipedriveWebForms{
	display:block;
}
 
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
 
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
 
/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .chat-container {
    width: 90%;
    height: 55vh;
    bottom: 5rem;
  }
 
  .chat-header {
    padding: 0.75rem;
  }
 
  .ai-avatar {
    width: 30px;
    height: 30px;
  }
 
  .ai-icon {
    font-size: 1.1rem;
  }
 
  .message-content {
    font-size: 16px;
    padding: 0.5rem 0.75rem;
  }
 
  .message-form input {
    font-size: 12px;
    padding: 0.5rem 0.75rem;
  }
 
  .send-button {
    width: 35px;
    height: 35px;
  }
 
  .send-button:hover {
    background: var(--primary-color);
  }
.chat-container.open {
    width: 100%;
    right: 0;
    height: 100%;
    bottom: 0;
    min-height:100%;
}
header.chat-header {
    border-radius: 0px!important;
}
.chat-wrapper  .chat-header {
    justify-content: space-between;
}
button.maximize-button {
    display: none;
}
}
 
@media (max-width: 480px) {
  .chat-toggle {
    width: 50px;
    height: 50px;
  }
 
  .chat-container {
    bottom: 6rem;
    width: 70%;
    height: 45vh;
  }
 
  .message-form input {
    font-size: 14px;
    padding: 0.5rem;
  }
 
  .send-button {
    width: 38px;
    height: 38px;
  }
 
  .ai-avatar {
    width: 28px;
    height: 28px;
  }
.chat-container.open {
    width: 100%;
    right: 0;
    height: 100%;
    bottom: 0;
    min-height:100%;
}
header.chat-header {
    border-radius: 0px!important;
}
.chat-wrapper  .chat-header {
    justify-content: space-between;
}
button.maximize-button {
    display: none;
}
}
 
/* IPad media query start here */
@media (min-width: 768px) and (max-width: 1024px) {
  .chat-container.open {
    width: 75%;
}
.chat-container.open.maximized {
    width: 100%;
    top: 0;
    right: 0;
    min-height: 100%;
}
}