/* chatbot-layout.css — Winair */

/* ── Floating trigger ── */
#chat-btn {
  position: fixed; bottom: 28px; right: 28px;
  width: 70px; height: 70px;
  background: var(--wa-grad-brand); border-radius: 50%; border: none;
  cursor: pointer; z-index: 700;
  box-shadow: var(--wa-glow-mix);
  display: flex; align-items: center; justify-content: center;
  transition: transform .28s var(--wa-ease-bounce), box-shadow .3s ease;
  overflow: visible; padding: 0;
  animation: chatBtnFloat 3.4s ease-in-out infinite;
}
#chat-btn:hover {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 24px 58px rgba(204,0,0,.46), 0 12px 30px rgba(26,58,105,.36);
}
#chat-btn:active { transform: scale(.97); }
@keyframes chatBtnFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.chat-avatar-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; }
#chat-btn .chat-icon { width: 27px; height: 27px; fill: #fff; }
.chat-bubble-tip {
  position: absolute; bottom: 96px; right: 0;
  background: #fff; color: #333; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 18px 18px 4px 18px;
  box-shadow: 0 12px 32px rgba(20,30,60,.22);
  white-space: nowrap; font-family: var(--font-body);
  display: flex; align-items: center; gap: 8px;
  animation: bubbleIn .45s var(--wa-ease-bounce);
  border: 1px solid rgba(204,0,0,.08);
}
.chat-bubble-tip::after {
  content: ''; position: absolute; bottom: -7px; right: 18px;
  border: 7px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.chat-bubble-close {
  font-size: 10px; color: #aaa; cursor: pointer;
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f0f0f0; flex-shrink: 0;
  line-height: 1; transition: background .15s, color .15s;
}
.chat-bubble-close:hover { background: var(--wa-grad-btn); color: #fff; }
@keyframes bubbleIn {
  from { opacity:0; transform:scale(.8) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

/* ── Chat window ── */
#chat-window {
  position: fixed; bottom: 108px; right: 28px;
  width: 384px; min-width: 320px;
  max-width: min(430px, calc(100vw - 40px));
  height: calc(100vh - 128px); max-height: 820px; min-height: 540px;
  background: #fff; border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15,25,55,.3), 0 6px 18px rgba(0,0,0,.08);
  display: flex; flex-direction: column; z-index: 700; overflow: hidden;
  transform: scale(.86) translateY(24px); transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .38s var(--wa-ease-bounce), opacity .25s ease;
}
#chat-window.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

/* Resize handles */
.rb-resize-handle { position: absolute; z-index: 10; }
.rb-resize-handle.n  { top:0;    left:8px;   right:8px;  height:6px; cursor:n-resize; }
.rb-resize-handle.s  { bottom:0; left:8px;   right:8px;  height:6px; cursor:s-resize; }
.rb-resize-handle.e  { right:0;  top:8px;    bottom:8px; width:6px;  cursor:e-resize; }
.rb-resize-handle.w  { left:0;   top:8px;    bottom:8px; width:6px;  cursor:w-resize; }
.rb-resize-handle.ne { top:0;    right:0;    width:14px; height:14px; cursor:ne-resize; }
.rb-resize-handle.nw { top:0;    left:0;     width:14px; height:14px; cursor:nw-resize; }
.rb-resize-handle.se { bottom:0; right:0;    width:14px; height:14px; cursor:se-resize; }
.rb-resize-handle.sw { bottom:0; left:0;     width:14px; height:14px; cursor:sw-resize; }

/* ── Header ── */
.chat-header { display:flex; flex-direction:column; flex-shrink:0; cursor:grab; }
.chat-header:active { cursor:grabbing; }

.chat-header-bar {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--wa-grad-brand);
  padding: 12px 16px 12px 20px;
  border-radius: 22px 22px 0 0; gap: 10px;
}
.chat-header-bar::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 88% -20%, rgba(255,255,255,.3) 0%, transparent 50%);
  pointer-events: none;
}
.chat-header-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; z-index: 1; }
.chat-header-title {
  color: #fff; font-size: 15.5px; font-weight: 800;
  font-family: var(--font-body); line-height: 1.2;
  white-space: nowrap; text-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.chat-header-sub {
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,.85); font-size: 11.5px; font-weight: 500;
}
.chat-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ADE80; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(74,222,128,.35);
  animation: dotGlow 2s ease-in-out infinite;
}
@keyframes dotGlow {
  0%,100% { box-shadow: 0 0 0 2px rgba(74,222,128,.35); }
  50%     { box-shadow: 0 0 0 5px rgba(74,222,128,.15); }
}

.chat-icons { display:flex; align-items:center; gap:7px; flex-shrink: 0; z-index: 1; }
.ci-btn {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; transition: background .2s, transform .2s, box-shadow .2s; position: relative;
  backdrop-filter: blur(4px);
}
.ci-btn:hover { background: rgba(255,255,255,.36); transform: translateY(-2px) scale(1.08); box-shadow: 0 6px 14px rgba(0,0,0,.18); }

.chat-menu-panel {
  position: fixed;
  background: #fff; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15,25,55,.22);
  padding: 6px; min-width: 190px; z-index: 900;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(-6px) scale(.96);
  pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.chat-menu-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.chat-menu-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; text-align: left;
  padding: 9px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--wa-text);
  font-family: var(--font-body); cursor: pointer;
  transition: background .15s;
}
.chat-menu-item:hover { background: var(--wa-grad-soft); color: var(--wa-red); }

