/**
 * FAQ Chat Bubbles Widget Styles
 */

.faq-chat-container {
    width: 100%;
    box-sizing: border-box;
}

.faq-chat-item {
    width: 100%;
}

.faq-chat-item:last-child {
    margin-bottom: 0 !important;
}

/* Message wrapper */
.faq-chat-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

/* Question - Left aligned */
.faq-chat-question {
    justify-content: flex-start;
}

/* Answer - Right aligned */
.faq-chat-answer {
    justify-content: flex-end;
}

/* Bubble wrapper for content and label */
.bubble-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.faq-chat-question .bubble-wrapper {
    align-items: flex-start;
}

.faq-chat-answer .bubble-wrapper {
    align-items: flex-end;
}

/* Labels */
.bubble-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bubble content */
.bubble-content {
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Question bubble tail */
.faq-chat-question .bubble-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid #e3f2fd;
}

/* Answer bubble tail */
.faq-chat-answer .bubble-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid #ffffff;
}

/* Avatar styles */
.bubble-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.bubble-avatar img {
    object-fit: cover;
}

.bubble-avatar i {
    line-height: 1;
}

/* Answer content - allow HTML */
.faq-chat-answer .bubble-content p {
    margin: 0 0 10px 0;
}

.faq-chat-answer .bubble-content p:last-child {
    margin-bottom: 0;
}

.faq-chat-answer .bubble-content ul,
.faq-chat-answer .bubble-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.faq-chat-answer .bubble-content li {
    margin-bottom: 5px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .faq-chat-message {
        gap: 8px;
    }
    
    .bubble-content {
        font-size: 14px;
    }
    
    .faq-chat-question .bubble-content::before,
    .faq-chat-answer .bubble-content::after {
        display: none;
    }
}

/* Animation for chat effect (optional) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-chat-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Typing indicator styling (for future enhancement) */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 15px 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #90a4ae;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
