﻿<!--1QLIK AI — Advanced Floating Chatbot (FULL) -->

/* ---------- layout & launcher ---------- */
#qlikLauncher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 6px 22px rgba(0,0,0,.35);
    transition: transform .18s ease;
}

#qlikLauncher:hover {
    transform: scale(1.08);
}

/* ---------- panel (initially hidden - slides from right) ---------- */
#qlikPanel {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 380px;
    max-width: calc(100% - 40px);
    height: 560px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    transform: translateX(420px);
    opacity: 0;
    z-index: 999;
    transition: transform .42s cubic-bezier(.2,.9,.2,1), opacity .28s ease;
    background: #ffffff;
    border: 2px solid #198754;
}

    /* visible class slides it in */
    #qlikPanel.open {
        transform: translateX(0);
        opacity: 1;
    }

/* ---------- header ---------- */
#qlikHeader {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #198754;
    color: #fff;
    padding: 12px 14px;
}

    #qlikHeader img {
        width: 36px;
        /*height: 36px;*/
        border-radius: 6px;
        background: #fff;
        padding: 4px;
    }

    #qlikHeader .title {
        font-weight: 700;
        font-size: 17px;
    }

    #qlikHeader .header-actions {
        margin-left: auto;
        display: flex;
        gap: 8px;
        align-items: center;
    }

.q-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
}

.q-min {
    transform-origin: center;
    transition: transform .18s ease;
}

/* ---------- body ---------- */
#qlikBody {
    padding: 14px;
    flex: 1;
    overflow: auto;
    background: #f6f7f8;
}

/* typing bubble / messages */
.q-welcome {
    margin-bottom: 10px;
    font-size: 16px;
    color: #222;
    line-height: 1.5;
    text-align: justify;
}

.q-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.ai-btn {
    background: #198754;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

    .ai-btn.secondary {
        background: #fff;
        color: #198754;
        border: 1px solid #198754;
    }

/* categories area */
#categoryToolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

#categorySearch {
    flex: 1;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

#clearSearch {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

/* categories list (scrollable) */
#categoryList {
    max-height: 340px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 6px;
}

.category-item {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #eee;
    cursor: pointer;
}

    .category-item:hover {
        background: #e8f6ef;
        border-color: #198754;
    }

/* suggestion dropdown under input */
#suggestBox {
    position: relative;
}

.suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 42px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 180px;
    overflow: auto;
    z-index: 1000000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
}

    .suggestion-item:last-child {
        border-bottom: none;
    }

    .suggestion-item:hover {
        background: #f1f1f1;
    }

/* controls & input area */
#qlikFooter {
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fafafa;
    border-top: 1px solid #eee;
}

#userInput {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

#sendBtn, #voiceBtn {
    background: #198754;
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
}

/* minimize animation */
#qlikPanel.minimized {
    transform: translateX(calc(350px + 20px)) scale(0.6);
    opacity: .9;
    height: 64px;
    width: 280px;
    border-radius: 12px;
    overflow: hidden;
}

/* ---------- dark mode ---------- */
#qlikPanel.dark {
    background: #0f1720;
    color: #fff !important;
    border-color: #0b6b45;
}

    #qlikPanel.dark #qlikHeader {
        background: #0b6b45;
    }

    #qlikPanel.dark .ai-btn {
        background: #0b6b45;
        color: #e6eef2;
    }

        #qlikPanel.dark .ai-btn.secondary {
            background: transparent;
            color: #e6eef2;
            border-color: #0b6b45;
        }

    #qlikPanel.dark .category-item {
        background: #0b1720;
        color: #dfeef0;
        border-color: #083826;
    }

    #qlikPanel.dark #qlikBody {
        background: #071016;
    }

/* responsive */
@media (max-width:420px) {
    #qlikPanel {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: calc(100% - 16px);
        bottom: 85px;
        height: 480px;
    }
}

