/* css/chatbot.css */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

#chatbot-trigger {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

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

#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
}

#chatbot-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

#chatbot-header {
    background: linear-gradient(135deg, var(--accent), #1e40af);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chatbot-header .title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatbot-header .close-btn {
    cursor: pointer;
    font-size: 20px;
}

#chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9fbfd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #333;
    border-bottom-left-radius: 2px;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 2px;
}

#chatbot-input-area {
    padding: 10px 15px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

#chatbot-input:focus {
    border-color: var(--accent);
}

#chatbot-send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#chatbot-send-btn:hover {
    background: #1e40af;
}

.whatsapp-action-btn {
    display: inline-block;
    background: #25d366;
    color: white !important;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #a0aec0;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

@media (max-width: 480px) {
    #chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    #chatbot-welcome {
        right: 75px;
        max-width: 220px;
    }
}

/* ==============================
   BURBUJA DE BIENVENIDA
   ============================== */
#chatbot-welcome {
    position: absolute;
    bottom: 8px;
    right: 75px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 16px 20px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

#chatbot-welcome.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

#chatbot-welcome .welcome-logo-img {
    width: 120px;
    height: auto;
    object-fit: contain;
}

#chatbot-welcome .welcome-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

#chatbot-welcome .welcome-text .name {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    font-family: var(--font-heading);
}

#chatbot-welcome .welcome-text .msg {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
}

#chatbot-welcome .welcome-close {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

#chatbot-welcome .welcome-close:hover {
    color: #334155;
}

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