/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 140px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-body, "Open Sans", sans-serif);
}

.chatbot-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: #8CC63F;
    /* DD Architects Green */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid white;
}

.chatbot-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-toggle.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(140, 198, 63, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(140, 198, 63, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(140, 198, 63, 0);
    }
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid #eee;
}

.chatbot-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Window Header */
.chatbot-header {
    background: #8CC63F;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 2px;
}

.chatbot-title {
    font-family: var(--font-heading, "Montserrat", sans-serif);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.chatbot-status {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.chatbot-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid white;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-close:hover {
    transform: scale(1.2);
}

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9f9f9;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.chat-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeInMsg 0.3s ease forwards;
    position: relative;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #eee;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.chat-msg.user {
    align-self: flex-end;
    background: #8CC63F;
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 5px rgba(140, 198, 63, 0.2);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    align-items: center;
    animation: fadeInMsg 0.3s ease forwards;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Chat Input Area */
.chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    z-index: 10;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #8CC63F;
}

.chatbot-send {
    background: #8CC63F;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.chatbot-send:hover {
    background: #7bb530;
    transform: scale(1.05);
}

/* Suggested Chips */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.suggest-chip {
    padding: 6px 12px;
    background: white;
    border: 1px solid #8CC63F;
    color: #8CC63F;
    font-size: 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggest-chip:hover {
    background: #8CC63F;
    color: white;
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 115px;
        right: 15px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: 450px;
        right: 0;
        bottom: 75px;
    }
}