/* ----------------------------
   Chat Button
---------------------------- */
#ai-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #222;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    line-height: 60px;
    font-size: 28px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 15px #000;
}

/* ----------------------------
   Chat Popup
---------------------------- */
#ai-chat-popup {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 20px #000;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

/* ----------------------------
   Chat Header
---------------------------- */
#ai-chat-header {
    padding: 10px;
    font-weight: bold;
    background: #333;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

/* ----------------------------
   Chat Messages & Typing
---------------------------- */
#ai-chat-messages {
    height: 250px;
    overflow-y: auto;
    padding: 10px;
    flex-grow: 1;
}

#ai-chat-typing {
    padding: 5px 10px;
    height: 24px;
}

/* ----------------------------
   Chat Input
---------------------------- */
#ai-chat-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-top: 1px solid #444;
    border-radius: 0 0 12px 12px;
    background: #222;
    color: #fff;
}

/* ----------------------------
   Reset Button
---------------------------- */
#ai-chat-reset {
    width: 100%;
    padding: 6px;
    margin-top: 5px;
    background: #ff4d4d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

#ai-chat-reset:hover {
    background: #ff1a1a;
}

/* ----------------------------
   Chat Bubbles
---------------------------- */
.chat-msg-wrapper {
    margin-bottom: 8px;
    display: flex;
}

.user-msg-wrapper {
    justify-content: flex-end;
}

.ai-msg-wrapper {
    justify-content: flex-start;
}

.user-msg, .ai-msg {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 75%;
    word-wrap: break-word;
}

.user-msg {
    background: #555;
    color: #fff;
}

.ai-msg {
    background: #444;
    color: #fff;
}

/* ----------------------------
   Typing Dots Animation
---------------------------- */
#ai-chat-typing .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #aaa;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

#ai-chat-typing .dot:nth-child(1) {
    animation-delay: 0s;
}

#ai-chat-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

#ai-chat-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}
