/**
 * Joicy Nails VIP Academy - Estilos del Widget de Chatbot "Joicy Nails IA" (Diseño Minimalista)
 */

/* Botón Flotante con Avatar de Joicy */
.joicy-bot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #141416;
    border: 1px solid var(--gold-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, border-color .2s ease;
}

.joicy-bot-bubble:hover {
    transform: scale(1.06);
    border-color: var(--gold-light);
}

.joicy-bot-bubble img.bot-avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.joicy-bot-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0B0B0D;
}

/* Ventana Flotante del Chat */
.joicy-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 370px;
    height: 560px;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: all .2s ease;
}

.joicy-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header del Chat */
.chat-window-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--gold-primary);
    object-fit: cover;
}

.chat-header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-header-status {
    font-size: 0.72rem;
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-header-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-success);
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color .15s ease;
}
.chat-close-btn:hover {
    color: var(--text-primary);
}

/* Cuerpo de Mensajes */
.chat-messages-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-main);
}

.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 86%;
}

.chat-msg.assistant {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    object-fit: cover;
    flex-shrink: 0;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg.assistant .msg-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 3px;
}

.chat-msg.user .msg-bubble {
    background: var(--gold-gradient);
    color: #0B0B0D;
    font-weight: 500;
    border-top-right-radius: 3px;
}

/* Sugerencias Rápidas */
.chat-quick-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    white-space: nowrap;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    scrollbar-width: none;
}
.chat-quick-suggestions::-webkit-scrollbar {
    display: none;
}

.btn-suggestion {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-suggestion:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Input del Chat */
.chat-input-area {
    padding: 10px 14px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-field {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    outline: none;
}
.chat-input-field:focus {
    border-color: var(--gold-primary);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-primary);
    border: none;
    color: #0B0B0D;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: transform .15s ease;
}
.chat-send-btn:hover {
    transform: scale(1.06);
}

/* Indicador de Escribiendo */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-top-left-radius: 3px;
}
.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--gold-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 576px) {
    .joicy-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
