#bk-chatbot-container {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#bk-chatbot-container.position-bottom-right {
    right: 20px;
}

#bk-chatbot-container.position-bottom-left {
    left: 20px;
}

#bk-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#bk-chatbot-button:hover {
    transform: scale(1.1);
}

#bk-chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

#bk-chatbot-window {
    display: none;
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    flex-direction: column;
    overflow: hidden;
}

.position-bottom-right #bk-chatbot-window {
    right: 0;
}

.position-bottom-left #bk-chatbot-window {
    left: 0;
}

#bk-chatbot-window.open {
    display: flex;
}

.bk-chatbot-header {
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bk-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.bk-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f8fa;
}

.bk-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bk-message.user {
    justify-content: flex-end;
}

.bk-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bk-message.bot .bk-message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e1e4e8;
}

.bk-message.user .bk-message-bubble {
    color: white;
}

.bk-action-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: transform 0.2s;
}

.bk-action-button:hover {
    transform: translateY(-2px);
}

.bk-chat-input-container {
    padding: 20px;
    border-top: 1px solid #e1e4e8;
    background: white;
}

.bk-chat-input-wrapper {
    display: flex;
    gap: 10px;
}

#bk-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e1e4e8;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#bk-chat-input:focus {
    border-color: #667eea;
}

#bk-send-button {
    padding: 12px 16px;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#bk-send-button:hover {
    transform: scale(1.1);
}

#bk-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bk-typing-indicator {
    display: none;
    padding: 20px;
    padding-top: 0;
}

.bk-typing-indicator.show {
    display: block;
}

.bk-typing-dots {
    display: inline-flex;
    gap: 4px;
}

.bk-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.bk-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.bk-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mobile styles - prevent full screen takeover */
@media (max-width: 768px) {
    #bk-chatbot-container {
        position: fixed !important;
        bottom: 10px !important;
        z-index: 9999 !important;
    }

    #bk-chatbot-container.position-bottom-right {
        right: 10px !important;
    }

    #bk-chatbot-container.position-bottom-left {
        left: 10px !important;
    }

    /* Chat window - floating design, not full screen */
    #bk-chatbot-window {
        position: absolute !important;
        width: min(calc(100vw - 20px), 340px) !important;
        height: min(70vh, 480px) !important;
        bottom: 60px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        max-height: calc(100vh - 100px) !important;
    }

    .position-bottom-right #bk-chatbot-window {
        right: -10px !important;
        left: auto !important;
    }

    .position-bottom-left #bk-chatbot-window {
        left: -10px !important;
        right: auto !important;
    }

    /* Smaller chat button */
    #bk-chatbot-button {
        width: 48px !important;
        height: 48px !important;
    }

    #bk-chatbot-button svg {
        width: 24px !important;
        height: 24px !important;
    }

    /* Compact header */
    .bk-chatbot-header {
        padding: 12px 15px !important;
        min-height: auto !important;
    }

    .bk-chatbot-header h3 {
        font-size: 15px !important;
        line-height: 1.2 !important;
    }

    /* Message area with proper scrolling */
    .bk-chat-messages {
        padding: 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }

    /* Compact input area */
    .bk-chat-input-container {
        padding: 12px !important;
    }

    #bk-chat-input {
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-height: 36px !important;
    }

    #bk-send-button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    #bk-send-button svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Message bubbles */
    .bk-message-bubble {
        padding: 8px 12px !important;
        font-size: 14px !important;
        max-width: 85% !important;
        line-height: 1.4 !important;
    }

    .bk-message {
        margin-bottom: 12px !important;
    }

    .bk-action-button {
        padding: 6px 12px !important;
        font-size: 13px !important;
        margin-top: 8px !important;
    }

    /* Typing indicator */
    .bk-typing-indicator {
        padding: 12px !important;
        padding-top: 0 !important;
    }

    .bk-typing-dot {
        width: 6px !important;
        height: 6px !important;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    #bk-chatbot-window {
        width: calc(100vw - 20px) !important;
        height: min(65vh, 420px) !important;
    }

    .bk-chatbot-header h3 {
        font-size: 14px !important;
    }

    .bk-message-bubble {
        font-size: 13px !important;
    }
}

/* Body scroll lock on mobile when chat is open */
@media (max-width: 768px) {
    body.bk-chat-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
}