#gf-chatbot-root {
    --gf-primary: #5d4037;
    --gf-primary-light: #8b6b61;
    --gf-accent: #ff8f00;
    --gf-bg: #fff8f0;
    --gf-white: #ffffff;
    --gf-text: #3e2723;
    --gf-text-light: #795548;
    --gf-border: #d7ccc8;
    --gf-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    --gf-radius: 16px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    z-index: 99999;
}

/* Floating button */
.gf-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gf-primary);
    border: none;
    cursor: pointer;
    box-shadow: var(--gf-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    z-index: 99999;
}

.gf-chat-btn:hover {
    transform: scale(1.1);
    background: var(--gf-primary-light);
}

.gf-chat-btn-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    filter: invert(1);
}

.gf-chat-btn .gf-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--gf-accent);
    border-radius: 50%;
    border: 2px solid var(--gf-white);
}

/* Chat panel */
.gf-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    height: 520px;
    background: var(--gf-white);
    border-radius: var(--gf-radius);
    box-shadow: var(--gf-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    animation: gf-slide-up 0.3s ease-out;
}

.gf-chat-panel.gf-open {
    display: flex;
}

@keyframes gf-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.gf-chat-header {
    background: var(--gf-primary);
    color: var(--gf-white);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.gf-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gf-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.gf-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gf-chat-header-info h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gf-white);
}

.gf-chat-header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
    color: var(--gf-white);
}

.gf-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--gf-white);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.gf-chat-close:hover {
    opacity: 1;
}

/* Messages area */
.gf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--gf-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gf-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    position: relative;
}

.gf-msg-bot {
    align-self: flex-start;
    background: var(--gf-white);
    color: var(--gf-text);
    border: 1px solid var(--gf-border);
    border-bottom-left-radius: 4px;
}

.gf-msg-user {
    align-self: flex-end;
    background: var(--gf-primary);
    color: var(--gf-white);
    border-bottom-right-radius: 4px;
}

.gf-msg a {
    color: var(--gf-accent);
    text-decoration: underline;
}

.gf-msg-user a {
    color: #ffe0b2;
}

.gf-msg strong {
    font-weight: 600;
}

/* Typing indicator */
.gf-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--gf-white);
    border-radius: 12px;
    border: 1px solid var(--gf-border);
    border-bottom-left-radius: 4px;
}

.gf-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gf-text-light);
    border-radius: 50%;
    animation: gf-bounce 1.4s infinite ease-in-out;
}

.gf-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.gf-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Input area */
.gf-chat-input {
    display: flex;
    padding: 12px;
    gap: 8px;
    border-top: 1px solid var(--gf-border);
    background: var(--gf-white);
    flex-shrink: 0;
}

.gf-chat-input textarea {
    flex: 1;
    border: 1px solid var(--gf-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 80px;
    color: var(--gf-text);
    background: var(--gf-bg);
    transition: border-color 0.2s;
}

.gf-chat-input textarea:focus {
    border-color: var(--gf-primary);
}

.gf-chat-input textarea::placeholder {
    color: var(--gf-text-light);
}

.gf-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gf-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    align-self: flex-end;
}

.gf-chat-send:hover {
    background: var(--gf-primary-light);
}

.gf-chat-send:disabled {
    background: var(--gf-border);
    cursor: not-allowed;
}

.gf-chat-send svg {
    width: 18px;
    height: 18px;
    fill: var(--gf-white);
}

/* Error message */
.gf-msg-error {
    align-self: center;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    font-size: 13px;
    text-align: center;
    border-radius: 8px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .gf-chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 8px;
        border-radius: 12px;
    }

    .gf-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}
