/* --- OpenAI Chatbot Styles v1.3.1 (Diseño "Gemini" Súper Simple) --- */

/* 1. EL ENVOLTORIO PRINCIPAL (Anclado al fondo) */
#oac-plugin-wrapper {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99998 !important;
    max-height: 85vh;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

/* 2. Contenedor del Chat (El bloque central) */
#oac-main-container {
    width: 100%;
    max-width: 1000px;
    pointer-events: auto;
    display: flex;
    flex-direction: column; /* Orden normal: mensajes, burbujas, input */
    max-height: 85vh;
}

/* 3. Contenedor de Mensajes (La conversación) */
#oac-messages-container {
    width: 100%;
    position: relative;
    padding: 20px 20px 0 20px;
    box-sizing: border-box;
    order: 1; /* 1ro (arriba) */
    flex-grow: 1;
    overflow-y: auto !important; /* Scroll */
    min-height: 0;
    display: none; /* Oculto por defecto */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* 4. Botón Cerrar (Dentro del contenedor de mensajes) */
#oac-close-button {
    position: sticky;
    top: 5px;
    right: 5px;
    margin-left: auto;
    margin-bottom: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    line-height: 28px;
    text-align: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 50%;
    z-index: 11;
    transition: all 0.2s ease;
}
#oac-close-button:hover { color: #333; background-color: #f0f0f0; transform: scale(1.1); }


/* 5. Contenedor de Burbujas Disparadoras */
#oac-triggers-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    margin-bottom: 10px;
    order: 2;
    flex-shrink: 0;
}
.openai-chatbot-trigger-bubble {
    background-color: rgba(241, 241, 241, 0.95); backdrop-filter: blur(2px);
    color: #333; padding: 10px 15px; border-radius: 20px; margin: 5px;
    cursor: pointer; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease; z-index: 2; animation: gentleBob 3s infinite ease-in-out;
}
.openai-chatbot-trigger-bubble:hover { transform: scale(1.05); animation-play-state: paused; }
@keyframes gentleBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* 6. Área de Input (La barra inferior) */
#oac-input-container {
    width: 100%;
    background: #0e3d76;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    border-radius: 16px 16px 0 0; 
    padding: 15px 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    z-index: 10;
    order: 3;
    flex-shrink: 0;
    position: relative;
}

#openai-chatbot-input {
    flex-grow: 1; border: 1px solid #ddd; border-radius: 20px;
    padding: 18px; font-size: 16px; outline: none;
    transition: background-color 0.2s ease;
}
#openai-chatbot-input:disabled { background-color: #f5f5f5; cursor: not-allowed; }

#openai-chatbot-send {
    background-color: #ffac33; color: white; border: none; border-radius: 50%;
    width: 44px; height: 44px; margin-left: 10px; cursor: pointer;
    font-size: 20px; transition: all 0.2s ease; flex-shrink: 0;
}
#openai-chatbot-send:disabled { background-color: #999; opacity: 0.7; cursor: not-allowed; }
#openai-chatbot-send:not(:disabled):hover { background-color: #005a87; }

/* 7. Estilos de Mensajes (float) */
.chat-message { padding: 10px 15px; border-radius: 18px; margin-bottom: 10px; max-width: 85%; line-height: 1.4; font-size: 15px; word-wrap: break-word; clear: both; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.chat-message.bot { background-color: #f1f1f1; color: #333; border-bottom-left-radius: 4px; float: left; }
.chat-message.user { background-color: #0073aa; color: white; border-bottom-right-radius: 4px; float: right; }
#oac-messages-container::after { content: ""; display: table; clear: both; } /* Clearfix */
.typing-indicator { padding: 10px 15px; background-color: #f1f1f1; color: #333; border-bottom-left-radius: 4px; float: left; }
.typing-indicator span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: #aaa; margin: 0 1px; animation: typing-bounce 1s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.1s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.2s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }