/* ============================================
   LEMON AI CHAT - FLOATING ASSISTANT
   ============================================ */

/* Floating Chat Button */
.lemon-chat-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #FDE047, #FACC15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(250, 204, 21, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    border: 3px solid rgba(255, 255, 255, 0.2);
    animation: pulse-lemon 2s ease-in-out infinite;
}

.lemon-chat-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 32px rgba(250, 204, 21, 0.6);
}

.lemon-chat-button img {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: bounce-lemon 3s ease-in-out infinite;
}

.lemon-chat-button.active {
    background: linear-gradient(135deg, #FACC15, #EAB308);
}

/* Notification Badge */
.lemon-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #EF4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border: 2px solid var(--bg-primary);
    animation: bounce 1s ease-in-out infinite;
}

/* Chat Container */
.lemon-chat-container {
    position: fixed;
    bottom: 110px;
    right: 2rem;
    width: 400px;
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    border: 1px solid var(--border-medium);
    animation: slideUp 0.3s ease-out;
}

.lemon-chat-container.active {
    display: flex;
}

/* Chat Header */
.lemon-chat-header {
    background: linear-gradient(135deg, #FDE047, #FACC15);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.lemon-chat-avatar {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lemon-chat-avatar img {
    width: 35px;
    height: 35px;
}

.lemon-chat-info {
    flex: 1;
}

.lemon-chat-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.25rem;
}

.lemon-chat-status {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lemon-chat-status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.lemon-chat-close {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.lemon-chat-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Chat Messages */
.lemon-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lemon-chat-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

.lemon-chat-message.user {
    flex-direction: row-reverse;
}

.lemon-message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #FDE047, #FACC15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lemon-message-avatar img {
    width: 24px;
    height: 24px;
}

.lemon-chat-message.user .lemon-message-avatar {
    background: var(--primary);
}

.lemon-message-content {
    max-width: 75%;
}

.lemon-message-bubble {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    border: 1px solid var(--border-medium);
}

.lemon-chat-message.user .lemon-message-bubble {
    background: linear-gradient(135deg, #FDE047, #FACC15);
    color: #000;
    border: none;
}

.lemon-message-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

/* Quick Actions */
.lemon-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.lemon-quick-action {
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lemon-quick-action:hover {
    background: rgba(250, 204, 21, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Transfer to Human Button */
.lemon-transfer-human {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.lemon-transfer-human:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Chat Input */
.lemon-chat-input-container {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-medium);
}

.lemon-chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.lemon-chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.lemon-chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.1);
}

.lemon-chat-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #FDE047, #FACC15);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.lemon-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
}

.lemon-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.lemon-typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
}

.lemon-typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-medium);
}

.lemon-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.lemon-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.lemon-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes pulse-lemon {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(250, 204, 21, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(250, 204, 21, 0.6);
    }
}

@keyframes bounce-lemon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Scrollbar Styling */
.lemon-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.lemon-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.lemon-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.lemon-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lemon-chat-button {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 60px;
        height: 60px;
    }
    
    .lemon-chat-button img {
        width: 38px;
        height: 38px;
    }
    
    .lemon-chat-container {
        bottom: 90px;
        right: 1.5rem;
        width: calc(100vw - 3rem);
        height: calc(100vh - 120px);
    }
}
