/* ==========================================================================
   GGF Chatbot Styles
   ========================================================================== */

/* ── Floating Bubble ── */
.ggf-chatbot__bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ggf-color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ggf-shadow-lg);
    z-index: 9998;
    transition: transform var(--ggf-transition-fast), background var(--ggf-transition-fast);
}
.ggf-chatbot__bubble:hover {
    transform: scale(1.08);
    background: var(--ggf-color-primary-dark);
}
.ggf-chatbot__bubble--hidden {
    transform: scale(0);
    pointer-events: none;
}
.ggf-chatbot__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--ggf-color-success);
    border-radius: 50%;
    border: 2px solid white;
}
.ggf-chatbot__badge--pulse {
    animation: ggf-chatbot-pulse 2s ease-in-out infinite;
}
@keyframes ggf-chatbot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* ── Chat Window ── */
.ggf-chatbot__window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: var(--ggf-radius-lg);
    box-shadow: var(--ggf-shadow-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity var(--ggf-transition-base), transform var(--ggf-transition-base);
}
.ggf-chatbot__window--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Header ── */
.ggf-chatbot__header {
    background: var(--ggf-color-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ggf-chatbot__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ggf-chatbot__avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ggf-chatbot__name {
    font-family: var(--ggf-font-nav);
    font-size: var(--ggf-text-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.ggf-chatbot__status {
    font-size: var(--ggf-text-xs);
    opacity: 0.85;
}
.ggf-chatbot__close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity var(--ggf-transition-fast);
}
.ggf-chatbot__close:hover { opacity: 1; }

/* ── Messages Area ── */
.ggf-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* ── Message Bubbles ── */
.ggf-chatbot__msg {
    display: flex;
    max-width: 85%;
    animation: ggf-chatbot-fadein 0.3s ease;
}
@keyframes ggf-chatbot-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ggf-chatbot__msg--bot { align-self: flex-start; }
.ggf-chatbot__msg--user { align-self: flex-end; }

.ggf-chatbot__msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: var(--ggf-text-sm);
    line-height: 1.5;
    font-family: var(--ggf-font-body);
}
.ggf-chatbot__msg--bot .ggf-chatbot__msg-bubble {
    background: var(--ggf-color-offwhite);
    color: var(--ggf-color-text);
    border-bottom-left-radius: 4px;
}
.ggf-chatbot__msg--user .ggf-chatbot__msg-bubble {
    background: var(--ggf-color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ── Typing Indicator ── */
.ggf-chatbot__typing .ggf-chatbot__msg-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 18px;
}
.ggf-chatbot__dot {
    width: 8px;
    height: 8px;
    background: var(--ggf-color-text-light);
    border-radius: 50%;
    animation: ggf-chatbot-bounce 1.4s ease-in-out infinite;
}
.ggf-chatbot__dot:nth-child(2) { animation-delay: 0.16s; }
.ggf-chatbot__dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes ggf-chatbot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* ── Related Questions ── */
.ggf-chatbot__related {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    align-self: flex-start;
    max-width: 85%;
    animation: ggf-chatbot-fadein 0.3s ease;
}
.ggf-chatbot__related-label {
    font-size: var(--ggf-text-xs);
    color: var(--ggf-color-text-light);
    width: 100%;
    margin-bottom: 2px;
}
.ggf-chatbot__related-btn {
    background: none;
    border: 1px solid var(--ggf-color-primary-light);
    color: var(--ggf-color-primary);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--ggf-font-body);
    transition: background var(--ggf-transition-fast), color var(--ggf-transition-fast);
}
.ggf-chatbot__related-btn:hover {
    background: var(--ggf-color-primary);
    color: white;
}

/* ── Quick Suggestions ── */
.ggf-chatbot__suggestions {
    padding: 8px 16px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid var(--ggf-color-border);
    flex-shrink: 0;
    max-height: 100px;
    overflow-y: auto;
}
.ggf-chatbot__suggestion {
    background: var(--ggf-color-primary-wash);
    border: none;
    color: var(--ggf-color-primary-dark);
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--ggf-font-body);
    transition: background var(--ggf-transition-fast), color var(--ggf-transition-fast);
    white-space: nowrap;
}
.ggf-chatbot__suggestion:hover {
    background: var(--ggf-color-primary);
    color: white;
}

/* ── Input Area ── */
.ggf-chatbot__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--ggf-color-border);
    flex-shrink: 0;
    background: white;
}
.ggf-chatbot__input {
    flex: 1;
    border: 1px solid var(--ggf-color-border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: var(--ggf-text-sm);
    font-family: var(--ggf-font-body);
    outline: none;
    transition: border-color var(--ggf-transition-fast);
}
.ggf-chatbot__input:focus {
    border-color: var(--ggf-color-primary);
}
.ggf-chatbot__input::placeholder {
    color: var(--ggf-color-text-light);
}
.ggf-chatbot__send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--ggf-color-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--ggf-transition-fast);
}
.ggf-chatbot__send:hover {
    background: var(--ggf-color-primary-dark);
}

/* ── WhatsApp Link ── */
.ggf-chatbot__wa-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--ggf-text-sm);
}
.ggf-chatbot__wa-link:hover {
    text-decoration: underline;
}

/* ── Mobile Responsive ── */
@media (max-width: 767px) {
    .ggf-chatbot__bubble {
        bottom: 74px; /* above mobile bar */
        right: 16px;
        width: 52px;
        height: 52px;
    }
    .ggf-chatbot__window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ── Desktop: above back-to-top ── */
@media (min-width: 768px) {
    .ggf-chatbot__bubble {
        bottom: 24px;
        right: 24px;
    }
}

/* ── Print: hide ── */
@media print {
    .ggf-chatbot { display: none !important; }
}
