/***

==================================================================
	AI Chat Agent Widget
==================================================================

***/
.ai-chat-widget {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 9999;
  font-family: var(--text-font);
}
.ai-chat-toggle {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background-color: var(--theme-color1);
  color: var(--theme-color-light);
  font-size: 24px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  cursor: pointer;
  -webkit-box-shadow: 0 10px 30px rgba(1, 20, 37, 0.35);
          box-shadow: 0 10px 30px rgba(1, 20, 37, 0.35);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.ai-chat-toggle:hover {
  background-color: var(--theme-color2);
}
.ai-chat-toggle .ai-chat-icon-close {
  display: none;
}
.ai-chat-widget.is-open .ai-chat-toggle .ai-chat-icon-open {
  display: none;
}
.ai-chat-widget.is-open .ai-chat-toggle .ai-chat-icon-close {
  display: inline-block;
}

.ai-chat-teaser {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 270px;
  background-color: var(--theme-color-light);
  border-radius: 14px;
  padding: 18px 30px 18px 18px;
  -webkit-box-shadow: 0 15px 40px rgba(1, 20, 37, 0.18);
          box-shadow: 0 15px 40px rgba(1, 20, 37, 0.18);
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateY(10px);
      -ms-transform: translateY(10px);
          transform: translateY(10px);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  cursor: pointer;
}
.ai-chat-teaser.is-visible {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0);
      -ms-transform: translateY(0);
          transform: translateY(0);
}
.ai-chat-widget.is-open .ai-chat-teaser {
  display: none;
}
.ai-chat-teaser p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--headings-color);
}
.ai-chat-teaser-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: #a9a9a9;
  cursor: pointer;
  padding: 4px;
}
.ai-chat-teaser-close:hover {
  color: var(--theme-color1);
}

.ai-chat-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 150px);
  background-color: var(--theme-color-light);
  border-radius: 16px;
  -webkit-box-shadow: 0 20px 60px rgba(1, 20, 37, 0.28);
          box-shadow: 0 20px 60px rgba(1, 20, 37, 0.28);
  overflow: hidden;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateY(16px) scale(0.98);
      -ms-transform: translateY(16px) scale(0.98);
          transform: translateY(16px) scale(0.98);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.ai-chat-widget.is-open .ai-chat-panel {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0) scale(1);
      -ms-transform: translateY(0) scale(1);
          transform: translateY(0) scale(1);
}

.ai-chat-header {
  background-color: var(--theme-color1);
  background-image: -webkit-gradient(linear, left top, right top, from(var(--theme-color1)), to(var(--theme-color2)));
  background-image: linear-gradient(90deg, var(--theme-color1), var(--theme-color2));
  color: var(--theme-color-light);
  padding: 18px 20px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
}
.ai-chat-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.ai-chat-subtitle {
  display: block;
  font-size: 12px;
  opacity: 0.8;
}
.ai-chat-close {
  border: none;
  background: none;
  color: var(--theme-color-light);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  opacity: 0.85;
}
.ai-chat-close:hover {
  opacity: 1;
}

.ai-chat-messages {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
          flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px;
  background-color: var(--theme-color-gray);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 12px;
}
.ai-chat-message {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  max-width: 85%;
}
.ai-chat-message-user {
  -ms-flex-item-align: end;
      align-self: flex-end;
}
.ai-chat-message-assistant {
  -ms-flex-item-align: start;
      align-self: flex-start;
}
.ai-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 21px;
  word-wrap: break-word;
}
.ai-chat-message-user .ai-chat-bubble {
  background-color: var(--theme-color1);
  color: var(--theme-color-light);
  border-bottom-right-radius: 4px;
}
.ai-chat-message-assistant .ai-chat-bubble {
  background-color: var(--theme-color-light);
  color: var(--text-color);
  border: 1px solid #e6e6e6;
  border-bottom-left-radius: 4px;
}
.ai-chat-typing .ai-chat-bubble {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 4px;
  padding: 14px;
}
.ai-chat-typing .ai-chat-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #b9b9b9;
  display: inline-block;
  -webkit-animation: aiChatTypingBlink 1.2s infinite ease-in-out;
          animation: aiChatTypingBlink 1.2s infinite ease-in-out;
}
.ai-chat-typing .ai-chat-bubble span:nth-child(2) {
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s;
}
.ai-chat-typing .ai-chat-bubble span:nth-child(3) {
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s;
}
@-webkit-keyframes aiChatTypingBlink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}
@keyframes aiChatTypingBlink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.ai-chat-disclaimer {
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
  padding: 8px 16px;
  font-size: 10.5px;
  line-height: 15px;
  color: #9a9a9a;
  background-color: var(--theme-color-light);
  border-top: 1px solid #f0f0f0;
}

.ai-chat-input-area {
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #eeeeee;
  background-color: var(--theme-color-light);
}
.ai-chat-input-area input {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
          flex: 1 1 auto;
  border: 1px solid #e2e2e2;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  color: var(--headings-color);
}
.ai-chat-input-area input:focus {
  border-color: var(--theme-color1);
}
.ai-chat-input-area button {
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background-color: var(--theme-color1);
  color: var(--theme-color-light);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  cursor: pointer;
  font-size: 15px;
}
.ai-chat-input-area button:hover {
  background-color: var(--theme-color2);
}

@media (max-width: 480px) {
  .ai-chat-widget {
    right: 16px;
    bottom: 16px;
  }
  .ai-chat-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    right: -8px;
  }
  .ai-chat-teaser {
    width: calc(100vw - 40px);
    right: -8px;
  }
}
