/* AI Assistant Bubble */
.ai-assistant-bubble {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 56px;
    height: 56px;
    background-color: #f0e033;
    border: 2px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
}

/* SVG icon sizing */
.ai-assistant-bubble .ai-assistant-icon {
    width: 32px;
    height: 32px;
}

/* Tooltip */
.ai-assistant-bubble:hover::after {
    content: "Need Help?";
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #ffffff;
    color: #000000;
    padding: 6px 10px;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 99999;
}

/* Chat Panel */
.ai-assistant-panel {
    position: fixed;
    bottom: 90px;
    right: 22px;
    width: 380px; /* Slightly wider to give text breathing room */
    height: 720px;          
    min-height: 350px;      
    max-height: 85vh;       
    resize: vertical;       
    overflow: auto;         
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    z-index: 99999;
    pointer-events: auto;
    /* Remove word-break from here */
}

/* Ensure messages and links wrap cleanly as unbroken units */
.ai-assistant-panel p,
.ai-assistant-panel div {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Force long URLs to break gracefully at slashes rather than random letters */
.ai-assistant-panel a {
    overflow-wrap: break-word;
    word-break: break-word;
    display: inline-block;
}
/* Header */
.ai-assistant-header {
    background: #7ec8e3;
    padding: 10px;
    border-bottom: 3px solid #e63946;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.ai-assistant-title {
    font-weight: bold;
    font-size: 14px;
}

.ai-assistant-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

/* Body */
.ai-assistant-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

/* Input */
.ai-assistant-input {
    display: flex;
    border-top: 1px solid #ccc;
    position: relative;
    z-index: 1;
}

.ai-assistant-input input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
}

.ai-assistant-input button {
    background: #4b4874;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
}

/* USER MESSAGE */
.ai-msg-user {
    background: #e8f0fe;
    color: #0b3d91;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 6px 0;
    width: 100%;
    box-sizing: border-box;
    word-break: break-all;
    align-self: flex-end;
}

/* BOT MESSAGE */
.ai-msg-bot {
    background: #f5f5f5;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 6px 0;
    width: 100%;
    box-sizing: border-box;
    word-break: break-all;
    align-self: flex-start;
    position: relative;
    z-index: 3;
}

/* Make links clickable and styled — HARD OVERRIDES */
.ai-msg-bot a,
.ai-msg-user a {
    color: #0066cc !important;        /* override bootstrap + theme */
    text-decoration: underline !important;
    pointer-events: auto !important;  /* override global disabled links */
    cursor: pointer !important;
    word-break: break-all;
}

/* Prevent global nav styles from affecting assistant */
.ai-assistant-panel a {
    color: #0066cc !important;
    pointer-events: auto !important;
}
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #e9ecef;
  border-radius: 12px;
  width: fit-content;
  margin: 8px 0;
  align-self: flex-start;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background-color: #6c757d;
  border-radius: 50%;
  animation: typingWiggle 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingWiggle {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}