/* ═══════════════════════════════════════════
   BoostBot AI — Chat Widget Styles v1.5.0
   ═══════════════════════════════════════════ */

:root {
    --bbot-brand: #4ace33;
    --bbot-grey-100: #f7f7f8;
    --bbot-grey-200: #ececef;
    --bbot-grey-500: #8e8ea0;
    --bbot-grey-800: #2d2d30;
    --bbot-radius: 16px;
    --bbot-shadow: 0 6px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
}


/* ── FAB (Floating Action Button) ── */
.bbot-fab {
    position: fixed;
    z-index: 999998;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 0 14px;
    height: 52px;
    border: none;
    border-radius: 50px;
    background: var(--bbot-brand);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.bbot-fab:hover { transform: scale(1.04); box-shadow: 0 6px 20px rgba(0,0,0,0.22); }
.bbot-fab:active { transform: scale(0.97); }
.bbot-fab.bottom-right { right: 20px; }
.bbot-fab.bottom-left  { left: 20px; }

.bbot-fab.open {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.bbot-fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.bbot-fab-icon svg { width: 22px; height: 22px; }

.bbot-fab-label {
    white-space: nowrap;
    line-height: 1;
}

/* Notification dot */
.bbot-fab-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: bbotPulse 2s ease infinite;
}
.bbot-fab.open .bbot-fab-dot { display: none; }

@keyframes bbotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}


/* ── Chat Panel ── */
.bbot-panel {
    position: fixed;
    z-index: 999999;
    bottom: 86px;
    width: 380px;
    max-height: 560px;
    border-radius: var(--bbot-radius);
    background: #fff;
    box-shadow: var(--bbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.bbot-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.bbot-panel.bottom-right { right: 20px; }
.bbot-panel.bottom-left  { left: 20px; }


/* ── Header ── */
.bbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bbot-grey-800);
    color: #fff;
    flex-shrink: 0;
}

.bbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.bbot-header-info { flex: 1; min-width: 0; }
.bbot-header-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.bbot-header-status { font-size: 12px; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 5px; }
.bbot-header-status::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
}

.bbot-close {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s;
    flex-shrink: 0;
}
.bbot-close:hover { background: rgba(255,255,255,0.2); }
.bbot-close svg { width: 16px; height: 16px; }


/* ── AI Badge ── */
.bbot-ai-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 0;
    font-size: 11px;
    color: var(--bbot-grey-500);
    background: var(--bbot-grey-100);
    flex-shrink: 0;
}
.bbot-ai-badge svg { width: 12px; height: 12px; }


/* ── Messages ── */
.bbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    scroll-behavior: smooth;
}

.bbot-msg { display: flex; }
.bbot-msg.bot { justify-content: flex-start; }
.bbot-msg.user { justify-content: flex-end; }

.bbot-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bbot-msg.bot .bbot-bubble {
    background: var(--bbot-grey-100);
    color: var(--bbot-grey-800);
    border-bottom-left-radius: 4px;
}

.bbot-msg.user .bbot-bubble {
    background: var(--bbot-brand);
    color: #fff;
    border-bottom-right-radius: 4px;
}


/* ── Suggestions ── */
.bbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.bbot-pill {
    border: 1px solid var(--bbot-grey-200);
    background: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--bbot-grey-800);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
    line-height: 1.3;
}
.bbot-pill:hover {
    border-color: var(--bbot-brand);
    color: var(--bbot-brand);
    background: #f0fdf0;
}


/* ── Powered By ── */
.bbot-powered {
    padding: 0 16px 2px;
    text-align: center;
    font-size: 10px;
    color: var(--bbot-grey-500);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.bbot-powered a {
    color: var(--bbot-brand);
    text-decoration: none;
    font-weight: 600;
}
.bbot-powered a:hover { text-decoration: underline; }


/* ── Input Area ── */
.bbot-input-area {
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid var(--bbot-grey-200);
    flex-shrink: 0;
}

.bbot-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bbot-grey-100);
    border-radius: 12px;
    padding: 4px 4px 4px 14px;
}

.bbot-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: var(--bbot-grey-800);
    padding: 8px 0;
    min-width: 0;
}
.bbot-input::placeholder { color: var(--bbot-grey-500); }

.bbot-send {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bbot-grey-200);
    color: var(--bbot-grey-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.bbot-send.active {
    background: var(--bbot-brand);
    color: #fff;
}
.bbot-send svg { width: 16px; height: 16px; }


/* ── Typing Indicator ── */
.bbot-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.bbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bbot-grey-500);
    animation: bbotDot 1.4s infinite ease-in-out both;
}
.bbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.bbot-typing span:nth-child(2) { animation-delay: -0.16s; }

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


/* ── Mobile Responsive ── */
@media (max-width: 480px) {
    .bbot-panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 100px);
        left: 8px !important;
        right: 8px !important;
        bottom: 70px !important;
        border-radius: 14px;
    }

    .bbot-fab {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    .bbot-fab-label { display: none; }
    .bbot-fab-icon svg { width: 24px; height: 24px; }
}
