/* WLT AI Chat Widget — Floating bubble + modal */

.wlt-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #004B45;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 24px;
  line-height: 1;
}
.wlt-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.wlt-chat-fab.open {
  display: none;
}

/* Modal overlay */
.wlt-chat-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  width: 400px;
  height: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.wlt-chat-modal.open {
  display: flex;
}

/* Header */
.wlt-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #004B45;
  color: #fff;
  flex-shrink: 0;
}
.wlt-chat-header-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wlt-chat-header-title span {
  font-size: 18px;
}
.wlt-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}
.wlt-chat-close:hover {
  opacity: 1;
}

/* Messages area */
.wlt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafb;
}

/* Welcome message */
.wlt-chat-welcome {
  text-align: center;
  padding: 24px 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}
.wlt-chat-welcome strong {
  display: block;
  color: #004B45;
  font-size: 16px;
  margin-bottom: 8px;
}

/* Message bubbles */
.wlt-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.wlt-chat-msg.user {
  align-self: flex-end;
  background: #004B45;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.wlt-chat-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.wlt-chat-msg.assistant a {
  color: #004B45;
  font-weight: 500;
  text-decoration: underline;
}

/* Thinking indicator */
.wlt-chat-thinking {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}
.wlt-chat-thinking .dots {
  display: inline-flex;
  gap: 3px;
}
.wlt-chat-thinking .dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: wlt-dot-bounce 1.2s infinite;
}
.wlt-chat-thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.wlt-chat-thinking .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wlt-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Input area */
.wlt-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}
.wlt-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  max-height: 80px;
}
.wlt-chat-input:focus {
  border-color: #004B45;
}
.wlt-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #004B45;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.wlt-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Mobile full-screen */
@media (max-width: 480px) {
  .wlt-chat-modal {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .wlt-chat-fab {
    bottom: 16px;
    right: 16px;
  }
}
