/* Chatbot Widget Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Floating chat bubble button */
.chatbot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.5);
}

.chatbot-bubble i {
    font-size: 24px;
    color: #d4a017;
}

/* Chat window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

/* Chat header */
.chatbot-header {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header .company-icon {
    width: 32px;
    height: 32px;
    background: rgba(212, 160, 23, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Chat messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Message styles */
.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message.assistant {
    justify-content: flex-start;
}

.chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #4a7c23 0%, #2d5016 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.assistant .chatbot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    margin-left: 8px;
    background: linear-gradient(135deg, #4a7c23 0%, #2d5016 100%);
    color: white;
}

.chatbot-message.assistant .chatbot-message-avatar {
    margin-right: 8px;
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    color: white;
}

/* Welcome message */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
    color: #666;
}

.chatbot-welcome-icon {
    font-size: 48px;
    color: #d4a017;
    margin-bottom: 12px;
}

.chatbot-welcome h4 {
    color: #2d5016;
    margin-bottom: 8px;
}

.chatbot-welcome p {
    font-size: 14px;
    margin: 0;
}

/* Loading indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background: #d4a017;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Input area */
.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #4a7c23;
}

.chatbot-input::placeholder {
    color: #adb5bd;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4a7c23 0%, #2d5016 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error message */
.chatbot-error {
    padding: 12px 16px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    font-size: 14px;
    margin: 10px 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 30px);
        right: -10px;
        bottom: 75px;
    }

    .chatbot-bubble {
        width: 50px;
        height: 50px;
        right: 15px;
    }

    .chatbot-bubble i {
        font-size: 20px;
    }
}
