:root {
    --primary: #1e5128;
    --primary-light: #4e9f3d;
    --accent: #d8e9a8;
    --text-main: #191a19;
    --text-muted: #4e9f3d;
    --bot-msg-bg: #f8fbf8;
    --user-msg-bg: linear-gradient(135deg, #1e5128 0%, #4e9f3d 100%);
    --glass-bg: rgba(255, 255, 255, 0.92);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 15px rgba(0, 0, 0, 0.1);
    --bot-avatar-size: 40px;
}

/* Base Styles */
#chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 370px;
    height: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

#chat-container.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(40px) rotate(2deg);
    pointer-events: none;
}

/* Premium Header */
.chat-header {
    background: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.bot-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.header-avatar {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(30, 81, 40, 0.2);
}

.active-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.bot-info .bot-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-status {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.control-btn {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #eeeeee;
    color: var(--primary);
    transform: translateY(-2px);
}

/* Message Area */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #fdfdfd 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
}

#chat-messages::-webkit-scrollbar {
    display: none;
}

.welcome-card {
    background: #fafff8;
    border: 1px solid #e8f5e9;
    padding: 16px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 8px;
    animation: fadeInScale 0.6s ease-out;
}

.welcome-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.welcome-card h4 {
    margin: 0 0 8px 0;
    color: var(--primary);
    font-size: 16px;
}

.welcome-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Individual Messages */
.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14.5px;
    line-height: 1.5;
    position: relative;
    animation: slideInPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.bot-message {
    background: var(--bot-msg-bg);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.user-message {
    background: var(--user-msg-bg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 8px 20px rgba(78, 159, 61, 0.2);
}

/* Quick Suggestions */
.quick-suggestions {
    padding: 12px 20px;
    overflow-x: auto;
    display: flex;
    gap: 8px;
    white-space: nowrap;
    scrollbar-width: none;
}

.quick-suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    background: white;
    border: 1px solid #e0eedc;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.suggestion-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(30, 81, 40, 0.2);
}

/* Input Area */
.chat-input-wrapper {
    padding: 14px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.input-container-inner {
    background: #f5f7f5;
    border: 1.5px solid #ecefec;
    border-radius: 20px;
    padding: 6px 6px 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.input-container-inner:focus-within {
    background: white;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(78, 159, 61, 0.1);
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: var(--text-main);
}

#send-button {
    background: var(--primary);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 81, 40, 0.25);
}

#send-button:hover:not(:disabled) {
    background: var(--primary-light);
    transform: scale(1.05);
}

#send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Floating Chat Toggle */
#chat-toggle-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}

#chat-toggle {
    background: white;
    border: none;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toggle-icon-container {
    position: relative;
    width: 50px;
    height: 50px;
}

.chatbot-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.online-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #4caf50;
    border: 3px solid white;
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
}

.toggle-tooltip {
    position: absolute;
    right: 90px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#chat-toggle-wrapper:hover .toggle-tooltip {
    opacity: 1;
    visibility: visible;
    right: 85px;
}

#chat-toggle:hover {
    transform: translateY(-10px) scale(1.05) rotate(-2deg);
    box-shadow: 0 15px 40px rgba(30, 81, 40, 0.25);
}

/* Animations */
@keyframes slideInPop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Typing Indicator */
#typing-indicator {
    padding: 14px 20px;
    background: var(--bot-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 4px;
    align-self: flex-start;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #chat-toggle-wrapper {
        bottom: 20px;
        right: 20px;
    }
}