:root {
    --primary-color: #2d5016;
    --primary-light: #4a7c2a;
    --primary-dark: #1a3009;
    --accent-color: #7fb069;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 25px rgba(0,0,0,0.15);
}

.kb-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kb-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(45, 80, 22, 0.4);
}

.kb-chat-button svg {
    width: 28px;
    height: 28px;
    fill: var(--text-light);
}

.kb-chat-button.active {
    transform: rotate(90deg);
}

.kb-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.kb-chat-container.active {
    display: flex;
}

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

.kb-chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-light);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.kb-chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kb-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.kb-chat-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.kb-chat-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.kb-chat-close:hover {
    background: rgba(255,255,255,0.2);
}

.kb-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-light);
}

.kb-chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.kb-chat-message.user {
    flex-direction: row-reverse;
}

.kb-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kb-chat-message.user .kb-message-avatar {
    background: var(--accent-color);
}

.kb-message-content {
    max-width: 70%;
}

.kb-message-bubble {
    background: var(--bg-white);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
}

.kb-chat-message.user .kb-message-bubble {
    background: var(--primary-color);
    color: var(--text-light);
}

.kb-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.kb-typing-indicator {
    display: none;
    padding: 12px 16px;
    background: var(--bg-white);
    border-radius: 12px;
    width: fit-content;
}

.kb-typing-indicator.active {
    display: block;
}

.kb-typing-dots {
    display: flex;
    gap: 4px;
}

.kb-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.kb-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.kb-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

.kb-chat-input-container {
    padding: 16px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.kb-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.kb-chat-input:focus {
    border-color: var(--primary-color);
}

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

.kb-chat-send:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.kb-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.kb-chat-send svg {
    width: 20px;
    height: 20px;
    fill: var(--text-light);
}

.kb-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.kb-welcome-message .kb-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.kb-welcome-message h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 18px;
}

.kb-welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.kb-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 0 20px;
}

.kb-quick-action {
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
}

.kb-quick-action:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.kb-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.kb-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.kb-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

@media (max-width: 768px) {
    .kb-chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 20px;
        left: 20px;
    }
    
    .kb-chat-button {
        bottom: 16px;
        right: 16px;
    }
}

.kb-error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin: 10px 20px;
    border-left: 3px solid #c33;
}

/* Contact Form Styles */
.kb-contact-form {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

.kb-form-content h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 16px;
}

.kb-form-content p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.kb-form-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.kb-form-input:focus {
    border-color: var(--primary-color);
}

.kb-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.kb-form-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.kb-form-submit {
    background: var(--primary-color);
    color: var(--text-light);
}

.kb-form-submit:hover {
    background: var(--primary-dark);
}

.kb-form-skip {
    background: var(--bg-light);
    color: var(--text-dark);
}

.kb-form-skip:hover {
    background: var(--border-color);
}

.kb-form-success {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
}

.kb-form-success p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}
