/* Pearly Floating Button hover */
#pearlyFloatingBtn:hover {
    transform: scale(1.07);
    opacity: 0.95;
}

/* Pearly bounce/alert animation on new message */
#pearlyFloatingBtn.pearly-alert {
    animation: pearlyBounce 0.4s ease-in-out 3;
}

@keyframes pearlyBounce {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(-5px); }
    60%  { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

/* Panel */
#pearlyPanel {
    position: fixed;
    bottom: 110px;
    right: 20px;
    width: 300px;
    height: 380px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

#pearlyPanel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
#pearlyPanelHeader {
    padding: 12px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 16px;
}

/* Messages area */
#pearlyChatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Info message (not logged in) */
.pearlyInfoMessage {
    font-size: 14px;
    color: #777;
    text-align: center;
}

/* User message bubble */
.pearlyUserMessage {
    background: #e5e5ff;
    color: #333;
    padding: 8px 12px;
    border-radius: 14px 14px 4px 14px;
    max-width: 85%;
    font-size: 14px;
    margin-left: auto; /* push to right */
}

/* Pearly (bot) message bubble */
.pearlyBotMessage {
    background: #fff7da;
    color: #333;
    padding: 8px 12px;
    border-radius: 14px 14px 14px 4px;
    max-width: 85%;
    font-size: 14px;
    margin-right: auto; /* push to left */
}

/* Typing indicator */
#pearlyTyping {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 8px;
    font-size: 12px;
    color: #777;
}

.pearlyTypingHidden {
    display: none !important;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    animation: typingBlink 1s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBlink {
    0%, 60%, 100% { opacity: 0.2; }
    30% { opacity: 1; }
}

/* Input area */
#pearlyChatInputArea {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

#pearlyChatInput {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 14px;
}

#pearlySendBtn {
    margin-left: 8px;
    padding: 8px 12px;
    background: #daa520;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s;
}

#pearlySendBtn:hover {
    opacity: 0.85;
}
