/* Estilos personalizados para widgets de chatbot dinámicos */

/* Estilos generales para widgets de chat - JotForm */
.jotform-chat-widget,
[id*="jotform-agent"],
[class*="jotform-agent"],
.jotform-chatbot-active .jotform-chat-widget,
.jotform-chatbot-active [id*="jotform-agent"],
.jotform-chatbot-active [class*="jotform-agent"] {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    max-width: 400px !important;
    max-height: 600px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

/* Estilos para Tawk.to */
[id*="tawk"],
[class*="tawk"],
.tawk-widget {
    position: fixed !important;
    z-index: 9999 !important;
}

/* Estilos para Intercom */
[id*="intercom"],
[class*="intercom"],
.intercom-messenger-frame,
.intercom-launcher {
    z-index: 9999 !important;
}

/* Estilos para Crisp */
[id*="crisp"],
[class*="crisp"],
.crisp-client,
.crisp-launcher {
    z-index: 9999 !important;
}

/* Estilos para LiveChat */
[id*="livechat"],
[class*="livechat"],
.livechat-widget,
#livechat-widget {
    z-index: 9999 !important;
}

/* Estilos para Zendesk */
[id*="zendesk"],
[class*="zendesk"],
.zEWidget-launcher,
iframe[id*="webWidget"] {
    z-index: 9999 !important;
}

/* Estilos para Freshchat */
[id*="freshchat"],
[class*="freshchat"],
.fc-widget,
#fc_widget {
    z-index: 9999 !important;
}

/* Para modales abiertos, reducir z-index temporalmente */
.modal-open .jotform-chat-widget,
.modal-open [id*="jotform-agent"],
.modal-open [class*="jotform-agent"],
.modal-open [id*="tawk"],
.modal-open [class*="tawk"],
.modal-open .tawk-widget,
.modal-open [id*="intercom"],
.modal-open [class*="intercom"],
.modal-open .intercom-messenger-frame,
.modal-open .intercom-launcher,
.modal-open [id*="crisp"],
.modal-open [class*="crisp"],
.modal-open .crisp-client,
.modal-open .crisp-launcher,
.modal-open [id*="livechat"],
.modal-open [class*="livechat"],
.modal-open .livechat-widget,
.modal-open #livechat-widget,
.modal-open [id*="zendesk"],
.modal-open [class*="zendesk"],
.modal-open .zEWidget-launcher,
.modal-open iframe[id*="webWidget"],
.modal-open [id*="freshchat"],
.modal-open [class*="freshchat"],
.modal-open .fc-widget,
.modal-open #fc_widget {
    z-index: 1040 !important;
}

/* Estilos para el botón flotante del chat */
.jotform-chat-bubble,
[id*="jotform-bubble"],
[class*="jotform-bubble"],
[class*="tawk-bubble"],
[class*="intercom-launcher"],
[class*="crisp-launcher"],
[class*="livechat-launcher"],
[class*="zendesk-launcher"],
[class*="freshchat-launcher"] {
    transition: transform 0.2s ease !important;
}

.jotform-chat-bubble:hover,
[id*="jotform-bubble"]:hover,
[class*="jotform-bubble"]:hover,
[class*="tawk-bubble"]:hover,
[class*="intercom-launcher"]:hover,
[class*="crisp-launcher"]:hover,
[class*="livechat-launcher"]:hover,
[class*="zendesk-launcher"]:hover,
[class*="freshchat-launcher"]:hover {
    transform: scale(1.05) !important;
}

/* Ajustes para el panel lateral */
.panel-sidebar + .panel-content .jotform-chat-widget,
.panel-sidebar + .panel-content [id*="jotform-agent"],
.panel-sidebar + .panel-content [class*="jotform-agent"],
.panel-sidebar + .panel-content [id*="tawk"],
.panel-sidebar + .panel-content [class*="tawk"],
.panel-sidebar + .panel-content .tawk-widget,
.panel-sidebar + .panel-content [id*="intercom"],
.panel-sidebar + .panel-content [class*="intercom"],
.panel-sidebar + .panel-content .intercom-messenger-frame,
.panel-sidebar + .panel-content .intercom-launcher,
.panel-sidebar + .panel-content [id*="crisp"],
.panel-sidebar + .panel-content [class*="crisp"],
.panel-sidebar + .panel-content .crisp-client,
.panel-sidebar + .panel-content .crisp-launcher,
.panel-sidebar + .panel-content [id*="livechat"],
.panel-sidebar + .panel-content [class*="livechat"],
.panel-sidebar + .panel-content .livechat-widget,
.panel-sidebar + .panel-content #livechat-widget,
.panel-sidebar + .panel-content [id*="zendesk"],
.panel-sidebar + .panel-content [class*="zendesk"],
.panel-sidebar + .panel-content .zEWidget-launcher,
.panel-sidebar + .panel-content iframe[id*="webWidget"],
.panel-sidebar + .panel-content [id*="freshchat"],
.panel-sidebar + .panel-content [class*="freshchat"],
.panel-sidebar + .panel-content .fc-widget,
.panel-sidebar + .panel-content #fc_widget {
    right: 40px !important;
}

/* Estilos para iframes dentro del widget */
.jotform-chat-widget iframe,
[id*="jotform-agent"] iframe,
[class*="jotform-agent"] iframe {
    border: none !important;
    border-radius: 12px !important;
}

/* Estados de carga */
.jotform-loading,
.chatbot-loading {
    opacity: 0.7 !important;
}

.jotform-loaded,
.chatbot-loaded {
    opacity: 1 !important;
}

/* Posicionamiento dinámico */
.chatbot-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

.chatbot-bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

.chatbot-top-right {
    top: 20px !important;
    right: 20px !important;
}

.chatbot-top-left {
    top: 20px !important;
    left: 20px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .jotform-chat-widget,
    [id*="jotform-agent"],
    [class*="jotform-agent"],
    [id*="tawk"],
    [class*="tawk"],
    .tawk-widget,
    [id*="intercom"],
    [class*="intercom"],
    .intercom-messenger-frame,
    .intercom-launcher,
    [id*="crisp"],
    [class*="crisp"],
    .crisp-client,
    .crisp-launcher,
    [id*="livechat"],
    [class*="livechat"],
    .livechat-widget,
    #livechat-widget,
    [id*="zendesk"],
    [class*="zendesk"],
    .zEWidget-launcher,
    iframe[id*="webWidget"],
    [id*="freshchat"],
    [class*="freshchat"],
    .fc-widget,
    #fc_widget {
        max-width: 90% !important;
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .chatbot-bottom-left,
    .chatbot-top-left {
        left: 10px !important;
    }
    
    .chatbot-bottom-right,
    .chatbot-top-right {
        right: 10px !important;
    }
    
    .chatbot-top-left,
    .chatbot-top-right {
        top: 10px !important;
    }
}

/* Personalización de widgets por proveedor */
body.chatbot-provider-jotform {
    /* Clases específicas para JotForm si es necesario */
}

body.chatbot-provider-tawk {
    /* Clases específicas para Tawk.to si es necesario */
}

body.chatbot-provider-intercom {
    /* Clases específicas para Intercom si es necesario */
}

body.chatbot-provider-crisp {
    /* Clases específicas para Crisp si es necesario */
}

body.chatbot-provider-livechat {
    /* Clases específicas para LiveChat si es necesario */
}

body.chatbot-provider-zendesk {
    /* Clases específicas para Zendesk si es necesario */
}

body.chatbot-provider-freshchat {
    /* Clases específicas para Freshchat si es necesario */
} 