/* ============================================================
   CHATBOT — Cherry BlueSky Records — estilos
   Paleta y tipografía alineadas con styles.css (azul celeste #53C5FF,
   rojo #D62C2C, neutros oscuros, Poppins/Montserrat/Inter).
   ============================================================ */
#cbs-chat-root {
  --cbs-accent: #53c5ff;      /* sky blue — igual que --accent del sitio */
  --cbs-accent-ink: #04151f;  /* texto oscuro sobre el azul, igual que .btn-primary */
  --cbs-accent-2: #d62c2c;    /* rojo — igual que --red del sitio */
  --cbs-bg: #0a0b0d;          /* igual que --bg */
  --cbs-panel: #16191d;       /* igual que --bg-3 */
  --cbs-bubble-bot: #1d2126;  /* igual que --bg-4 */
  --cbs-text: #f5f6f7;        /* igual que --ink */
  --cbs-text-dim: #9aa1a8;    /* igual que --ink-mute */
  --cbs-line: rgba(245,246,247,0.1);
  --cbs-radius: 18px;
  font-family: "Inter", "Montserrat", sans-serif;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
}

#cbs-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--cbs-accent);
  color: var(--cbs-accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(83,197,255,0.55);
  transition: transform .3s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow .3s ease;
}
#cbs-chat-toggle:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 32px -8px rgba(83,197,255,0.6); }
#cbs-chat-toggle svg { width: 26px; height: 26px; }

#cbs-chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(360px, calc(100vw - 40px));
  height: min(500px, calc(100vh - 140px));
  background: var(--cbs-panel);
  border-radius: var(--cbs-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .25s cubic-bezier(0.16,1,0.3,1), transform .25s cubic-bezier(0.16,1,0.3,1);
  border: 1px solid var(--cbs-line);
}
#cbs-chat-panel.cbs-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#cbs-chat-header {
  padding: 16px 18px;
  background: var(--cbs-accent);
  color: var(--cbs-accent-ink);
}
#cbs-chat-header-text strong { display: block; font-family: "Poppins", "Montserrat", sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
#cbs-chat-header-text span { display: block; font-size: 12px; opacity: .75; margin-top: 2px; }

#cbs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cbs-bg);
}
#cbs-chat-messages::-webkit-scrollbar { width: 6px; }
#cbs-chat-messages::-webkit-scrollbar-thumb { background: var(--cbs-line); border-radius: 4px; }

.cbs-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.cbs-msg-bot {
  align-self: flex-start;
  background: var(--cbs-bubble-bot);
  color: var(--cbs-text);
  border: 1px solid var(--cbs-line);
  border-bottom-left-radius: 4px;
}
.cbs-msg-user {
  align-self: flex-end;
  background: var(--cbs-accent);
  color: var(--cbs-accent-ink);
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.cbs-msg-typing { display: flex; gap: 4px; padding: 12px 14px; }
.cbs-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cbs-text-dim);
  animation: cbsBlink 1.2s infinite ease-in-out;
}
.cbs-msg-typing span:nth-child(2) { animation-delay: .2s; }
.cbs-msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cbsBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

#cbs-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--cbs-panel);
  border-top: 1px solid var(--cbs-line);
}
#cbs-chat-input {
  flex: 1;
  border: 1px solid var(--cbs-line);
  background: var(--cbs-bg);
  color: var(--cbs-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .3s ease;
}
#cbs-chat-input:focus { border-color: var(--cbs-accent); }
#cbs-chat-input::placeholder { color: var(--cbs-text-dim); }
#cbs-chat-send {
  width: 40px;
  border: none;
  border-radius: 10px;
  background: var(--cbs-accent);
  color: var(--cbs-accent-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
#cbs-chat-send:hover:not(:disabled) { transform: scale(1.06); }
#cbs-chat-send svg { width: 18px; height: 18px; }
#cbs-chat-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
  #cbs-chat-root { right: 12px; bottom: 12px; }
  #cbs-chat-panel { right: -6px; }
}
