/* ===== ESTILOS DEL CHATBOT ===== */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: Arial, sans-serif;
}

/* Botón flotante del chatbot */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-size: 24px;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#chatbot-toggle.chatbot-minimized {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Ventana del chatbot */
#chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--chatbot-bg, white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chatbot-window.chatbot-hidden {
    display: none;
}

/* Header del chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chatbot-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--chatbot-messages-bg, #f8f9fa);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.chatbot-message.bot-message {
    align-self: flex-start;
}

.chatbot-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: #3498db;
    color: white;
}

.user-message .message-avatar {
    background: #2ecc71;
    color: white;
}

.message-content {
    background: var(--chatbot-message-bg, white);
    color: var(--chatbot-message-color, #333);
    padding: 12px 15px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    line-height: 1.4;
}

.bot-message .message-content {
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background: #3498db;
    color: white;
    border-bottom-right-radius: 5px;
}

/* Input y botón de enviar */
.chatbot-input-container {
    display: flex;
    padding: 15px;
    background: var(--chatbot-input-bg, white);
    border-top: 1px solid var(--chatbot-border-color, #e0e0e0);
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--chatbot-input-border, #ddd);
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: var(--chatbot-input-bg, white);
    color: var(--chatbot-input-color, #333);
}

#chatbot-input::placeholder {
    color: var(--chatbot-input-placeholder, #999);
}

#chatbot-input:focus {
    border-color: #3498db;
}

#chatbot-send {
    width: 45px;
    height: 45px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-send:hover {
    background: #2980b9;
}

/* Scrollbar personalizado */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--chatbot-scrollbar-track, #f1f1f1);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-scrollbar-thumb, #c1c1c1);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-scrollbar-thumb-hover, #a8a8a8);
}

