#hion-ai-modal-container {
  display: none;
  position: fixed;
  inset: 0; 
  z-index: 9999;
}
#hion-ai-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
#hion-ai-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  max-width: 90%;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 100;
}
#hion-ai-modal-container .hion-ai-modal-top {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  margin-bottom: 12px;
}
#hion-ai-modal-container .hion-ai-modal-content {
  background: #fff;
  border-radius: 0 0 16px 16px;
  box-sizing: border-box;
  overflow: hidden;
}
#hion-ai-modal-container .hion-ai-description {
  background: #F1F1F1;
  color: #555555;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 16px 16px 0 0;
}

/* Hero area */
#hion-ai-modal-container .hion-ai-hero {
  position: absolute;
  top: 1.5rem;  /* Move it up or down as needed */
  left: 1.5rem;
}
#hion-ai-modal-container .hion-ai-hero img {
  width: 80px; /* or tweak to match your Figma size */
  height: auto;
}
#hion-ai-modal-container .hion-ai-sparkles {
  position: absolute;
  top: -0.8rem; 
  left: 3rem;
  width: 40px;
  opacity: 0.3;
}

/* Title moved slightly right to avoid icon overlap */
#hion-ai-modal-container .hion-ai-title {
  margin-left: 6rem;
  margin-top: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Close button */
#hion-ai-modal-container .close-btn {
  background: var(--hion-ai-search-primary-color);
  color: #FFFFFF;
  padding: 8px 12px 8px 8px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  border: 0;
}
#hion-ai-modal-container .close-btn img{
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* Input row */
#hion-ai-modal-container .hion-ai-input-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  border-top: 1px solid #E5E5E5;
}
#hion-ai-modal-container .hion-ai-label {
  flex: 1;
  position: relative;
  display: flex;         /* Make label a flex container */
  align-items: center;   /* Vertically center the input */
}
#hion-ai-modal-container .hion-ai-bubble-icon {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 20px;
  pointer-events: none;
}

#hion-ai-input {
  flex: 1;                        /* Make it take the available space */
  padding: 1rem 1.8rem 1rem; /* Leave space for the bubble icon */
  font-size: 1rem;
  border: none;
  min-width: 0;
  caret-color: var(--hion-ai-search-primary-color);
  /* Attempt to give the caret more “weight”. Use with caution—this also affects text appearance */
                   /* Allow the input to shrink if needed */
}

#hion-ai-input:focus {
  outline: none;
  border-color: var(--hion-ai-search-primary-color);;
}
#hion-ai-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 1;
  border: none;
  padding: 0;           /* Remove extra padding if it causes size issues */
  margin: 0;
  /* Optionally, set a fixed width/height if necessary */
  width: 32px;
  height: 32px;
  cursor: pointer;
}

#hion-ai-send-btn svg {
  fill: var(--hion-ai-search-primary-color);
  rotate: 180deg;
}

#hion-ai-send-btn img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
#hion-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat area */
#hion-ai-chat-content {
  max-height: 600px;           /* or whichever height suits your design */
  overflow-y: auto;
  /* Remove or soften the border */
  border: none;                /* or border: 1px solid #E0E0E0 for subtlety */
  border-radius: 0;          /* If you still want slightly rounded corners */
  background: #fff;            /* Or a subtle background color if desired */
  padding: 0 1rem;
}

#hion-ai-chat-content p {
  margin: .3rem .5rem;
}

#hion-ai-chat-content:disabled {
  display: none;
}

#hion-ai-chat-content::-webkit-scrollbar {
  width: 6px;
}
#hion-ai-chat-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#hion-ai-chat-content {
  scroll-behavior: smooth;
}


/* Bubble styles */
#hion-ai-modal-container .hion-ai-bubble {
  margin: 10px 0;
  padding: 0.75rem 0.75rem;   /* Larger padding for a more spacious feel */
  border-radius: 12px;    /* or 16px if your figma uses bigger rounding */
  line-height: 1.5;       /* slightly bigger line-height for readability */
  font-weight: 500;
  font-size: 15px;
}

#hion-ai-modal-container .hion-ai-bubble .citation svg {
    height: 1rem;
    position: relative;
    top: .2rem;
}

