/* ===================================================================
   Chatbot Widget — container, bubble, window chrome, header
   Uses the site's existing CSS custom properties from :root
   =================================================================== */

#chatbot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* --- Floating bubble ------------------------------------------------ */

#chatbot-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent, #1a73e8);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: absolute;
  bottom: 0;
  right: 0;
}

#chatbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(26, 115, 232, 0.45);
}

#chatbot-bubble .material-symbols-outlined {
  font-size: 26px;
}

/* --- Unread badge --------------------------------------------------- */

.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--red, #c5221f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--bg, #f8fafd);
  animation: chatbot-badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatbot-badgePop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- Chat window ---------------------------------------------------- */

#chatbot-window {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 500px;
  background: var(--surface, #ffffff);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(60, 64, 67, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatbot-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* --- Header --------------------------------------------------------- */

.chatbot-header {
  background: var(--accent, #1a73e8);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chatbot-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-header-icon .material-symbols-outlined {
  font-size: 20px;
}

.chatbot-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-subtitle {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.chatbot-header-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.chatbot-header-actions button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.chatbot-header-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chatbot-header-actions .material-symbols-outlined {
  font-size: 20px;
}

/* --- Responsive ----------------------------------------------------- */

@media (max-width: 640px) {
  #chatbot-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  #chatbot-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 80px);
    max-height: 520px;
    right: 0;
    left: 0;
  }

  #chatbot-bubble {
    width: 50px;
    height: 50px;
  }
}
