/* Lush AI Chatbot - Compact Premium Design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --lush-green-500: #10b981;
    --lush-green-600: #059669;
    --lush-green-700: #047857;
    --lush-gray-50: #f9fafb;
    --lush-gray-100: #f3f4f6;
    --lush-gray-200: #e5e7eb;
    --lush-gray-300: #d1d5db;
    --lush-gray-400: #9ca3af;
    --lush-gray-500: #6b7280;
    --lush-gray-600: #4b5563;
    --lush-gray-700: #374151;
    --lush-gray-800: #1f2937;
    --lush-gray-900: #111827;
}

/* Container */
#lush-ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Toggle Wrapper - Contains label and button */
#lush-ai-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Label - Text next to button */
#lush-ai-toggle-label {
    background: white;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: labelPulse 3s ease-in-out infinite, slideIn 0.5s ease-out;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#lush-ai-toggle-label:hover {
    transform: scale(1.02);
}

#lush-ai-toggle-label span {
    font-size: 14px;
    font-weight: 600;
    color: var(--lush-green-700);
    white-space: nowrap;
}

#lush-ai-toggle-label small {
    font-size: 11px;
    color: var(--lush-gray-500);
    white-space: nowrap;
}

@keyframes labelPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 4px 25px rgba(5, 150, 105, 0.3); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Toggle Button - LARGER and More Noticeable */
#lush-ai-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lush-green-600) 0%, var(--lush-green-700) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(5, 150, 105, 0.5);
    transition: all 0.3s ease;
    position: relative;
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(5, 150, 105, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 35px rgba(5, 150, 105, 0.7), 0 0 0 8px rgba(5, 150, 105, 0.15);
        transform: scale(1.05);
    }
}

#lush-ai-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(5, 150, 105, 0.6);
    animation: none;
}

/* Notification Badge */
#lush-ai-toggle .notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

#lush-ai-toggle.active .notification-badge {
    display: none;
}

#lush-ai-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

#lush-ai-toggle.active .chat-icon { display: none; }
#lush-ai-toggle.active .close-icon { display: block !important; }

/* Hide label when chat is open */
#lush-ai-toggle.active ~ #lush-ai-toggle-label,
#lush-ai-toggle-wrapper:has(#lush-ai-toggle.active) #lush-ai-toggle-label {
    display: none;
}

/* Chat Window - Compact Size */
#lush-ai-chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-origin: bottom right;
}

#lush-ai-chat-window.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
}

/* Header - Compact */
.lush-ai-header {
    background: linear-gradient(135deg, var(--lush-green-700) 0%, var(--lush-green-600) 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.lush-ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.lush-ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.lush-ai-avatar .fallback-avatar {
    color: white;
}

.lush-ai-title h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.lush-ai-title .status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lush-ai-title .status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
}

#lush-ai-minimize {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

#lush-ai-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

#lush-ai-minimize svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Messages Area */
#lush-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--lush-gray-50);
}

#lush-ai-messages::-webkit-scrollbar {
    width: 4px;
}

#lush-ai-messages::-webkit-scrollbar-thumb {
    background: var(--lush-gray-300);
    border-radius: 2px;
}

/* Message Bubbles */
.lush-ai-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msgIn 0.3s ease;
}

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

.lush-ai-message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.lush-ai-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.lush-ai-message.bot .lush-ai-message-avatar {
    background: linear-gradient(135deg, var(--lush-green-600), var(--lush-green-700));
}

.lush-ai-message.user .lush-ai-message-avatar {
    background: var(--lush-gray-500);
}

.lush-ai-message-content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.lush-ai-message.bot .lush-ai-message-content {
    background: white;
    color: var(--lush-gray-700);
    border: 1px solid var(--lush-gray-200);
    border-bottom-left-radius: 4px;
}

.lush-ai-message.user .lush-ai-message-content {
    background: linear-gradient(135deg, var(--lush-green-600), var(--lush-green-700));
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.lush-ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--lush-gray-200);
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.lush-ai-typing span {
    width: 6px;
    height: 6px;
    background: var(--lush-green-500);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.lush-ai-typing span:nth-child(1) { animation-delay: 0s; }
.lush-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.lush-ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input Area */
.lush-ai-input-container {
    padding: 12px 16px 16px;
    background: white;
    border-top: 1px solid var(--lush-gray-100);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#lush-ai-input {
    flex: 1;
    border: 1px solid var(--lush-gray-200);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
    transition: border-color 0.2s;
    background: var(--lush-gray-50);
}

#lush-ai-input:focus {
    border-color: var(--lush-green-500);
    background: white;
}

#lush-ai-input::placeholder {
    color: var(--lush-gray-400);
}

#lush-ai-send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--lush-green-600), var(--lush-green-700));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#lush-ai-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

#lush-ai-send:disabled {
    background: var(--lush-gray-200);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#lush-ai-send svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Footer */
.lush-ai-footer {
    padding: 8px 16px;
    text-align: center;
    font-size: 10px;
    color: var(--lush-gray-400);
    background: var(--lush-gray-50);
    border-top: 1px solid var(--lush-gray-100);
}

.lush-ai-footer span {
    color: var(--lush-green-600);
    font-weight: 500;
}

/* Quick Replies */
.lush-ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.lush-ai-quick-reply {
    background: white;
    border: 1px solid var(--lush-green-500);
    color: var(--lush-green-600);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.lush-ai-quick-reply:hover {
    background: var(--lush-green-500);
    color: white;
}

/* Error */
.lush-ai-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #fecaca;
}

/* Mobile */
@media (max-width: 480px) {
    #lush-ai-chatbot-container {
        bottom: 12px;
        right: 12px;
    }

    #lush-ai-toggle-wrapper {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 8px;
    }

    #lush-ai-toggle-label {
        padding: 8px 12px;
    }

    #lush-ai-toggle-label span {
        font-size: 12px;
    }

    #lush-ai-toggle-label small {
        font-size: 10px;
    }

    #lush-ai-toggle {
        width: 60px;
        height: 60px;
    }

    #lush-ai-toggle svg {
        width: 24px;
        height: 24px;
    }

    #lush-ai-toggle .notification-badge {
        width: 14px;
        height: 14px;
    }

    #lush-ai-chat-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        bottom: 80px;
    }
}

/* Links */
.lush-ai-message-content a {
    color: inherit;
    text-decoration: underline;
}

.lush-ai-message.bot .lush-ai-message-content a {
    color: var(--lush-green-600);
}
