:root {
    --bot-primary: #2E7D32;
    --bot-primary-hover: #1B5E20;
    --bot-secondary: #FF6F00;
    --bot-bg: #ffffff;
    --bot-text-main: #212121;
    --bot-text-muted: #757575;
    --bot-msg-bot: #F5F5F5;
    --bot-msg-user: #2E7D32;
    --bot-border: #E0E0E0;
    --bot-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --bot-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#chatbot-trigger {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--bot-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(46, 125, 50, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--bot-transition), box-shadow var(--bot-transition);
}

#chatbot-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.5);
}

#chatbot-trigger .icon-close {
    display: none;
}

#chatbot-container.open #chatbot-trigger .icon-chat {
    display: none;
}

#chatbot-container.open #chatbot-trigger .icon-close {
    display: block;
}

#chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--bot-bg);
    border: 1px solid var(--bot-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--bot-shadow);
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform var(--bot-transition), opacity var(--bot-transition);
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

#chatbot-window.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.chatbot-header {
    padding: 20px;
    background: var(--bot-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
}

.chatbot-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
}

.chatbot-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
    border: 2px solid var(--bot-primary);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
    color: white;
}

#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fdfdfd;
}

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

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: botFadeIn 0.3s ease-out forwards;
}

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

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

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

.message.user .message-content {
    background: var(--bot-msg-user);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.15);
}

.message-time {
    font-size: 0.7rem;
    color: var(--bot-text-muted);
    margin-top: 5px;
    margin-left: 5px;
}

.message.user .message-time {
    align-self: flex-end;
    margin-right: 5px;
}

#chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--bot-border);
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid var(--bot-border);
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

#chatbot-input:focus {
    border-color: var(--bot-primary);
}

#chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--bot-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#chatbot-send:hover {
    background: var(--bot-primary-hover);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--bot-text-muted);
    border-radius: 50%;
    animation: botBounce 1.4s infinite ease-in-out both;
}

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

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

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 40px);
        height: 80vh;
        right: -10px;
        bottom: 80px;
    }
}
