:root{
    --faqtastic-chatbot-primary-color: #0078fe;
    --faqtastic-chatbot-secondary-color: #e5e5ea;
    --faqtastic-chatbot-background-color: #fefefe;
    --faqtastic-chatbot-font-color: #000000;
    --faqtastic-chatbot-font-size: 1rem;
    --faqtastic-chatbot-border-radius: 10px;
    --faqtastic-chatbot-box-shadow: 0 6px 20px rgba(0,0,0,0.2);

    --faqtastic-bubble-large-radius: 16px;
    --faqtastic-bubble-small-radius: 4px;
}

.faqtastic-chatbot-conversation {
    flex: 1;
    padding: 10px;
    height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--faqtastic-chatbot-primary-color) #f1f1f1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    &::-webkit-scrollbar {
        width: 8px;
    }
    
    &::-webkit-scrollbar-track {
        background: var(--faqtastic-chatbot-background-color);
        border-radius: var(--faqtastic-chatbot-border-radius);
    }
    
    &::-webkit-scrollbar-thumb {
        background-color: var(--faqtastic-chatbot-primary-color);
        border-radius: var(--faqtastic-chatbot-border-radius);
        border: 2px solid var(--faqtastic-chatbot-background-color);
    }
    
    &::-webkit-scrollbar-thumb:hover {
        background-color: #005f8d;
    }
}

.faqtastic-chatbot-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: var(--faqtastic-bubble-large-radius);
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    animation: fadeIn 0.2s ease;
    &.bot {
        align-self: flex-start;
        background-color: var(--faqtastic-chatbot-secondary-color);
        color: var(--faqtastic-chatbot-font-color);
        border-bottom-left-radius: var(--faqtastic-bubble-small-radius);
        border-bottom-right-radius: var(--faqtastic-bubble-large-radius);
        border-top-left-radius: var(--faqtastic-bubble-large-radius);
        border-top-right-radius: var(--faqtastic-bubble-large-radius);
    }
    &.user {
        align-self: flex-end;
        background-color: var(--faqtastic-chatbot-primary-color);
        color: var(--faqtastic-chatbot-background-color);
        border-bottom-left-radius: var(--faqtastic-bubble-large-radius);
        border-bottom-right-radius: var(--faqtastic-bubble-small-radius);
        border-top-left-radius: var(--faqtastic-bubble-large-radius);
        border-top-right-radius: var(--faqtastic-bubble-large-radius);
    }
}



.faqtastic-chatbot-input {
    border: 1px solid #ccc;
    border-radius: var(--faqtastic-chatbot-border-radius);
    padding: 8px 16px;
    margin: 8px;
    width: calc(100% - 50px);
    outline: none;
}

.faqtastic-chatbot-suggestions {
    list-style: none;
    padding: 0;
    margin: 0 8px 8px 8px;
    background: var(--faqtastic-chatbot-background-color);
    border: 1px solid #ccc;
    border-radius: var(--faqtastic-chatbot-border-radius);
    max-height: 120px;
    overflow-y: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    li {
        border-radius: var(--faqtastic-chatbot-border-radius);
        padding: 6px 12px;
        cursor: pointer;
        transition: background 0.2s;
        &.selected,
        &:hover {
            background-color: var(--faqtastic-chatbot-secondary-color);
        }
    }
}



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.faqtastic-chatbot-wrapper {
    &[data-position="bottom-right"] {
        bottom: 20px;
        right: 20px;
    }
    &[data-position="bottom-left"] {
        bottom: 20px;
        left: 20px;
    }
    &[data-position="top-right"] {
        top: 20px;
        right: 20px;
    }
    &[data-position="top-left"] {
        top: 20px;
        left: 20px;
    }
    position: fixed;
    &[data-position="relative"] {
        position: relative;
    }
    z-index: 9999;
}

.faqtastic-chatbot-toggle {
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    &:hover {
        transform: scale(1.05);
    }
}

// Custom SVG icon styles
.faqtastic-chatbot-custom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    
    svg {
        width: 100%;
        height: 100%;
        fill: currentColor;
    }
}

// Custom Image icon styles
.faqtastic-chatbot-custom-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 0;
}

.faqtastic-chatbot-wrapper[data-position="relative"] .faqtastic-chatbot-toggle {
    margin-top: 0.5rem;
}


.faqtastic-chatbot-window {
    position: absolute;
    width: 320px;
    height: 420px;
    background: var(--faqtastic-chatbot-background-color);
    border-radius: var(--faqtastic-chatbot-border-radius);
    box-shadow: var(--faqtastic-chatbot-box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 1rem;
}

.faqtastic-chatbot-wrapper[data-position="bottom-right"] .faqtastic-chatbot-window {
    bottom: 80px;
    right: 0;
}

.faqtastic-chatbot-wrapper[data-position="bottom-left"] .faqtastic-chatbot-window {
    bottom: 80px;
    left: 0;
}

.faqtastic-chatbot-wrapper[data-position="top-right"] .faqtastic-chatbot-window {
    top: 80px;
    right: 0;
}

.faqtastic-chatbot-wrapper[data-position="top-left"] .faqtastic-chatbot-window {
    top: 80px;
    left: 0;
}

.faqtastic-chatbot-wrapper[data-position="relative"] .faqtastic-chatbot-window {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
}


.faqtastic-chatbot-header {
    padding: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faqtastic-chatbot-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faqtastic-chatbot-title {
    font-weight: bold;
    line-height: 1.2;
}

.faqtastic-chatbot-subtitle {
    font-size: 0.75em;
    font-weight: normal;
    opacity: 0.85;
    line-height: 1.2;
}

.faqtastic-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

@media (max-height: 600px) {
    .faqtastic-chatbot-window {
        height: 70vh;
    }
}