/* =================================================================================
// TaxiCOL Assistant - taxicol-chatbot.css
// Version: 14.0 (Final)
// ================================================================================= */

/* --- Contenedor Principal --- */
#taxicol-chatbot-container {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: none; 
}
#taxicol-chatbot-container.taxicol-hidden {
    opacity: 0;
}
#taxicol-chatbot-container.taxicol-visible {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* --- Posicionamiento con Variables CSS --- */
.pos-desktop-top-left { top: var(--taxicol-offset-desktop); left: var(--taxicol-offset-desktop); }
.pos-desktop-top-center { top: var(--taxicol-offset-desktop); left: 50%; transform: translateX(-50%); }
.pos-desktop-top-right { top: var(--taxicol-offset-desktop); right: var(--taxicol-offset-desktop); }
.pos-desktop-middle-left { top: 50%; left: var(--taxicol-offset-desktop); transform: translateY(-50%); }
.pos-desktop-middle-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pos-desktop-middle-right { top: 50%; right: var(--taxicol-offset-desktop); transform: translateY(-50%); }
.pos-desktop-bottom-left { bottom: var(--taxicol-offset-desktop); left: var(--taxicol-offset-desktop); }
.pos-desktop-bottom-center { bottom: var(--taxicol-offset-desktop); left: 50%; transform: translateX(-50%); }
.pos-desktop-bottom-right { bottom: var(--taxicol-offset-desktop); right: var(--taxicol-offset-desktop); }

/* --- Área de la Burbuja y Popup --- */
#taxicol-bubble-area {
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
}
#taxicol-bubble-area.flex-row {
    flex-direction: row;
}
#taxicol-bubble-area.flex-row-reverse {
    flex-direction: row-reverse;
}

/* --- Burbuja de Chat (Botón) --- */
#taxicol-chat-bubble {
    width: var(--taxicol-bubble-size-desktop);
    height: var(--taxicol-bubble-size-desktop);
    background: var(--taxicol-header-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, opacity 0.3s ease;
    flex-shrink: 0;
}
#taxicol-chat-bubble:hover { transform: scale(1.1); }
#taxicol-chat-bubble.taxicol-hidden { opacity: 0; transform: scale(0); pointer-events: none; }
#taxicol-chat-bubble img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#taxicol-chat-bubble svg { width: 55%; height: 55%; }

/* --- Popup (Mensaje al lado del botón) --- */
#taxicol-popup-message {
    padding: 12px 16px;
    background: white;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s;
}
#taxicol-popup-message.taxicol-hidden { opacity: 0; pointer-events: none; }
#taxicol-popup-message button { background: none; border: none; color: #888; font-size: 20px; cursor: pointer; opacity: 0.7; padding: 0; line-height: 1; }

/* --- Área de la Ventana de Chat --- */
#taxicol-chat-window-area {
    position: absolute;
    width: var(--taxicol-chat-width);
    pointer-events: none;
}
.pos-desktop-bottom-left #taxicol-chat-window-area, .pos-desktop-bottom-center #taxicol-chat-window-area, .pos-desktop-bottom-right #taxicol-chat-window-area { bottom: calc(100% + 15px); }
.pos-desktop-top-left #taxicol-chat-window-area, .pos-desktop-top-center #taxicol-chat-window-area, .pos-desktop-top-right #taxicol-chat-window-area { top: calc(100% + 15px); }
.pos-desktop-bottom-left #taxicol-chat-window-area, .pos-desktop-middle-left #taxicol-chat-window-area, .pos-desktop-top-left #taxicol-chat-window-area { left: 0; }
.pos-desktop-bottom-right #taxicol-chat-window-area, .pos-desktop-middle-right #taxicol-chat-window-area, .pos-desktop-top-right #taxicol-chat-window-area { right: 0; }
.pos-desktop-bottom-center #taxicol-chat-window-area, .pos-desktop-middle-center #taxicol-chat-window-area, .pos-desktop-top-center #taxicol-chat-window-area { left: 50%; transform: translateX(-50%); }

