rocket-chat-widget {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1001;
}
.rocket-chat-widget {
  min-width: 300px;
  width: 100%;
  max-width: 600px;
  height: 600px;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--rchat-text);
  line-height: 1.5;
  position: relative;
  border: 1px solid var(--rchat-border);
  border-bottom: 0;
  background-color: var(--rchat-bg);
}
.rocket-chat-widget,
.rocket-chat-widget * {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.chat-header {
  background: var(--rchat-theme-color);
  color: var(--rchat-text-w);
  padding: 8px 20px;
  position: relative;
  z-index: 10;
  border-bottom: none;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  flex-shrink: 0;
}
.bot-avatar img{
  width: 100%;
}
.bot-name {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--rchat-text-w);
  line-height: 1.2;
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-circle,
.bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: background 0.2s, border 0.2s;
}
.avatar-circle{
  background-color: var(--rchat-theme-color);
}
.avatar-circle i,
.bot-avatar i {
  font-size: 12px;
  line-height: 1;
  color: var(--rchat-text);
}

.bot-avatar {
  width: 40px;
  height: 40px;
}

.bot-avatar i {
  font-size: 18px;
}

.btn-icon {
  background: var(--rchat-btn-bg);
  border: var(--rchat-btn-border);
  color: var(--rchat-text-w);
  border-radius: 50%;
  padding: 0;
  margin: 0;
  font-size: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.btn-icon:hover {
  background: var(--rchat-btn-bg-hover);
  border-color: var(--rchat-btn-border-hover);
}

.btn-icon:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--rchat-shadow);
}

.btn-icon i {
  font-size: 12px;
  line-height: 1;
  color: var(--rchat-text-w);
}

.btn-icon.btn-lighten {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s, border 0.2s;
}

.btn-icon.btn-lighten:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.28);
} 
/* Messages Container - Sendbird exact styling */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--rchat-bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.messages-container::-webkit-scrollbar {
  width: 4px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.messages-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

.message-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.message-item:last-child {
  margin-bottom: 0;
}

.message-item.message-user {
  align-items: flex-end;
}

.message-item.message-bot {
  align-items: flex-start;
}

.message-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 85%;
  width: fit-content;
}

.message-item.message-user .message-wrapper {
  flex-direction: row-reverse;
  margin-left: auto;
}

.message-item.message-bot .message-wrapper {
  margin-right: auto;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color:var(--rchat-theme-color2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--rchat-text);
  overflow: hidden;
}
.avatar-circle img{
  width: 100%;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.message-bubble {
  border-radius: 16px;
  padding: 12px 16px;
  position: relative;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;
  box-shadow: 0 1px 2px var(--rchat-shadow);
  max-width: 280px;
  width: fit-content;
  background-color: var(--rchat-theme-color2);
}

.bubble-user {
  background-color: var(--rchat-theme-color);
  color: var(--rchat-text);
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.bubble-bot {
  background-color: var(--rchat-theme-color2);
  color: var(--rchat-text2);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--rchat-border);
}

.message-text {
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
  display: block;
  min-height: 20px;
  font-size: 15px;
}

.message-time {
  font-size: 11px;
  color: var(--rchat-text2);
  opacity: 0.8;
  font-weight: 400;
  margin-top: 4px;
  padding: 0 4px;
  line-height: 1.2;
}

.message-item.message-user .message-time {
  text-align: right;
  margin-right: 8px;
}

.message-item.message-bot .message-time {
  text-align: left;
  margin-left: 8px;
}

/* Date Separator - Sendbird style */
.date-separator {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.date-text {
  background: var(--rchat-date-bg);
  color: var(--rchat-text2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  display: flex;
  align-items: center;
}

/* Suggested Questions - Sendbird style */
.suggested-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 8px;
  position: relative;
  z-index: 1;
}

.suggestion-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--rchat-theme-color);
  background: transparent;
  color: var(--rchat-theme-color);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  width: fit-content;
  line-height: 1.2;
  display: flex;
  align-items: center;
  min-height: 32px;
  position: relative;
  z-index: 1;
}

.suggestion-btn:hover {
  background-color: var(--rchat-theme-color);
  color: var(--rchat-text-w);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--rchat-shadow2);
  z-index: 2;
}

/* Typing Indicator - Sendbird style */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--dot-bg);
  animation: typing 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
  animation-delay: -0.32s;
}

.dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Input Area - Sendbird exact style */
.input-container {
  background-color: var(--rchat-bg);
  padding: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--rchat-border);
}

.input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 16px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: transparent;
  box-shadow: none;
  background: none;
}

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  color: var(--rchat-text);
  font-family: inherit;
  height: 28px;
  max-height: 80px;
  padding: 4px 0;
}

.message-input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.message-input::placeholder {
  color: var(--rchat-text2);
  font-size: 14px;
  line-height: 1.4;
}

.send-button {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background-color: var(--rchat-theme-color);
  border: none;
  color: var(--rchat-text-w);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rocket-chat-widget .send-button:hover {
  background-color: var(--rchat-theme-color);
  color: var(--rchat-text-w);
}

.send-button i {
  font-size: 12px;
  color: var(--rchat-text-w);
  line-height: 1;
}

.rocket-chat-widget .send-button:hover i {
  color: var(--rchat-text-w);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background-color: var(--rchat-theme-color2);
}


/* Settings (hidden by default) */
.widget-settings {
  position: absolute;
  top: 60px;
  right: 20px;
  background: var(--rchat-bg);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--rchat-shadow2);
  padding: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--rchat-border);
}

.settings-dropdown select {
  border: 1px solid var(--rchat-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--rchat-bg);
  color: var(--rchat-text2);
}

.settings-dropdown select option{
  background-color: var(--rchat-theme-color2);
}
.dropdown-toggle {
  border-color:var(--rchat-border);
  color: var(--rchat-text);
}

.dropdown-menu {
  background-color:var(--rchat-bg);
  border-color:var(--rchat-border);
  border-radius: 10px;
  list-style: none;
}

.dropdown-item {
  color:var(--rchat-text);
  list-style: none;
}

.dropdown-item:hover {
  background-color:var(--rchat-theme-color2);
}

.dropdown-item.active {
  background-color:var(--rchat-theme-color2);
}

/* Chat bubble HTML formatting fixes */
.message-text ol,
.message-text ul {
  margin: 0.1em 0 0.2em 0.8em;
  padding-left: 0.8em;
}

.message-text li {
  margin-bottom: 0.2em;
  line-height: 1.4;
  word-break: break-word;
}

.message-text p {
  margin: 0 0 0.2em 0;
  line-height: 1.4;
  word-break: break-word;
}

.message-text strong {
  font-weight: 600;
}

.message-bubble,
.message-text {
  max-width: 100%;
}

.message-text,
.message-text p,
.message-text li {
  text-align: left;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.message-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5em 0 0.3em 0;
}
.message-text h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5em 0 0.3em 0;
}
.message-text h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5em 0 0.3em 0;
}
.message-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.5em 0 0.3em 0;
}
.message-text h5 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5em 0 0.3em 0;
}
.message-text h6 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.5em 0 0.3em 0;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .message-bubble {
    max-width: 85%;
  }

  .dropdown-toggle {
    font-size: 11px;
    padding: 4px 8px;
  }

  .chat-header {
    padding: 10px 16px;
  }

  .bot-avatar {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 400px) {
  .chat-header, .input-container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .messages-container {
    padding-left: 16px;
    padding-right: 16px;
  }
}
