/* ============================================================
   LHS Web Chatbot — UI
   ============================================================ */

:root {
  --lhs-green:      #2d7a4f;
  --lhs-green-dark: #1e5c3a;
  --lhs-green-light:#e8f5ee;
  --lhs-accent:     #f0a500;
  --lhs-white:      #ffffff;
  --lhs-gray-1:     #f7f8f6;
  --lhs-gray-2:     #e8ebe6;
  --lhs-gray-3:     #9ba89a;
  --lhs-text:       #1a2318;
  --lhs-shadow:     0 8px 40px rgba(0,0,0,0.18);
  --lhs-radius:     16px;
  --lhs-font:       'Outfit', 'Segoe UI', sans-serif;
}

/* ── Bubble ─────────────────────────────────────────────── */
#lhs-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--lhs-green);
  box-shadow: 0 4px 20px rgba(45,122,79,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
#lhs-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(45,122,79,0.55);
}
#lhs-chat-bubble:active { transform: scale(0.96); }

.lhs-bubble-icon {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s;
}

.lhs-bubble-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--lhs-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--lhs-font);
}

/* ── Widget container ────────────────────────────────────── */
#lhs-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9999;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--lhs-white);
  border-radius: var(--lhs-radius);
  box-shadow: var(--lhs-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--lhs-font);
  animation: lhsChatIn 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes lhsChatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ─────────────────────────────────────────────── */
.lhs-chat-header {
  background: linear-gradient(135deg, var(--lhs-green-dark) 0%, var(--lhs-green) 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.lhs-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lhs-chat-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lhs-chat-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lhs-chat-status {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.lhs-status-dot {
  width: 7px;
  height: 7px;
  background: #7df5a2;
  border-radius: 50%;
  display: inline-block;
  animation: lhsPulse 2s infinite;
}
@keyframes lhsPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.lhs-chat-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lhs-chat-close:hover { background: rgba(255,255,255,0.28); }

/* ── Messages area ───────────────────────────────────────── */
.lhs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--lhs-gray-1);
  scroll-behavior: smooth;
}
.lhs-chat-messages::-webkit-scrollbar { width: 4px; }
.lhs-chat-messages::-webkit-scrollbar-track { background: transparent; }
.lhs-chat-messages::-webkit-scrollbar-thumb { background: var(--lhs-gray-2); border-radius: 2px; }

/* ── Messages ────────────────────────────────────────────── */
.lhs-msg {
  display: flex;
  animation: lhsMsgIn 0.2s ease both;
}
@keyframes lhsMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lhs-msg-bot  { justify-content: flex-start; }
.lhs-msg-user { justify-content: flex-end; }

.lhs-msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.lhs-msg-bot .lhs-msg-bubble {
  background: var(--lhs-white);
  color: var(--lhs-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.lhs-msg-user .lhs-msg-bubble {
  background: var(--lhs-green);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ── Typing indicator ────────────────────────────────────── */
.lhs-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--lhs-white);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.lhs-typing span {
  width: 7px;
  height: 7px;
  background: var(--lhs-gray-3);
  border-radius: 50%;
  animation: lhsTyping 1.2s infinite ease-in-out;
}
.lhs-typing span:nth-child(2) { animation-delay: 0.2s; }
.lhs-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lhsTyping {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* ── Input row ───────────────────────────────────────────── */
.lhs-chat-input-row {
  padding: 10px 12px;
  background: var(--lhs-white);
  border-top: 1px solid var(--lhs-gray-2);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#lhs-chat-input {
  flex: 1;
  border: 1.5px solid var(--lhs-gray-2);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--lhs-font);
  color: var(--lhs-text);
  background: var(--lhs-gray-1);
  outline: none;
  transition: border-color 0.15s;
}
#lhs-chat-input:focus {
  border-color: var(--lhs-green);
  background: var(--lhs-white);
}
#lhs-chat-input::placeholder { color: var(--lhs-gray-3); }

#lhs-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--lhs-green);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
#lhs-chat-send:hover  { background: var(--lhs-green-dark); }
#lhs-chat-send:active { transform: scale(0.93); }
#lhs-chat-send:disabled { background: var(--lhs-gray-2); cursor: not-allowed; }

/* ── Quick suggestions ───────────────────────────────────── */
.lhs-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 4px 0;
}
.lhs-suggestion-btn {
  background: var(--lhs-white);
  border: 1.5px solid var(--lhs-green);
  color: var(--lhs-green);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-family: var(--lhs-font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.lhs-suggestion-btn:hover {
  background: var(--lhs-green);
  color: #fff;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  #lhs-chat-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    border-radius: var(--lhs-radius) var(--lhs-radius) 0 0;
  }
  #lhs-chat-bubble {
    bottom: 16px;
    right: 16px;
  }
}
