/* ============================================================
   ECOGREEN BOT WIDGET
   ============================================================ */

.ecogreen-bot-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: var(--font-main, 'Inter', sans-serif);
}

/* Floating Toggle Button */
.ebot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-primary, #047857); /* Dark green */
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(4, 120, 87, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    outline: none;
}

.ebot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.6);
}

.ebot-toggle-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.ebot-toggle-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* Chat Window */
.ebot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--color-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    transform-origin: bottom right;
    border: 1px solid rgba(4, 120, 87, 0.1);
}

.ebot-window.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

/* Header */
.ebot-header {
    background: var(--color-primary, #047857);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 2;
}

.ebot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ebot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ebot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
}

.ebot-close:hover {
    opacity: 1;
}

/* Message Area */
.ebot-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

/* Scrollbar */
.ebot-messages::-webkit-scrollbar { width: 6px; }
.ebot-messages::-webkit-scrollbar-track { background: transparent; }
.ebot-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Message Bubbles */
.ebot-msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: ebotFadeIn 0.3s ease forwards;
}

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

.ebot-msg-bot {
    align-self: flex-start;
    background: white;
    color: var(--color-text, #1e293b);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.ebot-msg-user {
    align-self: flex-end;
    background: var(--color-primary, #047857);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Links inside bot messages */
.ebot-msg-bot a {
    color: var(--color-primary, #047857);
    font-weight: 600;
    text-decoration: underline;
}

/* Typing Indicator */
.ebot-typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    align-items: center;
    height: 36px;
}

.ebot-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ebotTyping 1.4s infinite ease-in-out;
}

.ebot-dot:nth-child(1) { animation-delay: -0.32s; }
.ebot-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Input Area */
.ebot-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#ebot-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#ebot-input:focus {
    border-color: var(--color-primary, #047857);
}

#ebot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary, #047857);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

#ebot-send:hover {
    background: #065f46;
}
#ebot-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ecogreen-bot-widget {
        bottom: 1rem;
        right: 1rem;
    }
    
    .ebot-window {
        position: fixed;
        bottom: 80px;
        right: 1rem;
        width: calc(100vw - 2rem);
        max-width: 350px;
        height: 450px;
        max-height: 70vh;
        border-radius: 16px;
        z-index: 10000;
        box-shadow: 0 5px 30px rgba(0,0,0,0.2);
    }
    
    .ebot-window.hidden {
        transform: scale(0.9) translateY(20px);
    }
}
