/* Chatbot UI */

#cm-chat-bubble {
    position:fixed; bottom:28px; right:28px; z-index:9999;
    width:56px; height:56px; border-radius:50%;
    background:var(--orange); border:none; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 4px 20px rgba(212,80,10,0.45);
    animation:pulse-bubble 2.5s infinite;
    transition:transform 0.2s;
  }
  #cm-chat-bubble:hover { transform:scale(1.08); }
  @keyframes pulse-bubble {
    0%,100% { box-shadow:0 4px 20px rgba(212,80,10,0.45), 0 0 0 0 rgba(212,80,10,0.3); }
    50%      { box-shadow:0 4px 20px rgba(212,80,10,0.45), 0 0 0 10px rgba(212,80,10,0); }
  }
  #cm-chat-bubble svg { width:26px; height:26px; fill:#fff; pointer-events:none; }

  #cm-chat-window {
    position:fixed; bottom:96px; right:28px; z-index:9999;
    width:340px; max-height:480px;
    background:#111; border:0.5px solid var(--border-bright);
    border-radius:16px; overflow:hidden;
    flex-direction:column;
    box-shadow:0 12px 48px rgba(0,0,0,0.7);
    font-family:var(--sans);
  }
  #cm-chat-header {
    background:var(--orange); padding:14px 18px;
    display:flex; align-items:center; justify-content:space-between;
  }
  #cm-chat-header-left { display:flex; align-items:center; gap:10px; }
  .cm-avatar {
    width:34px; height:34px; border-radius:50%;
    background:rgba(255,255,255,0.2);
    display:flex; align-items:center; justify-content:center;
    font-size:13px; font-weight:700; color:#fff;
  }
  .cm-chat-name { font-size:13px; font-weight:700; color:#fff; }
  .cm-chat-sub  { font-size:10px; color:rgba(255,255,255,0.75); font-family:var(--mono); letter-spacing:0.06em; }
  #cm-chat-close { background:none; border:none; cursor:pointer; color:rgba(255,255,255,0.8); font-size:22px; line-height:1; padding:0; }
  #cm-chat-close:hover { color:#fff; }

  #cm-chat-messages {
    flex:1; overflow-y:auto; padding:14px 16px;
    display:flex; flex-direction:column; gap:10px; max-height:280px;
  }
  #cm-chat-messages::-webkit-scrollbar { width:4px; }
  #cm-chat-messages::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }

  .cm-msg { max-width:82%; padding:9px 13px; border-radius:12px; font-size:13px; line-height:1.5; word-break:break-word; }
  .cm-msg.bot    { align-self:flex-start; background:#1e1e1e; color:var(--off-white); border:0.5px solid var(--border); border-bottom-left-radius:3px; }
  .cm-msg.user   { align-self:flex-end; background:var(--orange); color:#fff; border-bottom-right-radius:3px; }
  .cm-msg.typing { align-self:flex-start; background:#1e1e1e; color:var(--muted); border:0.5px solid var(--border); }

  #cm-chat-input-row {
    display:flex; gap:8px; padding:12px 14px;
    border-top:0.5px solid var(--border); background:#0d0d0d;
  }
  #cm-chat-input {
    flex:1; background:#1a1a1a; border:0.5px solid var(--border);
    border-radius:8px; padding:9px 12px; color:var(--off-white);
    font-size:13px; font-family:var(--sans); outline:none; resize:none;
  }
  #cm-chat-input:focus { border-color:var(--orange); }
  #cm-chat-send {
    background:var(--orange); border:none; border-radius:8px;
    width:38px; height:38px; cursor:pointer; align-self:flex-end;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  #cm-chat-send:hover { opacity:0.85; }
  #cm-chat-send svg { width:16px; height:16px; fill:#fff; pointer-events:none; }
  #cm-chat-footer {
    text-align:center; padding:6px; font-family:var(--mono);
    font-size:9px; color:var(--muted); letter-spacing:0.08em;
    border-top:0.5px solid var(--border); background:#0d0d0d;
  }


/* Theme refresh overrides */
#cm-chat-window {
  background: linear-gradient(180deg, #0E1512 0%, #0B100E 100%);
  border-color: rgba(132,196,149,0.20);
}
#cm-chat-header {
  background: linear-gradient(90deg, rgba(26, 78, 46, 0.96) 0%, rgba(212,80,10,0.92) 100%);
}
.cm-msg.bot,
.cm-msg.typing,
#cm-chat-input,
#cm-chat-input-row,
#cm-chat-footer {
  background-color: #121917;
}


/* Chat window multicolor accents */
#cm-chat-window::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 16%, rgba(74,225,132,0.10) 0%, rgba(74,225,132,0) 30%),
    radial-gradient(circle at 86% 18%, rgba(180,108,255,0.10) 0%, rgba(180,108,255,0) 34%),
    radial-gradient(circle at 76% 84%, rgba(246,151,70,0.08) 0%, rgba(246,151,70,0) 30%);
}
