/* Chatbot Styles - Responsive Design */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Burbuja del chat (estado minimizado) */
.chatbot-bubble {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 200, 81, 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 200, 81, 0.4);
}

@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(0, 200, 81, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(0, 200, 81, 0.5); }
    100% { box-shadow: 0 4px 20px rgba(0, 200, 81, 0.3); }
}

/* Ventana del chat */
.chatbot-window {
    width: 450px; /* Aumentado de 380px a 450px para desktop */
    height: 550px; /* También puedes aumentar la altura si quieres */
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #e8f5e8;
    position: relative;
    bottom: 0;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px 18px 0 0;
}

.chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.3s ease;
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fffe;
    scrollbar-width: thin;
    scrollbar-color: #00c851 #f0f0f0;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #00c851;
    border-radius: 10px;
}

.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    color: white;
    border-bottom-left-radius: 6px;
    margin-right: auto;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #2c2c2c;
    color: white;
    border-bottom-right-radius: 6px;
    margin-left: auto;
}

/* Loading animation */
.loading-message {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.loading-message .message-content {
    background: #e8f5e8;
    color: #007e33;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: #00c851;
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Área de entrada */
.chatbot-input-area {
    display: flex;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e8f5e8;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e8f5e8;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    background: #f8fffe;
}

.chatbot-input:focus {
    border-color: #00c851;
    background: white;
}

.chatbot-input:hover {
    border-color: #66d9a6;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #00c851 0%, #007e33 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 200, 81, 0.3);
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 200, 81, 0.4);
}

.chatbot-send:active {
    transform: scale(0.95);
}

/* Footer */
.chatbot-footer {
    background: #f8fffe;
    padding: 8px 20px;
    text-align: center;
    border-top: 1px solid #e8f5e8;
    color: #666;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 768px) {
    #chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-window {
        width: 320px;
        height: 450px;
    }
    
    .chatbot-bubble {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-header {
        padding: 12px 16px;
    }
    
    .chatbot-title {
        font-size: 15px;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .chatbot-input-area {
        padding: 12px 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    #chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-window {
        width: 100%;
        height: 70vh;
        max-height: 500px;
        bottom: 70px;
        position: fixed;
        border-radius: 15px;
    }
    
    .chatbot-bubble {
        width: 50px;
        height: 50px;
        margin-left: auto;
    }
    
    .chatbot-header {
        padding: 10px 15px;
        border-radius: 13px 13px 0 0;
    }
    
    .chatbot-title {
        font-size: 14px;
    }
    
    .chatbot-messages {
        padding: 12px;
    }
    
    .message-content {
        max-width: 90%;
        font-size: 13px;
    }
    
    .chatbot-input-area {
        padding: 10px 15px;
    }
    
    .chatbot-input {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .chatbot-send {
        width: 40px;
        height: 40px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 350px) {
    .chatbot-window {
        height: 80vh;
        bottom: 60px;
    }
    
    .chatbot-bubble {
        width: 45px;
        height: 45px;
    }
    
    .message-content {
        max-width: 95%;
        font-size: 12px;
    }
}

/* Accesibilidad */
.chatbot-minimize:focus,
.chatbot-send:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Pantallas grandes - Desktop */
@media (min-width: 1024px) {
    .chatbot-window {
        width: 480px; /* Ancho extra para pantallas grandes */
        height: 580px; /* Altura extra si lo deseas */
    }
}

/* Pantallas muy grandes - Monitores grandes */
@media (min-width: 1440px) {
    .chatbot-window {
        width: 520px; /* Aún más ancho para monitores grandes */
        height: 600px;
    }
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

