:root {
  --primary-color: #198A42;
  --primary-gradient: linear-gradient(135deg, #198A42 0%, #146d34 100%);
  --bubble-bg: #198A42;
  --bubble-color: #ffffff;
  --chat-bg: rgba(255, 255, 255, 0.95);
  --msg-user-bg: #198A42;
  --msg-user-color: #ffffff;
  --msg-bot-bg: #f1f3f9;
  --msg-bot-color: #333333;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#chat-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: var(--font-family);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Bubble */
#chat-widget-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-gradient);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

#chat-widget-bubble:hover {
  transform: scale(1.1);
}

#chat-widget-bubble svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* Chat Window */
#chat-widget-window {
  width: 380px;
  height: 600px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 100px);
  background: var(--chat-bg);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  display: none;
  /* Controlled by JS */
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
#chat-widget-header {
  padding: 20px;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#chat-widget-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

#chat-widget-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}

#chat-widget-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* Messages Area */
#chat-widget-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scrollbar-width: thin;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-msg strong {
  font-weight: 700;
  color: var(--primary-color);
}

/* List Styling inside messages */
.chat-msg ul {
  margin: 10px 0 10px 20px;
  padding: 0;
}

.chat-msg li {
  margin-bottom: 5px;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--msg-bot-bg);
  color: var(--msg-bot-color);
  border-bottom-left-radius: 4px;
}

.chat-msg.user,
.chat-msg.user * {
  align-self: flex-end;
  background: var(--msg-user-bg) !important;
  color: #ffffff !important;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.typing-indicator {
  padding: 12px 16px;
  background: var(--msg-bot-bg);
  border-radius: 18px;
  display: flex;
  gap: 4px;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #aaa;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-6px);
  }
}

/* Button Replies (Quick Replies) */
#chat-widget-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 15px 20px;
}

.quick-reply-btn {
  background: white;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.quick-reply-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Input Area */
#chat-widget-input-container {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
}

#chat-widget-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  padding: 10px 0;
  background: transparent;
}

#chat-widget-send {
  background: var(--primary-gradient);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

#chat-widget-send:hover {
  transform: scale(1.05);
}

#chat-widget-send svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  #chat-widget-window {
    width: calc(100vw - 30px);
    height: calc(100vh - 120px);
    bottom: 80px;
  }
}