/* Volt Hub Chatbot Widget */
:root {
  --vh-yellow: #FFD700;
  --vh-dark:   #1a1a1a;
  --vh-mid:    #2c2c2c;
  --vh-light:  #f4f4f4;
  --vh-radius: 16px;
  --vh-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

#vh-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Floating Bubble ── */
#vh-chat-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #e6b800);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,215,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
#vh-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255,215,0,0.65);
}
#vh-chat-bubble svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
#vh-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53e3e;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Chat Window ── */
#vh-chat-window {
  display: none;
  flex-direction: column;
  width: 360px;
  height: 520px;
  background: #ffffff;
  border-radius: var(--vh-radius);
  box-shadow: var(--vh-shadow);
  overflow: hidden;
  position: absolute;
  bottom: 72px;
  right: 0;
  animation: vhSlideUp 0.25s ease;
}
#vh-chat-window.open { display: flex; }

@keyframes vhSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
#vh-chat-header {
  background: var(--vh-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#vh-header-left { display: flex; align-items: center; gap: 10px; }
#vh-avatar {
  width: 38px;
  height: 38px;
  background: var(--vh-yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
#vh-agent-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
#vh-agent-status { color: #aaa; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.vh-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #48bb78;
  border-radius: 50%;
  animation: vhPulse 2s infinite;
}
@keyframes vhPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
#vh-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
#vh-close-btn:hover { color: #fff; }

/* ── Messages ── */
#vh-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#vh-messages::-webkit-scrollbar { width: 4px; }
#vh-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.vh-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: vhFadeIn 0.2s ease;
}
@keyframes vhFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vh-msg.bot {
  background: var(--vh-light);
  color: #222;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.vh-msg.user {
  background: var(--vh-dark);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* ── Typing Indicator ── */
#vh-typing {
  padding: 8px 18px 4px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.vh-typing-dot {
  width: 7px;
  height: 7px;
  background: #ccc;
  border-radius: 50%;
  animation: vhBounce 1.2s infinite;
}
.vh-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.vh-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vhBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ── Input Area ── */
#vh-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  gap: 8px;
  flex-shrink: 0;
}
#vh-input {
  flex: 1;
  border: 1.5px solid #e2e2e2;
  border-radius: 24px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  color: #222;
  background: #fafafa;
}
#vh-input:focus { border-color: var(--vh-yellow); }
#vh-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--vh-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
#vh-send-btn:hover { background: #FFD700; transform: scale(1.05); }

/* ── Footer ── */
#vh-footer {
  text-align: center;
  padding: 6px 10px 10px;
  font-size: 12px;
  color: #aaa;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#vh-footer a { color: #555; text-decoration: none; font-weight: 500; }
#vh-footer a:hover { color: var(--vh-dark); }

/* ── Mobile ── */
@media (max-width: 480px) {
  #vh-chat-window {
    width: calc(100vw - 24px);
    right: -12px;
    bottom: 70px;
    height: 480px;
  }
  #vh-chat-widget { right: 16px; bottom: 16px; }
}
