/* Styles for Floating FAQ Chat Bubble Widget */

#fcb-container {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#fcb-container.fcb-pos-right {
    right: var(--fcb-offset-x, 20px);
    bottom: var(--fcb-offset-y, 20px);
    align-items: flex-end;
}

#fcb-container.fcb-pos-left {
    left: var(--fcb-offset-x, 20px);
    bottom: var(--fcb-offset-y, 20px);
    align-items: flex-start;
}

/* Trigger Button */
#fcb-trigger {
    background-color: var(--fcb-primary-color, #14b8a6);
    color: var(--fcb-text-color, #ffffff);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease;
}

#fcb-trigger:hover {
    transform: scale(1.05);
}

/* Chat Window */
#fcb-window {
    width: 350px;
    height: 480px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 15px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#fcb-window.fcb-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    display: none !important;
}

/* Header */
.fcb-header {
    background-color: var(--fcb-primary-color, #14b8a6);
    color: var(--fcb-text-color, #ffffff);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.fcb-header-title {
    font-size: 16px;
}

#fcb-close {
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 2px;
    opacity: 0.8;
}

#fcb-close:hover {
    opacity: 1;
}

/* Chat Log Area */
.fcb-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Styles */
.fcb-msg {
    max-width: 80%;
    animation: fcb-fade-in 0.3s ease;
}

.fcb-msg-bot {
    align-self: flex-start;
}

.fcb-msg-user {
    align-self: flex-end;
}

.fcb-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.fcb-msg-bot .fcb-msg-content {
    background: #f3f4f6;
    color: #1f2937;
    border-top-left-radius: 2px;
}

.fcb-msg-user .fcb-msg-content {
    background: var(--fcb-primary-color, #14b8a6);
    color: var(--fcb-text-color, #ffffff);
    border-top-right-radius: 2px;
}

/* Quick Replies Box */
.fcb-quick-replies {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.fcb-faq-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.fcb-faq-btn:hover {
    background: #e5e7eb;
}

/* Typing Bubble Indicator */
.fcb-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 12px;
    width: fit-content;
}

.fcb-typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: fcb-typing-bounce 1s infinite ease-in-out;
}

.fcb-typing span:nth-child(2) { animation-delay: 0.2s; }
.fcb-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Admin offsets for WP Admin bar if user is logged in */
body.admin-bar #fcb-container {
    bottom: calc(var(--fcb-offset-y, 20px) + var(--wp-admin--admin-bar--height, 32px));
}

@keyframes fcb-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fcb-typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
