@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap');

#faq-chatbot-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#faq-chatbot-icon {
    background: #8445F2;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

#faq-chatbot-icon:hover {
    transform: scale(1.1);
}

#faq-chatbot-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

#faq-chatbot-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    max-height: 600px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#faq-chatbot-wrapper.faq-chatbot-open #faq-chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.faq-chatbot-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1 1 auto;
    max-height: 100%;
}

.faq-chatbot-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.faq-chatbot-title {
    font-family: 'Noto Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.welcome-msg {
    margin: 0 0 25px 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
    align-items: flex-end;
    /* Align pills to the right */
}

.faq-item-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

.faq-pill-question {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    text-align: left;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.faq-pill-question.purple {
    background-color: #8445F2;
    color: #fff;
}

.faq-pill-question.grey {
    background-color: #717171;
    color: #fff;
}

.faq-pill-question.white {
    background-color: #fff;
    color: #1e293b;
    border-color: #e2e8f0;
}

.faq-pill-question.black {
    background-color: #000;
    color: #fff;
}

.faq-pill-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.faq-pill-answer {
    margin-top: 5px;
    padding: 15px 20px;
    background-color: #f8fafc;
    border-radius: 18px 4px 18px 18px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    align-self: flex-start;
    /* Answer bubbles appear to the left of the question pill? 
                               Actually, looking at the image, it's a follow-up. 
                               Let's make it look like a chat response. */
    display: none;
    /* Hidden by default */
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.faq-sub-questions-wrapper {
    width: 90%;
    margin-top: 10px;
    margin-left: auto;
    margin-right: 0;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.faq-sub-questions-wrapper .faq-pill-question {
    padding: 10px 18px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.faq-answer-text {
    margin-bottom: 0;
}

.faq-answer-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    width: 100%;
}

.faq-pill-answer[data-link]:hover {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    cursor: pointer;
}

.faq-item-container.active .faq-pill-answer {
    display: block;
    animation: fadeInSlide 0.3s ease forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-chatbot-footer {
    padding-top: 10px;
}

.faq-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    font-family: "Noto Sans", Sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #8445F2 !important;
    border: 2px solid #8445F2;
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 16px;
    text-decoration: none !important;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: pointer;
}

.faq-cta-button:hover {
    background-color: #8445F2;
    color: #ffffff !important;
    box-shadow: 0 10px 20px rgba(132, 69, 242, 0.2);
}

#faq-chatbot-icon {
    background: #8445F2;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(132, 69, 242, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    border: 1px solid #fff;
}

#faq-chatbot-icon:hover {
    transform: scale(1.05) rotate(5deg);
}

#faq-chatbot-icon::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s ease;
}

#faq-chatbot-wrapper.faq-chatbot-open #faq-chatbot-icon::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
    transform: rotate(90deg);
}

#faq-chatbot-icon img {
    display: none;
    /* Hide the old image icon */
}

@media (max-width: 480px) {
    #faq-chatbot-window {
        width: calc(100vw - 40px);
        bottom: 70px;
    }
}