/* Chatbot widget styles */
#wpo-chatbot-wrapper {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 12px !important;
}

#wpo-chat-trigger {
    width: 58px !important;
    height: 58px !important;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6) !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22) !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
}

#wpo-chat-trigger:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28) !important;
}

#wpo-chat-window {
    display: flex !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 380px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    background: #ffffff !important;
    border-radius: 22px !important;
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.2) !important;
    overflow: hidden !important;
    transform: translateY(16px) !important;
    opacity: 0 !important;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease !important;
    flex-direction: column !important;
    position: absolute !important;
    bottom: 72px !important;
    right: 0 !important;
}

#wpo-chat-window.open {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.wpo-chat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 18px 18px 16px !important;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6) !important;
    color: #fff !important;
    flex-shrink: 0 !important;
}

.wpo-chat-header-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.wpo-chat-title {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
}

.wpo-chat-subtitle {
    margin: 0 !important;
    opacity: 0.9 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

.wpo-chat-close {
    background: rgba(255,255,255,0.18) !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.wpo-chat-body {
    padding: 16px !important;
    gap: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    background: #f8fafc !important;
    min-height: 240px !important;
    flex: 1 !important;
}

.wpo-msg {
    max-width: 100% !important;
    display: inline-block !important;
    padding: 14px 16px !important;
    border-radius: 18px !important;
    line-height: 1.6 !important;
    font-size: 14px !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.wpo-msg-user {
    align-self: flex-end !important;
    background: #4338ca !important;
    color: #fff !important;
    border-bottom-right-radius: 4px !important;
}

.wpo-msg-bot {
    align-self: flex-start !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    color: #111827 !important;
}

.wpo-typing {
    display: flex !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 12px 14px !important;
    max-width: 160px !important;
    border-radius: 16px !important;
    background: rgba(15, 23, 42, 0.06) !important;
}

.wpo-typing.active {
    visibility: visible !important;
    opacity: 1 !important;
}

.wpo-dot {
    width: 8px !important;
    height: 8px !important;
    background: #4f46e5 !important;
    border-radius: 50% !important;
    animation: wpo-bounce 0.8s infinite ease-in-out !important;
}

.wpo-dot:nth-child(2) {
    animation-delay: 0.12s !important;
}

.wpo-dot:nth-child(3) {
    animation-delay: 0.24s !important;
}

@keyframes wpo-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.wpo-chat-footer {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 16px !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
}

.wpo-chat-input {
    flex: 1 !important;
    min-height: 44px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 999px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    color: #111827 !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.wpo-chat-input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12) !important;
}

.wpo-chat-send {
    width: 52px !important;
    height: 52px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #4f46e5 !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    transition: background 0.2s ease !important;
}

.wpo-chat-send:hover {
    background: #4338ca !important;
}

@media (max-width: 640px) {
    #wpo-chatbot-wrapper {
        bottom: 14px !important;
        right: 14px !important;
        left: 14px !important;
    }

    #wpo-chat-window {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px !important;
        bottom: auto !important;
        top: 14px !important;
        max-height: calc(100vh - 28px) !important;
        right: 0 !important;
        left: 0 !important;
        margin: 0 14px !important;
    }
}