/* ── Compact hero strip ── */
.chat-hero {
  background: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid #F0F0F0; flex-shrink: 0;
  position: relative;
}
.chat-hero-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  padding: 2px; background: var(--wa-grad-brand);
  overflow: hidden; box-shadow: var(--wa-glow-red);
  flex-shrink: 0;
}
.chat-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.chat-hero-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.chat-hero-name { font-size: 14.5px; font-weight: 800; color: var(--wa-navy); }
.chat-hero-sub  { font-size: 11.5px; color: #999; }

.chat-wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: #f5f5f5; border: 1.5px solid #E0E0E0; border-radius: 24px;
  color: #555; font-size: 11.5px; font-weight: 600; font-family: var(--font-body);
  cursor: not-allowed; opacity: .7; flex-shrink: 0;
}

.chat-lang-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 14px; background: #fff;
  border-top: 1px solid #EBEBEB; gap: 8px;
}
.chat-lang-bar .lang-wrap { display: flex; align-items: center; }
.lang-select-wrap {
  position: relative; display: inline-flex; align-items: center;
}
#lang-select {
  font-size: 12.5px; font-family: var(--font-body); font-weight: 600;
  color: #333; background: #fff;
  border: 1.5px solid #E0E0E0; border-radius: 20px;
  padding: 5px 28px 5px 12px;
  cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .18s, box-shadow .18s;
  line-height: 1.2;
}
#lang-select:hover  { border-color: var(--wa-red); box-shadow: 0 2px 8px rgba(204,0,0,.12); }
#lang-select:focus  { border-color: var(--wa-red); box-shadow: 0 0 0 3px rgba(204,0,0,.10); }
.lang-chevron {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; color: #888; pointer-events: none;
}
#lang-note { font-size: 10.5px; color: #999; }

/* ── Messages area ── */
.chat-msgs {
  flex:1; min-height:0; overflow-y:auto;
  padding:18px 14px; display:flex; flex-direction:column;
  gap:10px; scroll-behavior:smooth;
  background: #F2F3F7;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.05);
}
.chat-msgs::-webkit-scrollbar       { width:5px; }
.chat-msgs::-webkit-scrollbar-track { background: transparent; }
.chat-msgs::-webkit-scrollbar-thumb { background:var(--wa-grad-btn); border-radius:6px; }

/* ── Input row ── */
.chat-input-row {
  padding: 13px 14px; border-top: 1px solid #EBEBEB;
  display: flex; gap: 9px; align-items: center;
  background: #fff; flex-shrink: 0;
}
#chat-input {
  flex:1; border: 1.5px solid #E4E4E4; border-radius: 26px; padding: 12px 18px;
  font-size: 13.5px; font-family: var(--font-body);
  outline: none; transition: border-color .22s, box-shadow .22s;
  min-width: 0; color: var(--wa-text); background: #fafafa;
}
#chat-input:focus { border-color: var(--wa-red); box-shadow: 0 0 0 4px rgba(204,0,0,.12); background: #fff; }
#chat-input::placeholder { color: #B8B8B8; }

#mic-btn {
  width:40px; height:40px; border-radius:50%; border:none;
  background:#F2F2F2; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; transition:background .2s, transform .2s, box-shadow .2s;
}
#mic-btn:hover     { background:var(--wa-grad-soft); transform:scale(1.08); box-shadow: 0 4px 12px rgba(204,0,0,.16); }
#mic-btn.listening { background:var(--wa-grad-btn); animation:micPulse 1s infinite; }
@keyframes micPulse {
  0%,100% { box-shadow:0 0 0 0   rgba(204,0,0,.4); }
  50%     { box-shadow:0 0 0 9px rgba(204,0,0,0); }
}

#send-btn {
  width:40px; height:40px; background:var(--wa-grad-btn);
  border:none; border-radius:50%; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--wa-glow-red); transition: transform .22s var(--wa-ease-bounce), box-shadow .22s;
}
#send-btn:hover { box-shadow: var(--wa-glow-red-lg); transform: scale(1.12) rotate(6deg); }
#send-btn:active { transform: scale(.94); }
#send-btn svg   { width:14px; height:14px; fill:#fff; }


/* ── Disclaimer ── */
.chat-disclaimer {
  padding:7px 16px 10px; background:#fff; border-top:1px solid #EBEBEB;
  font-size:7.5px; color:#CCC; line-height:1.55;
  text-align:center; flex-shrink:0;
}

@media (max-width:480px) {
  #chat-window {
    width:calc(100vw - 16px) !important; right:8px !important;
    left:8px !important; bottom:96px !important;
    min-width:unset; max-width:unset; border-radius:16px;
    height:calc(100vh - 130px) !important; max-height:unset;
  }
}
/* ── Voice wave (replaces input while recording) ── */
.chat-input-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center;
}
.chat-input-wrap #chat-input { width: 100%; }
#voice-wave {
  display: none; flex: 1;
  border: 1.5px solid rgba(204,0,0,.35);
  border-radius: 26px;
  background: var(--wa-grad-soft);
}