/* Estilos del Chatbot */

/* Botón flotante */
#chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #8b4513), var(--secondary-color, #daa520));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(139, 69, 19, 0.4);
}

/* Ventana del chatbot */
#chatbot-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    border: 1px solid rgba(139, 69, 19, 0.1);
}

#chatbot-box.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

/* Header del chatbot */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color, #8b4513), var(--secondary-color, #daa520));
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área de mensajes */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

/* Preguntas preestablecidas */
.quick-questions {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #eee;
}

.quick-questions h4 {
    margin: 0 0 10px 0;
    color: var(--primary-color, #8b4513);
    font-size: 14px;
    font-weight: 600;
}

.question-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-btn {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(218, 165, 32, 0.1));
    border: 1px solid rgba(139, 69, 19, 0.2);
    color: var(--primary-color, #8b4513);
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.2s ease;
}

.question-btn:hover {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(218, 165, 32, 0.2));
    transform: translateY(-1px);
}

.guide-message {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color, #8b4513);
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #555;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.bot {
    align-items: flex-start;
}

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

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color, #8b4513), var(--secondary-color, #daa520));
    color: white;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border: 1px solid #eee;
}

.message-time {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

/* Área de input */
.chatbot-input-area {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chatbot-input:focus {
    border-color: var(--primary-color, #8b4513);
}

#chatbot-send {
    background: linear-gradient(135deg, var(--primary-color, #8b4513), var(--secondary-color, #daa520));
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#chatbot-send:hover {
    transform: scale(1.05);
}

/* Scrollbar personalizado */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    #chatbot-box {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 90px;
        height: 400px;
    }
    
    #chatbot-toggle {
        bottom: 20px;
        right: 20px;
    }
}

/* Estado de carga */
.typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.typing-indicator .message-content {
    background: white;
    border: 1px solid #eee;
    padding: 12px 16px;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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