#chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    border: 1px solid #ccc;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: sans-serif;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 1;
    transform: translateY(0);

    /* 👇 Fix transparency and stacking */
    background-color: #ffffff;
    backdrop-filter: none;
    z-index: 9999; /* ensures it's always on top */
}

#chat-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    /*background-color: #6a0dad;   👈 Rich purple tone */
    background-color: var(--chatbot-color, #6a0dad);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-icon:hover {
    transform: scale(1.1);
    /*box-shadow: 0 0 20px rgba(106, 13, 173, 0.6);  👈 Matching purple glow */
    box-shadow: 0 0 20px rgba(106, 13, 173, 0.6);
    box-shadow: 0 0 20px color-mix(in srgb, var(--chatbot-color, #6a0dad) 60%, transparent);

}

#chat-header {
    /*background-color: #007bff;*/
    /*background-color: #6a0dad;  changed from blue to purple */
    background-color: var(--chatbot-color, #6a0dad);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000; /* keep header visible even if chat overlaps */
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}


#chat-messages {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;

    /* 👇 Ensure messages area also solid */
    background-color: #ffffff;
}

.message {
    /*margin-bottom: 10px;*/
    margin-bottom: 5px;
    /*padding: 8px 12px;*/
    padding: 2px 12px;  /* 👈 Reduced padding */
    /*border-radius: 18px;*/
    border-radius: 10px;
    max-width: 80%;
    line-height: 1.2;
    /*line-height: 1.4;*/
}

.user-message {
    /*background-color: #007bff;*/
    background-color: #6a0dad; /* purple */
    color: white;
    align-self: flex-end;
}

.bot-message {
    background-color: #f1f1f1;
    color: black;
    align-self: flex-start;
}

#chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;

    /* 👇 Make input area opaque */
    background-color: #ffffff;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px;
    font-size: 1em;
    caret-color: #6a0dad; /* purple cursor */
}

#chat-input:focus {
    outline: none;
    border-color: #6a0dad;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.2);
}

#chat-send-btn {
    /*background-color: #007bff;*/
    /*background-color: #6a0dad;  changed from blue to purple */
    background-color: var(--chatbot-color, #6a0dad);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
}
#chat-send-btn:hover {
    background-color: #8b3ef7; /* lighter purple on hover */
}

#chat-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

/* 🔗 Make links inside bot messages purple and underlined */
.bot-message a {
    color: #6a0dad;
    text-decoration: underline;
}

.bot-message a:hover {
    color: #8b3ef7; /* lighter purple on hover */
}

/* Bot typing indicator (3 bouncing purple dots) */
.typing-indicator .typing {
  display: inline-block;
  line-height: 1;
}
.typing-indicator .typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: #6a0dad;
  opacity: 0.3;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-indicator .typing span:nth-child(2) { animation-delay: .2s; }
.typing-indicator .typing span:nth-child(3) { animation-delay: .4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: .3; }
  20%      { transform: translateY(-3px); opacity: 1; }
}


