/* chatbot-layout.css — Winair */

/* ── Floating trigger ── */
#chat-btn {
  position: fixed; bottom: 28px; right: 28px;
  width: 80px; height: 80px;
  background: var(--wa-navy); border-radius: 50%; border: 3px solid var(--wa-navy);
  cursor: pointer; z-index: 700;
  box-shadow: 0 4px 20px rgba(29,52,97,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  overflow: visible; padding: 0;
}
#chat-btn:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(29,52,97,.6); }
.chat-avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; display: block; }
#chat-btn .chat-icon { width: 32px; height: 32px; fill: #fff; }
.chat-bubble-tip {
  position: absolute; bottom: 88px; right: 0;
  background: #fff; color: #333; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  white-space: nowrap; font-family: var(--font-body);
  display: flex; align-items: center; gap: 8px;
  animation: bubbleIn .4s cubic-bezier(.34,1.56,.64,1);
}
.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;
}
.chat-bubble-close:hover { background: #e0e0e0; }
@keyframes bubbleIn {
  from { opacity:0; transform:scale(.8) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.chat-badge {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: var(--wa-red); border-radius: 50%; border: 2px solid #fff;
  animation: badgePulse 2.2s infinite;
}
@keyframes badgePulse {
  0%,100% { transform:scale(1);   box-shadow:0 0 0 0   rgba(200,16,46,.5); }
  50%      { transform:scale(1.2); box-shadow:0 0 0 6px rgba(200,16,46,0); }
}

/* ── Chat window ── */
#chat-window {
  position: fixed; bottom: 118px; right: 28px;
  width: 370px; min-width: 300px;
  max-width: min(480px, calc(100vw - 40px));
  height: calc(100vh - 160px); max-height: 600px; min-height: 400px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.16);
  display: flex; flex-direction: column; z-index: 700; overflow: hidden;
  transform: scale(.88) translateY(18px); transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s 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 {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--wa-red);
  background-image: radial-gradient(circle at 80% 50%, rgba(255,255,255,.08) 0%, transparent 60%);
  padding: 12px 14px 12px 18px;
  border-radius: 16px 16px 0 0; gap: 10px;
}
.chat-header-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.chat-header-title {
  color: #fff; font-size: 14px; font-weight: 800;
  font-family: var(--font-body); line-height: 1.2;
  white-space: nowrap;
}
.chat-header-sub {
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,.75); font-size: 11px; font-weight: 400;
}
.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,.3);
}

.chat-icons { display:flex; gap:6px; flex-shrink: 0; }
.ci-btn {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: background .15s; position: relative;
}
.ci-btn:hover { background: rgba(255,255,255,.35); }
.ci-btn[data-tip]::after {
  content: attr(data-tip); position: absolute;
  bottom: calc(100% + 6px); right: 0;
  background: #333; color: #fff;
  font-size: 10px; white-space: nowrap; padding: 3px 8px;
  border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity .15s;
}
.ci-btn:hover::after { opacity: 1; }

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

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

.chat-lang-bar { display: none !important; }

/* ── Messages area ── */
.chat-msgs {
  flex:1; min-height:0; overflow-y:auto;
  padding:14px 12px; display:flex; flex-direction:column;
  gap:8px; scroll-behavior:smooth; background:#FAFAFA;
}
.chat-msgs::-webkit-scrollbar       { width:3px; }
.chat-msgs::-webkit-scrollbar-thumb { background:rgba(200,16,46,.25); border-radius:3px; }

/* ── Input row ── */
.chat-input-row {
  padding: 10px 12px; border-top: 1px solid #EBEBEB;
  display: flex; gap: 7px; align-items: center;
  background: #fff; flex-shrink: 0;
}
#chat-input {
  flex:1; border: 1.5px solid #E0E0E0; border-radius: 22px; padding: 9px 16px;
  font-size: 13px; font-family: var(--font-body);
  outline: none; transition: border-color .15s, box-shadow .15s;
  min-width: 0; color: var(--wa-text); background: #fff;
}
#chat-input:focus { border-color: var(--wa-red); box-shadow: 0 0 0 3px rgba(200,16,46,.08); }
#chat-input::placeholder { color: #C0C0C0; }

#mic-btn {
  width:34px; height:34px; border-radius:50%; border:none;
  background:#F0F0F0; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; transition:background .15s;
}
#mic-btn:hover     { background:#E4E4E4; }
#mic-btn.listening { background:#E53935; animation:micPulse 1s infinite; }
@keyframes micPulse {
  0%,100% { box-shadow:0 0 0 0   rgba(229,57,53,.4); }
  50%      { box-shadow:0 0 0 8px rgba(229,57,53,0); }
}

#send-btn {
  width:34px; height:34px; background:var(--wa-red); border:none;
  border-radius:50%; cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(200,16,46,.3); transition:all .18s;
}
#send-btn:hover { background:var(--wa-red-dark); transform:scale(1.08); }
#send-btn svg   { width:12px; height:12px; fill:#fff; }


/* ── Disclaimer ── */
.chat-disclaimer {
  padding:6px 14px 8px; background:#fff; border-top:1px solid #F0F0F0;
  font-size:7px; 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:110px !important;
    min-width:unset; max-width:unset; border-radius:12px;
    height:calc(100vh - 130px) !important; max-height:unset;
  }
}