/* VSO Chatbot Widget Styles */

#vso-chatbot-container {
    --vso-primary: #2563eb;
    --vso-primary-dark: #1d4ed8;
    --vso-bg: #ffffff;
    --vso-bg-light: #f3f4f6;
    --vso-text: #1f2937;
    --vso-text-light: #6b7280;
    --vso-border: #e5e7eb;
    --vso-radius: 12px;
    --vso-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    z-index: 999999;
}

/* Toggle Button */
#vso-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--vso-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--vso-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    z-index: 999999;
}

#vso-chat-toggle:hover {
    background: var(--vso-primary-dark);
    transform: scale(1.05);
}

/* Chat Panel */
#vso-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-height: 560px;
    background: var(--vso-bg);
    border-radius: var(--vso-radius);
    box-shadow: var(--vso-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    border: 1px solid var(--vso-border);
}

/* Header */
#vso-chat-header {
    background: var(--vso-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#vso-chat-title {
    font-weight: 600;
    font-size: 15px;
}

#vso-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#vso-chat-close:hover {
    opacity: 1;
}

/* Messages */
#vso-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 300px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vso-message {
    display: flex;
    max-width: 85%;
}

.vso-message.vso-user {
    align-self: flex-end;
}

.vso-message.vso-bot {
    align-self: flex-start;
}

.vso-message-content {
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vso-user .vso-message-content {
    background: var(--vso-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.vso-bot .vso-message-content {
    background: var(--vso-bg-light);
    color: var(--vso-text);
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.vso-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px !important;
    align-items: center;
}

.vso-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vso-text-light);
    animation: vso-bounce 1.4s infinite ease-in-out both;
}

.vso-typing span:nth-child(1) { animation-delay: -0.32s; }
.vso-typing span:nth-child(2) { animation-delay: -0.16s; }
.vso-typing span:nth-child(3) { animation-delay: 0s; }

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

/* Input Area */
#vso-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--vso-border);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#vso-chat-input {
    flex: 1;
    border: 1px solid var(--vso-border);
    border-radius: var(--vso-radius);
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

#vso-chat-input:focus {
    border-color: var(--vso-primary);
}

#vso-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--vso-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

#vso-chat-send:hover {
    background: var(--vso-primary-dark);
}

/* Footer */
#vso-chat-footer {
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--vso-text-light);
    border-top: 1px solid var(--vso-border);
    flex-shrink: 0;
}

#vso-chat-footer a {
    color: var(--vso-primary);
    text-decoration: none;
    font-weight: 600;
}

#vso-chat-footer a:hover {
    text-decoration: underline;
}

/* Hidden state */
.vso-hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #vso-chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        max-height: none;
        bottom: 8px;
        right: 8px;
        border-radius: 16px;
    }

    #vso-chat-messages {
        max-height: none;
        min-height: 0;
    }

    #vso-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}