/* Purple user bubble */
#hion-ai-modal-container .user-bubble {
  margin-top: 24px;
  background: var(--hion-ai-search-primary-color);
  color: #fff;
  margin-left: 0;
  margin-right: auto;
  width: fit-content;
}

/* White AI bubble with subtle shadow */
#hion-ai-modal-container .bot-bubble {
  margin-bottom: 24px;
  background: #F1F1F1;
  color: #333;
  margin-right: 0;
  margin-left: auto;
}


/* Send button’s loading spinner */
#hion-ai-send-btn.hion-loading {
  position: relative;
  color: transparent; /* hide text/icon so spinner is visible */
}

#hion-ai-send-btn.hion-loading .button-content {
  visibility: hidden;
}

#hion-ai-send-btn.hion-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-top: 3px solid #7c4dff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spinBtn 0.7s linear infinite;
}

@keyframes spinBtn {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Related content header (for the group, if needed) */
#hion-ai-modal-container .related-header {
  margin-top: 1rem;
  padding: 2rem 0.5rem 0.5rem;
  background: #fff;
  color: #2F2F2F;
  font-weight: 500;
  border-radius: 0;
  text-align: center;
  font-size: 1.2rem;
  border-top: 1px solid #E5E5E5;
}

/* Adjusted style for the content-type text */
#hion-ai-modal-container .content-type-text {
  font-weight: 600;      /* Heavier font weight */
  font-size: 0.9rem;      /* Adjust as needed */
  color: #333;           /* Darker color to stand out */
}

/* Style for the display URL (shown under the title) */
#hion-ai-modal-container .hion-result-display-link {
  font-size: 0.85rem;    /* Slightly smaller text */
  color: #666;           /* A mid-tone gray */
  margin-top: 0.25rem;   /* Small gap from the title */
}
#hion-ai-modal-container .hion-result-display-link a {
  text-decoration: none;
  color: inherit;
}
#hion-ai-modal-container .hion-result-display-link a:hover {
  text-decoration: underline;
}

/* Existing result box styling (update as needed) */
#hion-ai-modal-container .hion-result-box {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid #eee;      /* Subtle border */
  background: #fff;            /* Light background */
  color: #333;                 /* Standard text color */
  position: relative;
}
#hion-ai-modal-container .hion-result-box:last-child {
  margin-bottom: 1rem;         /* Add space after the last result */
}

/* Header for each result type: adjust spacing so the link icon is on the right */
#hion-ai-modal-container .hion-result-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Link icon in result header */
#hion-ai-modal-container .hion-result-link-icon img {
  width: 16px;   /* Adjust icon size as needed */
  height: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
}
#hion-ai-modal-container .hion-result-link-icon:hover img {
  opacity: 1;
}

/* Style for the result title */
#hion-ai-modal-container .hion-result-title {
    line-height: 1.3rem;
    padding-bottom: .3rem;
}

#hion-ai-modal-container .hion-result-title a {
  color: var(--hion-ai-search-primary-color);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}

#hion-ai-modal-container .hion-result-title a:after {
    content: " ";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
}

#hion-ai-modal-container .hion-result-title a:hover {
  text-decoration: underline;
}

/* Style for the snippet text */
#hion-ai-modal-container .hion-result-snippet {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.3;
  color: #666;
  display: none;
}

/* Override fill for the close-icon inside the close button */
#hion-ai-modal-close img path {
  fill: var(--hion-ai-search-primary-color) !important;
}

/* Override fill for the submit-icon inside the send button */
#hion-ai-send-btn img path {
  fill: var(--hion-ai-search-primary-color) !important;
}

/* Related questions styles */
.related-questions {
  font-size: 15px;
  padding: 1.3rem;
}

.related-questions-header {
  display: flex;
  padding-bottom: 0.5rem;
  font-weight: 600;
}

.related-questions-header strong {
  padding-left: .5rem;
}

.related-questions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-question {
    font-size: 0.9em;
    color: #666;
    padding: 5px 0;
    cursor: pointer;
}

.related-question-list-item {
    color: var(--hion-ai-search-primary-color, #000);
    padding: .3rem 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.related-question-list-item:hover {
    opacity: 0.7;
}

.related-question-list-item:focus {
    outline: 2px solid var(--hion-ai-search-primary-color, #000);
    outline-offset: 2px;
}
