:root {
  --chatbot-primary: #004a99;
  --chatbot-darker: #414141;
  --chatbot-dark: #707175;
  --chatbot-grey: #E0E0E0;
  --chatbot-bg: rgba(255, 255, 255, 1);
  --chatbot-text: #fff;
  --chatbot-assistant-bg: #f0f4f8;
  --chatbot-user-bg: #004a99;
  --chatbot-user-text: #fff;
  --chatbot-border: #E0E0E0;
  --chatbot-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
}

.ai-assistant-chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

/* Chat launcher button */
.ai-assistant-chatbot-launcher {
  background: var(--chatbot-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--chatbot-shadow);
  transition: transform 0.2s, background 0.2s;
}

.ai-assistant-chatbot-launcher:hover {
  transform: translateY(-2px);
  background: #003d7a;
}

/* Chat dialog */
.ai-assistant-chatbot-dialog {
  margin: auto 20px 0 auto;
  padding: 0;
  border: none;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--chatbot-shadow);
  width: 556px;
  max-width: 90vw;
  height: 664px;
  max-height: 664px;
  overflow: hidden;
  background: var(--chatbot-bg);
  backdrop-filter: blur(10px);
}

.ai-assistant-chatbot-dialog::backdrop {
  background: rgba(0, 0, 0, 0.05);
}

.ai-assistant-chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ai-assistant-chatbot-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--chatbot-border);
  background: #78b6dd;
}

.ai-assistant-chatbot-header > h2 {
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.ai-assistant-chatbot-title {
  margin: 0 16px 0 0;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
}

.ai-assistant-chatbot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-assistant-chatbot-actions button {
  border: none;
  background: none;
  color: var(--chatbot-dark);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s;
  margin: 0;
  padding: 0;
}

.ai-assistant-chatbot-actions button svg {
  width: 22px;
  height: 22px;
  display: block;
  color: white;
}

/* Chat inner - messages */
.ai-assistant-chatbot-messages {
  flex: 1;
  padding: 20px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgb(243, 246, 252);
}

.ai-assistant-chatbot-messages * {
  font-size: 14px;
}

.ai-assistant-chatbot-intro {
  gap: 8px;
  margin-top: 8px;
}

.ai-assistant-chatbot-intro-text {
  color: var(--chatbot-darker);
  margin-bottom: 8px;

  & h3 {
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 10px;
  }

  & h4 {
    font-size: 28px;
    font-weight: 500;
    margin: 0 0 20px;
  }
}

.ai-assistant-chatbot-suggestion-btn {
  background: rgb(219, 242, 209);
  border: none;
  color: var(--chatbot-darker);
  padding: 10px 16px;
  border-radius: 80px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: block;

  &+.ai-assistant-chatbot-suggestion-btn {
    margin-top: 12px;
  }
}

.ai-assistant-chatbot-suggestion-btn:hover {
  background: var(--chatbot-primary);
  color: #fff;
}

/* Message styles */

.ai-assistant-chatbot-message {
  max-width: 85%;
  padding: 14px 15px;
  border-radius: 12px;
}

.ai-assistant-chatbot-message .ai-assistant-chatbot-message-content p:first-child {
  margin-top: 0;
}

.ai-assistant-chatbot-message .ai-assistant-chatbot-message-content p:last-child {
  margin-bottom: 0;
}

.ai-assistant-chatbot-message.assistant {
  align-self: flex-start;
  background: var(--chatbot-bg);
  color: var(--chatbot-dark);
  border-bottom-left-radius: 2px;
}

.ai-assistant-chatbot-message.user {
  align-self: flex-end;
  background: var(--chatbot-grey);
  color: var(--chatbot-darker);
  border-bottom-right-radius: 2px;
}

/* FOOTER STYLES */

.ai-assistant-chatbot-footer {
  padding: 0 26px 10px;
  background: rgb(243, 246, 252);
}

.ai-assistant-chatbot-footer .ai-assistant-chatbot-actions {
  padding-top: 10px;
  display: flex;
  justify-content: right;
}

.ai-assistant-chatbot-footer .ai-assistant-chatbot-actions > * {
  font-size: 14px;
}

.ai-assistant-chatbot-input-wrapper {
  display: flex;
  background: #fff;
  border: 1px solid var(--chatbot-dark);
  border-radius: 30px;
  padding: 5px 12px;
  align-items: flex-end;
  line-height: 1.3em;
}

.ai-assistant-chatbot-input {
  flex: 1;
  border: none;
  resize: none;
  font-family: inherit;
  font-size: 1.5rem;
  max-height: 120px;
}

.ai-assistant-chatbot-input:focus {
  outline: none;
}

.ai-assistant-chatbot-footer textarea::placeholder {
  color: #aaa;
}

.ai-assistant-chatbot-send {
  background: none;
  border: none;
  color: var(--chatbot-primary);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  padding: 0;
  margin-right: -5px;
}

.ai-assistant-chatbot-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ai-assistant-chatbot-send svg {
  width: 18px;
  height: 18px;

}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--chatbot-dark);
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }
}

/* Large / fullscreen (≥ 1440px) */
@media (min-width: 1440px) {
  .ai-assistant-chatbot-dialog {
    width: 620px;
    height: 760px;
    max-height: 760px;
    margin: auto 48px 0 auto;
  }
}

/* Tablet (601px – 1024px) */
@media (max-width: 1024px) {
  .ai-assistant-chatbot-dialog {
    width: 460px;
    height: 580px;
    max-height: 80vh;
    margin: auto 16px 0 auto;
  }
}

/* Phone (≤ 600px) — full-screen dialog */
@media (max-width: 600px) {
  .ai-assistant-chatbot {
    bottom: 12px;
    right: 12px;
  }

  .ai-assistant-chatbot-dialog {
    position: fixed;
    inset: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

}