/* --- Ventana de Chat --- */
#taxicol-chat-window {
    width: 100%;
    max-height: var(--taxicol-chat-height);
    background: #ffffff;
    pointer-events: auto;
    border-radius: var(--taxicol-window-border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#taxicol-chat-window.taxicol-hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }

/* Estilos de header, body, footer... */
#taxicol-chat-header{background:var(--taxicol-header-color);color:#fff;padding:12px 20px;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}#taxicol-chat-header h3{font-size:16px;font-weight:600}#taxicol-chat-header button{background:0 0;border:0;color:#fff;font-size:28px;cursor:pointer;opacity:.8;padding:0 5px}#taxicol-chat-body{flex-grow:1;padding:20px;overflow-y:auto;background:#f5f5f5;display:flex;flex-direction:column;gap:12px;font-size:var(--taxicol-font-size)}
.chat-message{padding:10px 16px;border-radius:18px;max-width:85%;word-wrap:break-word}.bot-message{background:var(--taxicol-bot-msg-bg);color:var(--taxicol-bot-msg-text);align-self:flex-start;border-bottom-left-radius:4px}.user-message{background:var(--taxicol-user-msg-bg);color:var(--taxicol-user-msg-text);align-self:flex-end;border-bottom-right-radius:4px}#typing-indicator span{display:inline-block;width:8px;height:8px;border-radius:50%;background:#999;animation:taxicol-bounce 1.4s infinite ease-in-out both;margin:0 1px}#typing-indicator span:nth-child(1){animation-delay:-.32s}#typing-indicator span:nth-child(2){animation-delay:-.16s}@keyframes taxicol-bounce{0%,80%,100%{transform:scale(0)}40%{transform:scale(1)}}

/* --- MÓVIL: REGLAS PRINCIPALES --- */
@media (max-width: 768px) {
    body.taxicol-chat-open {
        overflow: hidden !important;
    }

    .pos-mobile-top-left { top: var(--taxicol-offset-mobile); left: var(--taxicol-offset-mobile); }
    .pos-mobile-top-center { top: var(--taxicol-offset-mobile); left: 50%; transform: translateX(-50%); }
    .pos-mobile-top-right { top: var(--taxicol-offset-mobile); right: var(--taxicol-offset-mobile); }
    .pos-mobile-middle-left { top: 50%; left: var(--taxicol-offset-mobile); transform: translateY(-50%); }
    .pos-mobile-middle-center{ top: 50%; left: 50%; transform: translate(-50%, -50%); }
    .pos-mobile-middle-right { top: 50%; right: var(--taxicol-offset-mobile); transform: translateY(-50%); }
    .pos-mobile-bottom-left { bottom: var(--taxicol-offset-mobile); left: var(--taxicol-offset-mobile); }
    .pos-mobile-bottom-center{ bottom: var(--taxicol-offset-mobile); left: 50%; transform: translateX(-50%); }
    .pos-mobile-bottom-right { bottom: var(--taxicol-offset-mobile); right: var(--taxicol-offset-mobile); }

    #taxicol-chat-bubble {
        width: var(--taxicol-bubble-size-mobile);
        height: var(--taxicol-bubble-size-mobile);
    }
    
    body.taxicol-chat-open #taxicol-chat-window-area {
        position: fixed !important;
        top: 0; left: 0;
        width: 100% !important; 
        height: 100% !important;
        pointer-events: auto;
    }
    body.taxicol-chat-open #taxicol-chat-window {
        width: 100% !important; height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        transform: translateY(0) !important;
        display: flex;
        flex-direction: column;
    }

    #taxicol-popup-message { display: none !important; }

    body.taxicol-chat-open #taxicol-chat-footer {
        order: 2;
    }
    body.taxicol-chat-open #taxicol-chat-credits {
        order: 3;
    }
}

/* --- ESTILOS DE CRÉDITOS Y FOOTER --- */
#taxicol-chat-footer {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
}
#taxicol-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: var(--taxicol-font-size);
    transition: border-color .2s;
    color: var(--taxicol-input-text-color);
}
#taxicol-chat-input:focus {
    outline: 0;
    border-color: var(--taxicol-header-color);
}
#taxicol-chat-send {
    background: var(--taxicol-header-color);
    color: #fff;
    border: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#taxicol-chat-send:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
#taxicol-chat-send svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
#taxicol-chat-credits {
    background: #fdfdfd;
    border-top: 1px solid #f0f0f0;
    padding: 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
}
#taxicol-model-display {
    font-family: monospace;
    font-weight: bold;
}

/* --- NUEVO: ESTILOS PARA BOTÓN DE MOSTRAR RESPUESTAS Y LAS RESPUESTAS RÁPIDAS --- */
#taxicol-show-replies {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}
#taxicol-show-replies:hover {
    border-color: var(--taxicol-header-color);
    color: var(--taxicol-header-color);
    transform: rotate(90deg);
}
#taxicol-show-replies.active {
    border-color: var(--taxicol-header-color);
    background-color: var(--taxicol-header-color);
    color: #fff;
    transform: rotate(45deg);
}
#taxicol-show-replies svg {
    width: 60%;
    height: 60%;
}
#taxicol-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0 5px 0;
    justify-content: flex-start;
}
.quick-reply-btn {
    background-color: #ffffff;
    border: 1px solid var(--taxicol-header-color, #2f3640);
    color: var(--taxicol-header-color, #2f3640);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}
.quick-reply-btn:hover {
    background-color: var(--taxicol-header-color, #2f3640);
    color: #ffffff;
}