:root {
  --bg: #0e1117;
  --panel: #141821;
  --accent: #CF392C;
  --text: #e6e6e6;
  --muted: #9aa4b2;
  --radius: 16px;
}

* { box-sizing: border-box; }

.bugis-chatbot {
  position: fixed;
  right: 80px;  /* cukup jauh dari tombol top/music */
  bottom: 25px; /* cukup jauh dari elemen bawah */
  width: 360px;
  max-width: calc(100vw - 100px); /* agar tidak kepotong di layar kecil */
  background: var(--panel);
  color: var(--text);
  border: 1px solid #CF392C;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 
    0 0 30px rgba(207,57,44,0.6),
    0 0 10px rgba(207,57,44,0.3);
  animation: floatBot 2s ease-in-out infinite;
  z-index: 9999;
  left: auto;
}

@keyframes floatBot {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

.bugis-chatbot.min .bot-messages,
.bugis-chatbot.min .bot-form { display: none; }
.bugis-chatbot.min { width: 280px; }

.bot-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, #1b2130, #CF392C);
  padding: 12px 14px;
  border-bottom: 1px solid #CF392C;
}
.bot-title { font-weight: 700; }
.bot-subtitle { font-size: 12px; color: var(--text); }

.bot-close {
  background: transparent; border: 1px solid #2a3344; color: var(--muted);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
}
.bot-close:hover { border-color: var(--accent); color: var(--text); }

.bot-messages {
  height: 250px; overflow-y: auto; padding: 12px; background: var(--bg);
}

.msg {
  display: grid; gap: 6px; margin: 10px 0; line-height: 1.45;
  white-space: pre-wrap; word-wrap: break-word;
}
.msg.user { justify-items: end; }
.msg.user .bubble {
  background: #253046; color: #dfe7f5; border: 1px solid #34415a;
   font-size: 13px;
}
.msg.bot .bubble {
  background: #1a1f2c; border: 1px solid #2a3344;
   font-size: 13px;
}
.bubble {
  padding: 10px 12px;
  border-radius: 14px;
  max-width: 92%;
  position: relative;
}

.msg-info {
  display: flex;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  justify-content: flex-end;
  margin-top: 6px;
}

.copy-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s;
}
.copy-btn:hover {
  color: var(--accent);
}
.copy-btn svg { display: block; }

.bot-form {
  display: flex; gap: 8px; padding: 10px; background: #0e131d; border-top: 1px solid #232a36;
}
#botInput {
  flex: 1; padding: 10px 12px; border-radius: 12px; border: 1px solid #2a3344;
  background: #0d1420; color: var(--text);
}
#botInput:focus { outline: none; border-color: var(--accent); }
#botSend {
  padding: 10px 14px; background: var(--accent); color: white; border: none; border-radius: 12px; cursor: pointer;
}
#botSend:disabled { opacity: .6; cursor: not-allowed; }

.msg.bot.typing .bubble {
  display: flex;
  gap: 4px;
  padding: 10px;
  background: #1f2937;
  border-radius: 16px;
}

.dot {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.4s infinite both;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

#botToggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
#botToggle:hover { color: var(--accent); }


.copy-btn {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  margin-left: 6px;
  display: flex;
  align-items: center;
}

.copy-btn svg {
  width: 12px;   
  height: 12px;  
  fill: white;   
}

.copy-btn:hover svg {
  fill: var(--accent);
}

.copy-success {
  position: absolute;
  top: -18px;
  right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}


#bugisBot {
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: translateY(20px);
  z-index: 9999;
}

#bugisBot.show {
  opacity: 1;
  transform: translateY(0);
}


.msg .avatar {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  margin-right: 2px;
}

.msg.user .avatar { order: 2; margin-left: 2px; margin-right: 0; }

.msg.bot { display: flex; align-items: flex-start; }
.msg.bot .bubble {
  display: inline-block;
  text-align: left;
  padding: 6px 12px;
  border-radius: 12px;
  max-width: 70%;
  word-wrap: break-word;
}

.msg.user { display: flex; align-items: flex-start; justify-content: flex-end; }
.msg.user .bubble {
  display: inline-block;
  text-align: right;
  padding: 6px 12px;
  border-radius: 12px;
  max-width: 70%;
  word-wrap: break-word;
}