/* Botón flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-float a {
    color: white;
    font-size: 34px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(37, 211, 102, 0.8);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

/* Opciones de contacto en mensaje */
.quick-contact-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.contact-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.whatsapp-option {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.phone-option {
    background: rgba(66, 133, 244, 0.1);
    color: #4285F4;
    border: 1px solid rgba(66, 133, 244, 0.3);
}

.email-option {
    background: rgba(234, 67, 53, 0.1);
    color: #EA4335;
    border: 1px solid rgba(234, 67, 53, 0.3);
}

.contact-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.whatsapp-option:hover {
    background: rgba(37, 211, 102, 0.2);
}

.phone-option:hover {
    background: rgba(66, 133, 244, 0.2);
}

.email-option:hover {
    background: rgba(234, 67, 53, 0.2);
}

.contact-option-btn i {
    font-size: 18px;
    min-width: 20px;
}

/* ===== PREGUNTAS RÁPIDAS EN CHATBOT ===== */
.chatbot-quick-questions {
    padding: 15px;
    background: var(--chatbot-questions-bg, #f8f9fa);
    border-top: 1px solid var(--chatbot-border-color, #e0e0e0);
}

.chatbot-quick-questions span {
    font-size: 12px;
    color: var(--chatbot-subtitle-color, #666);
    display: block;
    font-weight: 500;
}

/* Grid de preguntas rápidas */
.quick-questions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Botones de preguntas - TODOS CON EL MISMO TAMAÑO */
.quick-question {
    min-height: 44px;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 500;
    background: var(--chatbot-question-bg, white);
    border: 1px solid var(--chatbot-question-border, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
    color: var(--chatbot-question-color, #333);
}

.quick-question:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* BOTÓN DE WHATSAPP ESPECIAL ESTILO IMAGEN (MÁS CHICO) */
.whatsapp-chat-special {
    grid-column: span 2;
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important; 
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important; 
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px; 
    text-align: center;
    min-height: 36px; 
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3); 
    margin-top: 5px;
}

.whatsapp-chat-special i {
    font-size: 14px; 
}

.whatsapp-chat-special:hover {
    transform: translateY(-1px); 
    box-shadow: 0 3px 6px rgba(37, 211, 102, 0.4);
}

/* Versión ultra compacta (más chica aún) */
.whatsapp-chat-special.compact {
    padding: 6px 10px !important;
    font-size: 11px !important;
    min-height: 32px;
    gap: 4px;
}

.whatsapp-chat-special.compact i {
    font-size: 12px;
}
.whatsapp-chat-special:hover {
    background: linear-gradient(135deg, #128C7E, #25D366) !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-chat-special i {
    font-size: 18px; /* Icono un poco más grande */
}

.whatsapp-chat-special .es-lang,
.whatsapp-chat-special .en-lang {
    display: inline;
    font-weight: 600;
}

/* ===== MODO OSCURO PARA CHATBOT ===== */
body.dark-mode #chatbot-window,
body[data-theme="dark"] #chatbot-window {
    --chatbot-bg: #1e1e1e;
    --chatbot-messages-bg: #252525;
    --chatbot-message-bg: #2d2d2d;
    --chatbot-message-color: #e0e0e0;
    --chatbot-input-bg: #2d2d2d;
    --chatbot-input-color: #e0e0e0;
    --chatbot-input-border: #404040;
    --chatbot-input-placeholder: #888;
    --chatbot-border-color: #404040;
    --chatbot-questions-bg: #252525;
    --chatbot-question-bg: #2d2d2d;
    --chatbot-question-color: #e0e0e0;
    --chatbot-question-border: #404040;
    --chatbot-subtitle-color: #aaa;
    --chatbot-scrollbar-track: #2d2d2d;
    --chatbot-scrollbar-thumb: #555;
    --chatbot-scrollbar-thumb-hover: #666;
}

body.dark-mode .quick-question:hover,
body[data-theme="dark"] .quick-question:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

body.dark-mode .message-content,
body[data-theme="dark"] .message-content {
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Responsive para móviles */
@media (max-width: 480px) {
    #chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    #chatbot-window {
        width: calc(100vw - 40px);
        right: -10px;
        height: 70vh;
    }
    
    .quick-questions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .whatsapp-chat-special {
        grid-column: span 1;
    }
}

/* Para pantallas pequeñas del chatbot */
@media (max-height: 600px) {
    .quick-question {
        min-height: 40px;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .whatsapp-chat-special {
        min-height: 44px;
        padding: 12px 14px !important;
        font-size: 13px !important;
    }
}

/* Estilos para móvil */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 80px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .contact-option-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .whatsapp-chat-special {
        padding: 12px 14px !important;
        font-size: 13px !important;
    }
}

/* Ajustes responsivos adicionales */
@media (max-width: 400px) {
    .quick-questions-grid {
        gap: 8px;
    }
    
    .whatsapp-chat-special {
        padding: 11px 12px !important;
        font-size: 12px !important;
    }
}

/* Ajustes para texto muy largo en botones pequeños */
.quick-question {
    font-size: 12px;
}

@media (max-width: 380px) {
    .quick-question {
        font-size: 11px;
        padding: 10px 8px;
    }
    
    .whatsapp-chat-special {
        font-size: 11px !important;
        padding: 10px 8px !important;
    }
}

/* Variables CSS para modo claro (por defecto) */
:root {
    --chatbot-bg: white;
    --chatbot-messages-bg: #f8f9fa;
    --chatbot-message-bg: white;
    --chatbot-message-color: #333;
    --chatbot-input-bg: white;
    --chatbot-input-color: #333;
    --chatbot-input-border: #ddd;
    --chatbot-input-placeholder: #999;
    --chatbot-border-color: #e0e0e0;
    --chatbot-questions-bg: #f8f9fa;
    --chatbot-question-bg: white;
    --chatbot-question-color: #333;
    --chatbot-question-border: #e0e0e0;
    --chatbot-subtitle-color: #666;
    --chatbot-scrollbar-track: #f1f1f1;
    --chatbot-scrollbar-thumb: #c1c1c1;
    --chatbot-scrollbar-thumb-hover: #a8a8a8;
}