/* Luật AI Chat — chat.css */

/* ── Bubble ─────────────────────────────────────────── */
#lac-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #185FA5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 4px 16px rgba(24,95,165,.35);
  transition: transform .15s, background .15s;
}
#lac-bubble:hover { background: #0C447C; transform: scale(1.07); }
#lac-bubble:active { transform: scale(0.95); }

/* ── Window ─────────────────────────────────────────── */
#lac-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 99997;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#lac-chat-window[hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────── */
#lac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #185FA5;
  color: #fff;
  flex-shrink: 0;
}
#lac-header-info { display: flex; align-items: center; gap: 10px; }
#lac-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
#lac-title  { font-size: 14px; font-weight: 600; }
#lac-subtitle { font-size: 12px; opacity: .8; margin-top: 1px; }
#lac-close {
  background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; padding: 4px;
  opacity: .75; transition: opacity .15s;
}
#lac-close:hover { opacity: 1; }

/* ── Messages ───────────────────────────────────────── */
#lac-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.lac-msg {
  display: flex; align-items: flex-end; gap: 7px;
  animation: lac-fadein .2s ease;
}
@keyframes lac-fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.lac-msg.user { flex-direction: row-reverse; }
.lac-bot-av {
  width: 28px; height: 28px;
  border-radius: 50%; background: #E6F1FB;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.lac-bubble-inner {
  max-width: 78%; padding: 9px 13px;
  border-radius: 14px; font-size: 14px; line-height: 1.55;
}
.lac-msg.bot  .lac-bubble-inner { background: #f1f3f5; color: #111; border-bottom-left-radius: 4px; }
.lac-msg.user .lac-bubble-inner { background: #185FA5; color: #fff; border-bottom-right-radius: 4px; }
.lac-msg.staff .lac-bubble-inner { background: #e8f8f0; color: #0a4d2e; border-bottom-left-radius: 4px; }

/* ── CTA card ───────────────────────────────────────── */
.lac-cta-card {
  background: #EAF3DE; border-radius: 10px;
  padding: 11px 13px; margin-top: 6px;
  font-size: 13px; color: #27500A; line-height: 1.5;
}
.lac-cta-card button {
  margin-top: 8px; padding: 7px 14px;
  background: #3B6D11; color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; cursor: pointer; font-weight: 500;
}

/* ── Topic picker ───────────────────────────────────── */
#lac-topic-picker {
  padding: 14px; flex-shrink: 0;
}
#lac-topic-picker p {
  font-size: 13px; color: #555; margin-bottom: 10px;
}
#lac-topics { display: flex; flex-wrap: wrap; gap: 7px; }
.lac-topic-btn {
  padding: 7px 13px; border-radius: 20px;
  border: 1px solid #c5d9ee; background: #f0f7ff;
  color: #185FA5; font-size: 13px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.lac-topic-btn:hover { background: #ddeeff; border-color: #185FA5; }

/* ── Mode banner ────────────────────────────────────── */
#lac-mode-banner {
  padding: 7px 14px; font-size: 12px; text-align: center;
  background: #fff8e1; color: #7a5900; border-top: 1px solid #fde68a;
}

/* ── Typing indicator ───────────────────────────────── */
#lac-typing-indicator {
  display: flex; gap: 4px; padding: 4px 14px 4px;
}
#lac-typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #aaa; animation: lac-dot 1.2s infinite;
}
#lac-typing-indicator span:nth-child(2) { animation-delay: .2s; }
#lac-typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes lac-dot { 0%,80%,100%{opacity:.25} 40%{opacity:1} }

/* ── Input area ─────────────────────────────────────── */
#lac-input-area {
  flex-shrink: 0; border-top: 1px solid #e8e8e8;
}
#lac-input-row {
  display: flex; align-items: flex-end;
  gap: 8px; padding: 10px 12px;
}
#lac-input {
  flex: 1; resize: none; border: 1px solid #d0d0d0;
  border-radius: 20px; padding: 9px 14px;
  font-size: 14px; outline: none; font-family: inherit;
  max-height: 100px; overflow-y: auto;
  transition: border-color .15s;
}
#lac-input:focus { border-color: #185FA5; }
#lac-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: #185FA5; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
#lac-send:hover { background: #0C447C; }
#lac-send:disabled { background: #9bbfd8; cursor: not-allowed; }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 420px) {
  #lac-chat-window {
    width: 100vw; max-width: 100vw;
    bottom: 0; right: 0;
    border-radius: 16px 16px 0 0;
    height: 80vh; max-height: 80vh;
  }
  #lac-bubble { bottom: 16px; right: 16px; }
}
