/* =====================================================================
   HOTMART ELITE MASTERMIND - CHATBOT ASISTENTE VIRTUAL IA (ELITEBOT)
   Diseño Premium Dark Mode & SaaS Aesthetic
   ===================================================================== */

/* Botón Flotante Disparador */
#elitebot-trigger {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#elitebot-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.7);
}

.elitebot-online-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid #0F172A;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
}

/* Ventana de Chat Flotante */
#elitebot-window {
    position: fixed;
    bottom: 148px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 530px;
    max-height: calc(100vh - 170px);
    background: #0F172A;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

#elitebot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header del Chat */
.elitebot-header {
    background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.elitebot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.elitebot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FF5E36, #FF2E00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(255, 94, 54, 0.4);
}

.elitebot-title-text h4 {
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 800;
    margin: 0;
}

.elitebot-title-text span {
    color: #34D399;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.elitebot-header-actions {
    display: flex;
    gap: 6px;
}

.elitebot-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #CBD5E1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.elitebot-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

/* Área de Mensajes */
.elitebot-messages-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

/* Sugerencias Rápidas */
.elitebot-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.elitebot-chip {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #C084FC;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    white-space: normal;
}

.elitebot-chip:hover {
    background: rgba(139, 92, 246, 0.35);
    color: #FFFFFF;
    border-color: #8B5CF6;
}

/* Burbujas de Chat */
.elitebot-msg {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    animation: fadeInMsg 0.25s ease-out forwards;
}

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

.elitebot-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #FF5E36, #FF2E00);
    color: #FFFFFF;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(255, 94, 54, 0.3);
}

.elitebot-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    border-bottom-left-radius: 2px;
}

.elitebot-msg.bot strong {
    color: #38BDF8;
}

/* Indicador de Escritura */
.elitebot-typing {
    display: none;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 2px;
    gap: 4px;
    align-items: center;
}

.elitebot-typing span {
    width: 6px;
    height: 6px;
    background: #8B5CF6;
    border-radius: 50%;
    animation: typingBlink 1.4s infinite fill-mode: both;
}

.elitebot-typing span:nth-child(2) { animation-delay: 0.2s; }
.elitebot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0% { opacity: 0.2; transform: scale(0.8); }
    20% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.2; transform: scale(0.8); }
}

/* Footer / Formulario del Chat */
.elitebot-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 14, 20, 0.9);
}

.elitebot-input-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

#elitebot-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    color: #FFFFFF;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

#elitebot-input:focus {
    border-color: #8B5CF6;
}

#elitebot-send {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s;
}

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

.elitebot-disclaimer {
    font-size: 10px;
    color: #64748B;
    text-align: center;
    margin-top: 6px;
}

/* 📱 RESPONSIVE MÓVIL PARA EL WIDGET DE ELITEBOT */
@media (max-width: 768px) {
    #elitebot-trigger {
        bottom: 16px !important;
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6) !important;
    }

    #elitebot-window {
        bottom: 74px !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        height: calc(100vh - 100px) !important;
        max-height: 520px !important;
        border-radius: 16px !important;
        z-index: 10001 !important;
    }

    .elitebot-messages-area {
        padding: 12px !important;
    }

    .elitebot-msg {
        max-width: 90% !important;
        font-size: 13px !important;
    }

    .elitebot-chip {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
}
