/* ===================================================
   RMPOWERTECH - CHATBOT WIDGET INTERACTIVO V1.0
   SaaS Modern Glassmorphism & Fast Direct WhatsApp
   =================================================== */

:root {
    --rm-chat-primary: #7c3aed;
    --rm-chat-secondary: #0ea5e9;
    --rm-chat-gradient: linear-gradient(135deg, #7c3aed 0%, #0ea5e9 100%);
    --rm-chat-bg: #ffffff;
    --rm-chat-dark: #0f172a;
    --rm-chat-gray: #f8fafc;
    --rm-chat-border: #e2e8f0;
}

/* Floating Trigger Button */
.rm-chatbot-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-chatbot-badge-callout {
    background: #0f172a;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    animation: rm-float 3s ease-in-out infinite;
}

.rm-badge-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
    animation: rm-pulse 1.8s infinite;
}

.rm-chatbot-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--rm-chat-gradient);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.45), 0 0 20px rgba(14, 165, 233, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.rm-chatbot-btn:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 14px 36px rgba(124, 58, 237, 0.6);
}

.rm-chatbot-btn .avatar-icon {
    width: 34px;
    height: 34px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

.rm-chatbot-btn .close-icon {
    display: none;
    width: 26px;
    height: 26px;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.rm-chatbot-launcher.active .avatar-icon {
    display: none;
}

.rm-chatbot-launcher.active .close-icon {
    display: block;
}

/* Chatbot Popup Window */
.rm-chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 35px rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(226, 232, 240, 0.85);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.rm-chat-header {
    background: var(--rm-chat-gradient);
    padding: 18px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.rm-chat-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-chat-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    position: relative;
}

.rm-chat-online-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.rm-chat-header-text h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.rm-chat-header-text p {
    margin: 2px 0 0 0;
    font-size: 0.76rem;
    color: #e0e7ff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rm-chat-close-btn {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.rm-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body / Messages */
.rm-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rm-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.rm-msg-bot {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.rm-msg-user {
    background: var(--rm-chat-gradient);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

/* Quick Action Chips */
.rm-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.rm-chip-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.rm-chip-btn:hover {
    background: #f1f5f9;
    border-color: #7c3aed;
    color: #7c3aed;
    transform: translateX(4px);
}

.rm-chip-btn span.arrow {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Chat Footer / Input */
.rm-chat-footer {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.rm-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border-radius: 25px;
    padding: 6px 8px 6px 16px;
    border: 1.5px solid transparent;
    transition: all 0.2s;
}

.rm-input-wrap:focus-within {
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.rm-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.88rem;
    color: #1e293b;
}

.rm-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--rm-chat-gradient);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.rm-send-btn:hover {
    transform: scale(1.08);
}

/* Scroll To Top Button Alongside */
.rm-scroll-top-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.rm-scroll-top-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    transform: translateY(-3px);
}

/* Animations */
@keyframes rm-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes rm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .rm-chatbot-launcher {
        bottom: 74px; /* Encima de la mobile-bottom-nav */
        right: 16px;
    }
    .rm-chatbot-badge-callout {
        display: none; /* Ocultar texto largo en mobile */
    }
    .rm-chatbot-btn {
        width: 54px;
        height: 54px;
    }
    .rm-chatbot-window {
        bottom: 135px;
        right: 12px;
        width: calc(100vw - 24px);
        height: 470px;
    }
}
