/* ── BadgePirates AI Assistant Widget ──────────────────────── */

#bp-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent, #00aaff);
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 22px;
  box-shadow: 0 6px 24px rgba(0, 170, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#bp-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 170, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.5);
}

#bp-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
}
#bp-chat-panel.open { display: flex; }

#bp-chat-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #080808;
  display: flex;
  align-items: center;
  gap: 12px;
}
#bp-chat-head .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 170, 255, 0.15);
  border: 1px solid #0077bb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
#bp-chat-head .info { flex: 1; }
#bp-chat-head .name {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}
#bp-chat-head .sub {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
#bp-chat-head .close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}
#bp-chat-head .close:hover { color: #fff; }

#bp-chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bp-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.bp-msg.bot {
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #ccc;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bp-msg.user {
  background: #00aaff;
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.bp-msg.error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff8080;
  align-self: flex-start;
}
.bp-msg.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 16px;
}
.bp-msg.typing span {
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  animation: bp-bounce 1.2s infinite;
}
.bp-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.bp-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bp-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

#bp-chat-form {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #080808;
  display: flex;
  gap: 10px;
}
#bp-chat-input {
  flex: 1;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  outline: none;
}
#bp-chat-input:focus { border-color: #00aaff; }
#bp-chat-input:disabled { opacity: 0.5; }
#bp-chat-send {
  background: #00aaff;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#bp-chat-send:hover:not(:disabled) { background: #33bbff; }
#bp-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

#bp-chat-disclaimer {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: #666;
  text-align: center;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: #080808;
  letter-spacing: 0.05em;
}
