/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--kvc-body-font, 'Roboto', sans-serif);
}

/* Chat Button */
.chatbot-button {
    position: relative;
    width: 60px;
    height: 60px;
    background: var(--kvc-primary-color, #2B54A2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--kvc-shadow-lg, 0 18px 40px rgba(16, 24, 40, 0.16));
    transition: all 0.3s ease;
    border: none;
    color: white;
}

.chatbot-button:hover {
    background: var(--kvc-primary-hover, #1d3f84);
    transform: scale(1.05);
    box-shadow: 0 20px 48px rgba(16, 24, 40, 0.2);
}

.chatbot-icon {
    width: 24px;
    height: 24px;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--kvc-accent-color, #F58220);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid white;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: var(--kvc-radius-lg, 16px);
    box-shadow: var(--kvc-shadow-lg, 0 18px 40px rgba(16, 24, 40, 0.16));
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--kvc-border-color, #dee2e6);
}

.chatbot-window.active {
    display: flex;
}

/* Chat Header */
.chatbot-header {
    background: var(--kvc-primary-color, #2B54A2);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--kvc-heading-font, 'Inter', sans-serif);
}

.chatbot-header-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--kvc-background-light, #f8f9fa);
}

.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

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

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

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: var(--kvc-radius-md, 12px);
    box-shadow: var(--kvc-shadow-sm, 0 2px 8px rgba(16, 24, 40, 0.08));
    word-wrap: break-word;
}

.user-message .message-content {
    background: var(--kvc-primary-color, #2B54A2);
    color: white;
}

.message-content p {
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
    line-height: 1.3;
}

.message-time {
    font-size: 11px;
    color: var(--kvc-text-muted, #6c757d);
    margin-top: 4px;
    align-self: flex-end;
}

.user-message .message-time {
    align-self: flex-start;
}

/* Chat Input */
.chatbot-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--kvc-border-color, #dee2e6);
}

.chatbot-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--kvc-border-color, #dee2e6);
    border-radius: var(--kvc-radius-md, 12px);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--kvc-body-font, 'Roboto', sans-serif);
}

.chatbot-input:focus {
    border-color: var(--kvc-primary-color, #2B54A2);
}

.chatbot-send {
    background: var(--kvc-primary-color, #2B54A2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
}

.chatbot-send:hover {
    background: var(--kvc-primary-hover, #1d3f84);
}

.chatbot-send:disabled {
    background: var(--kvc-text-muted, #6c757d);
    cursor: not-allowed;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--kvc-text-muted, #6c757d);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-button {
        width: 50px;
        height: 50px;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        height: 400px;
        right: -15px;
    }
    
    .chatbot-header {
        padding: 12px 16px;
    }
    
    .chatbot-messages {
        padding: 12px;
    }
    
    .chatbot-input-container {
        padding: 12px;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--kvc-border-color, #dee2e6);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--kvc-text-muted, #6c757d);
}
