/* ============================= */
/* Floating Toggle Button */
/* ============================= */

#ai-chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* ============================= */
/* Chat Box Container */
/* ============================= */

#ai-chatbox {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 360px;
    height: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    display: none;
    /* closed by default */
    flex-direction: column;
    font-family: Arial, sans-serif;
    z-index: 9999;
    overflow: hidden;
}

/* ============================= */
/* Header */
/* ============================= */

.ai-chat-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    padding: 14px 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

/* ============================= */
/* Chat Body */
/* ============================= */

#ai-chat-box {
    padding: 12px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Messages Area */
#ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

/* Scrollbar */
#ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chat-messages::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

/* ============================= */
/* Messages */
/* ============================= */

.user-msg,
.ai-msg {
    padding: 10px 12px;
    margin: 6px 0;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

/* User */
.user-msg {
    margin-left: auto;
    background: #2563eb;
    color: #ffffff;
    text-align: right;
    border-bottom-right-radius: 4px;
}

/* AI */
.ai-msg {
    margin-right: auto;
    background: #e5e7eb;
    color: #111827;
    border-bottom-left-radius: 4px;
}

/* Typing */
.ai-msg.typing {
    font-style: italic;
    opacity: 0.7;
}

/* ============================= */
/* Input Area */
/* ============================= */

.ai-chat-input-wrap {
    display: flex;
    gap: 6px;
}

#ai-chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

#ai-chat-send {
    padding: 10px 14px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

#ai-chat-send:hover {
    background: #1d4ed8;
}

/* ============================= */
/* Mobile Responsive (Fullscreen) */
/* ============================= */

@media (max-width: 768px) {

    #ai-chatbox {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .ai-chat-header {
        border-radius: 0;
    }

    #ai-chat-toggle {
        bottom: 20px;
        right: 20px;
    }
}













/* -------------------------
   AI Search Box
------------------------- */
.ai-search-wrapper {
    position: relative;
    max-width: 400px;
    margin: auto;
}

#ai-search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

/* Search results */
#ai-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 6px;
    display: none;
    z-index: 999;
}

.ai-live-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ai-live-results li {
    border-bottom: 1px solid #f1f5f9;
}

.ai-live-results li:last-child {
    border-bottom: none;
}

.ai-live-results a {
    display: flex;
    gap: 10px;
    padding: 10px;
    text-decoration: none;
    color: #111;
    align-items: center;
}

.ai-live-results img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.ai-live-results em {
    margin-left: auto;
    font-style: normal;
    color: #2563eb;
    font-weight: 600;
}