/* Floating "Ask AI" trigger button — City of Portsmouth colors */
.ai-chatbot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: #1C66A6;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
  transition: transform 0.2s, background 0.2s, opacity 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-chatbot-trigger:hover {
  background: #14143D;
  transform: scale(1.05);
}

.ai-chatbot-trigger--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.ai-chatbot-trigger-icon {
  flex-shrink: 0;
}

/* Overlay */
.ai-chatbot-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgb(20 20 61 / 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.ai-chatbot-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Floating widget panel */
.ai-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 460px;
  max-height: 650px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 32px rgb(20 20 61 / 0.2);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-out, opacity 0.3s, visibility 0.3s;
}

.ai-chatbot-widget--open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Widget header */
.ai-chatbot-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1C66A6;
  color: #fff;
  padding: 16px 18px;
  border-bottom: 3px solid #FDB813;
}

.ai-chatbot-widget-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.ai-chatbot-widget-project-name {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.ai-chatbot-widget-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ai-chatbot-widget-close:hover {
  background: rgb(253 184 19 / 0.25);
}

/* Override messages height for widget */
.ai-chatbot-widget .ai-chatbot-messages {
  min-height: 280px;
  max-height: 420px;
  padding: 1.125rem;
}

/* Responsive - full width on small screens */
@media (max-width: 480px) {
  .ai-chatbot-widget {
    width: calc(100vw - 16px);
    bottom: 8px;
    right: 8px;
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .ai-chatbot-trigger {
    bottom: 16px;
    right: 16px;
  }
}

/* Suggestion chips */
.ai-chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ai-chatbot-suggestion-btn {
  background: #f0f4ff;
  border: 1px solid #c7d4f5;
  border-radius: 16px;
  color: #1a3a8f;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 4px 12px;
  transition: background 0.15s, border-color 0.15s;
  /* Let long suggestions wrap instead of overflowing the widget width. */
  white-space: normal;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

.ai-chatbot-suggestion-btn:hover {
  background: #dce6ff;
  border-color: #1a3a8f;
}
