/* AI Chat Bot Widget Styles */

/* ── Floating Button ──────────────────────────────────────────────────────── */
#aicb-toggle {
  position:       fixed;
  bottom:         24px;
  right:          24px;
  width:          60px;
  height:         60px;
  border-radius:  50%;
  background:     linear-gradient(135deg, #2271b1, #135e96);
  color:          #fff;
  border:         none;
  cursor:         pointer;
  font-size:      26px;
  display:        flex;
  align-items:    center;
  justify-content:center;
  box-shadow:     0 4px 16px rgba(0,0,0,.25);
  z-index:        99999;
  transition:     transform .2s, box-shadow .2s;
}
#aicb-toggle:hover {
  transform:   scale(1.08);
  box-shadow:  0 6px 20px rgba(0,0,0,.3);
}

/* ── Chat Window ─────────────────────────────────────────────────────────── */
#aicb-window {
  position:      fixed;
  bottom:        100px;
  right:         24px;
  width:         360px;
  max-height:    520px;
  border-radius: 16px;
  overflow:      hidden;
  display:       flex;
  flex-direction:column;
  box-shadow:    0 8px 32px rgba(0,0,0,.2);
  z-index:       99998;
  font-family:   -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size:     14px;
  background:    #fff;
  transform:     scale(.9) translateY(20px);
  opacity:       0;
  pointer-events:none;
  transition:    opacity .25s, transform .25s;
}
#aicb-window.open {
  transform:    scale(1) translateY(0);
  opacity:      1;
  pointer-events: all;
}

/* Header */
#aicb-header {
  background:    linear-gradient(135deg, #2271b1, #135e96);
  color:         #fff;
  padding:       14px 16px;
  display:       flex;
  align-items:   center;
  gap:           10px;
}
#aicb-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;
  flex-shrink:   0;
}
#aicb-header-info { flex: 1; }
#aicb-header-name {
  font-weight: 600;
  font-size:   15px;
}
#aicb-header-status {
  font-size:   12px;
  opacity:     .85;
  display:     flex;
  align-items: center;
  gap:         4px;
}
#aicb-header-status::before {
  content:       '';
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    #4ade80;
  display:       inline-block;
}
#aicb-close {
  background:  none;
  border:      none;
  color:       rgba(255,255,255,.8);
  font-size:   20px;
  cursor:      pointer;
  padding:     2px 6px;
  border-radius: 4px;
  line-height: 1;
}
#aicb-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Messages */
#aicb-messages {
  flex:           1;
  overflow-y:     auto;
  padding:        16px;
  display:        flex;
  flex-direction: column;
  gap:            10px;
  background:     #f8f9fb;
}
.aicb-msg {
  display:       flex;
  align-items:   flex-end;
  gap:           6px;
  max-width:     85%;
}
.aicb-msg.bot { align-self: flex-start; }
.aicb-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.aicb-bubble {
  padding:        9px 13px;
  border-radius:  14px;
  line-height:    1.5;
}
.aicb-msg.bot  .aicb-bubble { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-bottom-left-radius: 4px; }
.aicb-msg.user .aicb-bubble { background: linear-gradient(135deg, #2271b1, #135e96); color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
.aicb-typing { display: flex; align-items: center; gap: 5px; padding: 12px 14px; }
.aicb-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: #9ca3af;
  animation: aicb-bounce .9s ease-in-out infinite;
}
.aicb-typing span:nth-child(2) { animation-delay: .15s; }
.aicb-typing span:nth-child(3) { animation-delay: .3s;  }
@keyframes aicb-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-7px); }
}

/* Input area */
#aicb-input-area {
  display:    flex;
  gap:        8px;
  padding:    12px 14px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
#aicb-input {
  flex:        1;
  border:      1px solid #e5e7eb;
  border-radius: 24px;
  padding:     9px 14px;
  font-size:   14px;
  outline:     none;
  resize:      none;
  font-family: inherit;
  line-height: 1.4;
  max-height:  100px;
  overflow-y:  auto;
}
#aicb-input:focus { border-color: #2271b1; }
#aicb-send {
  width:         38px;
  height:        38px;
  border-radius: 50%;
  background:    linear-gradient(135deg, #2271b1, #135e96);
  color:         #fff;
  border:        none;
  cursor:        pointer;
  font-size:     16px;
  display:       flex;
  align-items:   center;
  justify-content:center;
  flex-shrink:   0;
  transition:    transform .15s;
  align-self:    flex-end;
}
#aicb-send:hover { transform: scale(1.08); }
#aicb-send:disabled { opacity: .5; cursor: default; transform: none; }

/* Mobile */
@media (max-width: 420px) {
  #aicb-window { width: calc(100vw - 24px); right: 12px; bottom: 88px; }
  #aicb-toggle { right: 16px; bottom: 16px; }
}
