/* Visible Energy Live Chat Widget */

#ve-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 10000;
    transition: transform 0.2s, box-shadow 0.2s;
}

#ve-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

#ve-chat-bubble.ve-chat-bubble-active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

#ve-chat-bubble.ve-chat-bubble-active svg {
    display: none;
}

#ve-chat-bubble.ve-chat-bubble-active::after {
    content: '\00d7';
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

#ve-chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ve-chat-slide-up 0.25s ease-out;
}

@keyframes ve-chat-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ve-chat-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ve-chat-header-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ve-chat-header-status {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.ve-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.ve-chat-close:hover {
    opacity: 1;
}

/* Messages */
.ve-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.ve-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.ve-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.ve-chat-msg {
    display: flex;
    max-width: 85%;
}

.ve-chat-msg-user {
    align-self: flex-end;
}

.ve-chat-msg-bot {
    align-self: flex-start;
}

.ve-chat-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ve-chat-msg-user .ve-chat-msg-content {
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.ve-chat-msg-bot .ve-chat-msg-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.ve-chat-msg-bot .ve-chat-msg-content ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
}

.ve-chat-msg-bot .ve-chat-msg-content li {
    margin: 2px 0;
}

.ve-chat-msg-bot .ve-chat-msg-content code {
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12.5px;
}

.ve-chat-msg-bot .ve-chat-msg-content strong {
    font-weight: 600;
}

/* Streaming dots animation */
.ve-chat-streaming .ve-chat-dots {
    display: inline-block;
    animation: ve-dots 1.2s infinite;
    letter-spacing: 2px;
    font-weight: bold;
    color: #94a3b8;
}

@keyframes ve-dots {
    0%, 20% { opacity: 0.3; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.3; }
}

/* Input area */
.ve-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: white;
    flex-shrink: 0;
}

#ve-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.4;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 100px;
    transition: border-color 0.15s;
}

#ve-chat-input:focus {
    border-color: #2563eb;
}

#ve-chat-input::placeholder {
    color: #94a3b8;
}

#ve-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

#ve-chat-send:hover {
    background: #1d4ed8;
}

#ve-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #ve-chat-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    #ve-chat-bubble {
        bottom: 16px;
        right: 16px;
    }
}
