#tm-chatbot-container {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    box-shadow: 0 0 10px rgb(0 0 0 / 10%);
    z-index: 9999 !important; /* Ensures chatbot is on top */
}

#tm-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 10px 10px;
    background-color: var(--chatbot-bg-color);
    color: var(--chatbot-text-color);
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#tm-chatbot-messages {
    max-height: 300px;
    height: 300px;
    overflow-y: auto;
    display: block;
    padding: 10px;
}


/* General message styling */
.chatbot-message {
    max-width: 75%;
    min-width: 75%;
    padding: 10px;
    border-radius: 8px;
    margin: 5px;
    display: inline-block;
    font-size: 14px;
}

/* Style for user messages (aligned left but indented) */
.chatbot-message.user {
    background:  var(--chatbot-bg-color);
    color:  var(--chatbot-text-color);
    width: 80%; /* Limit width to 80% */
    padding: 10px;
    border-radius: 10px;
    margin: 5px 10px;
    align-self: flex-end;
    text-align: left; /* Ensure text stays aligned left */
}

/* Style for AI messages (aligned left) */
.chatbot-message.ai {
    background: #f1f1f1;
    max-width: 80%;
    padding: 10px;
    border-radius: 10px;
    margin: 5px 10px 5px 30px;
    align-self: flex-start;
    text-align: left;
}

/* Style for error messages */
.chatbot-message.error {
    color: red;
}

/* Chatbox Input Container */
#tm-chatbot-input-container {
    display: flex;
    max-width: 350px;
    padding: 5px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}

/* Chat Input Field */
#tm-chatbot-input {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px; /* Rounded on left */
    outline: none;
}

#tm-chatbot-loader {
    text-align: center;
    font-size: 14px;
    color: #0073aa;
    padding: 5px;
    display: none;
}

.hidden {
    display: none;
}

/* Floating assistant avatar */
#tm-chatbot-avatar-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 1001;
}

#tm-chatbot-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgb(0 0 0 / 30%);
}

#tm-chatbot-writing {
    width: 70px;
    height: 70px;
}

#tm-chatbot-name {
    display: inline-block;
    max-width: 30px;
    height: 60px;
    line-height: 1.2;
    vertical-align: top;
}

/* Chatbox header avatar */
#tm-chatbot-header-avatar {
    width: 50px;
    height: 40px;
    border-radius: 50%;
    margin-right: 2px;
}

/* Ensure the title and avatar are aligned */
#tm-chatbot-header span {
    flex-grow: 1;
    text-align: left;
}

/* Full-screen chatbox style */
#tm-chatbot-container.fullscreen {
    width: 100vw;
    height: 95vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
}

#tm-chatbot-fullscreen, #tm-chatbot-close, #tm-chatbot-new-conversation {
    background: none;
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
}

#tm-chatbot-new-conversation {
    font-size: 25px;
}

#tm-chatbot-close {
    font-size: 18px;
}

#tm-chatbot-fullscreen:hover, #tm-chatbot-close:hover, #tm-chatbot-new-conversation:hover {
    opacity: 0.8;
}


:root {
    --chatbot-bg-color: #aa3b62; /* Default */
    --chatbot-bg-hover-color: #0073aa; /* Default */
    --chatbot-text-color: #fff; /* Default */
}

/* Default styles for send button and default question button */
#tm-chatbot-send, .tm-chatbot-default-button {
    background-color: var(--chatbot-bg-color);
    color: var(--chatbot-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    padding: 8px 15px;
    border:none;
}

/* Ensure text color remains unchanged while changing the background */
#tm-chatbot-send:hover, .tm-chatbot-default-button:hover {
    background-color: var(--chatbot-bg-hover-color);
    color: var(--chatbot-text-color); /* Keep text color consistent */
}

.chatbot-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.chatbot-link:hover {
    text-decoration: underline;
}

.tm-chatbot-header-left {
    width: 20%;
}

.tm-chatbot-header-center {
    width: 50%;
    text-align: left;
    font-weight: bold;
    font-size: 16px;
}

.tm-chatbot-header-right {
    width: 30%;
    display: flex;
    gap: 6px;
}

.tm-chatbot-header-button {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    transition: background-color 0.3s;
}

.tm-chatbot-header-button:hover {
    background-color: rgb(0 0 0 / 10%);
}
/* === Teaser: anchor to viewport, widen, and align above avatar === */
.tmcb-teaser {
  /* detach from the small avatar container */
  position: fixed;
  /* align to the same corner as the avatar (fallbacks keep your current 20px offsets) */
  right: var(--tmcb-avatar-right, 20px);
  bottom: calc(var(--tmcb-avatar-bottom, 20px) + var(--tmcb-avatar-size, 56px) + 8px);
  display: flex;                 /* NEW */
  justify-content: flex-end;     /* NEW: push child to the right */
  min-width: 300px;                 /* tweak as you like */
  max-width: min(300px, 60vw);      /* responsive cap */
  z-index: 9999;
}

/* Make sure hidden stays hidden, even if .tmcb-teaser sets display:flex */
.tmcb-teaser[hidden],
.tmcb-teaser[aria-hidden="true"] {
  display: none !important;
}


.tmcb-teaser-btn {
  position: relative;
  display: block;                   /* fill the bubble width */
  width: auto;               /* grow to content up to max-width */
  max-width: 100%;
  border: solid 1px black;
  border-radius: 16px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;                  /* your preference */
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  background: #fff;
  color: #111;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

.tmcb-teaser-btn::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -8px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}

/* small screens */
@media (max-width: 480px) {
  .tmcb-teaser {
    right: 8px;
    bottom: calc(8px + var(--tmcb-avatar-size, 56px) + 6px);
    min-width: 0;
    max-width: calc(100vw - 32px);
  }
}

