/* 
 * WLIQ Chatbot - Compatibility Patch
 * 
 * Ensures the modern UI works well with various WordPress themes
 */

/* Reset box-sizing for chatbot elements to prevent theme conflicts */
#chatbot-chatgpt *,
#chatbot-chatgpt *::before,
#chatbot-chatgpt *::after,
.chatbot-embedded-style *,
.chatbot-embedded-style *::before,
.chatbot-embedded-style *::after,
.chatbot-floating-style *,
.chatbot-floating-style *::before,
.chatbot-floating-style *::after {
    box-sizing: border-box !important;
}

/* Ensure chatbot has highest z-index */
#chatbot-chatgpt,
#chatgpt-open-btn {
    z-index: 999999 !important;
}

/* Prevent theme styles from affecting chatbot typography */
#chatbot-chatgpt,
#chatbot-chatgpt * {
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Ensure buttons maintain their styles */
#chatbot-chatgpt button,
#chatgpt-open-btn {
    text-decoration: none !important;
    font-weight: normal !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* Prevent theme link styles from affecting chatbot */
#chatbot-chatgpt a,
.chatbot-chatgpt-custom-button-class a {
    box-shadow: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* Fix potential input field conflicts */
#chatbot-chatgpt-message {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}

/* Ensure proper display for floating chatbot */
body #chatbot-chatgpt.chatbot-floating-style {
    position: fixed !important;
    margin: 0 !important;
}

/* Prevent overflow issues */
body {
    overflow-x: visible !important;
}

/* Fix potential conflicts with theme animations */
#chatbot-chatgpt * {
    animation-duration: inherit !important;
    animation-timing-function: inherit !important;
    animation-delay: inherit !important;
    animation-iteration-count: inherit !important;
    animation-direction: inherit !important;
    animation-fill-mode: inherit !important;
    animation-play-state: inherit !important;
}

/* Ensure proper icon display */
#chatbot-chatgpt-buttons-container button::after,
#chatgpt-open-btn::after,
.chatbot-collapse-btn::after {
    display: block !important;
    margin: 0 auto !important;
}

/* Fix potential list style conflicts */
#chatbot-chatgpt ul,
#chatbot-chatgpt ol,
#chatbot-chatgpt li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure messages don't inherit unwanted styles */
.chat-message,
.chatbot-user-text,
.chatbot-bot-text {
    float: none !important;
    clear: both !important;
    position: relative !important;
}

/* Prevent theme form styles from affecting chatbot */
#chatbot-chatgpt form,
#chatbot-chatgpt input,
#chatbot-chatgpt textarea,
#chatbot-chatgpt button {
    border-radius: inherit !important;
}

/* Specific fixes for common theme frameworks */

/* Bootstrap compatibility */
#chatbot-chatgpt .row,
#chatbot-chatgpt .col,
#chatbot-chatgpt [class^="col-"],
#chatbot-chatgpt [class*=" col-"] {
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

/* Elementor compatibility */
.elementor-widget #chatbot-chatgpt {
    width: auto !important;
    max-width: none !important;
}

/* Divi compatibility */
.et_pb_section #chatbot-chatgpt,
.et_pb_row #chatbot-chatgpt,
.et_pb_column #chatbot-chatgpt {
    width: auto !important;
    max-width: none !important;
}

/* WooCommerce compatibility */
.woocommerce #chatbot-chatgpt button {
    background-image: none !important;
    text-shadow: none !important;
}

/* Ensure chatbot maintains its own font */
#chatbot-chatgpt,
#chatbot-chatgpt * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

