/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    /* Above everything else */
    font-family: var(--font-body, 'Noto Sans', sans-serif);
}

/* Chat Launcher (Avatar) */
#chatbot-launcher {
    width: 70px;
    /* Reduced container size to minimize empty click area */
    height: 70px;
    background-image: url('images/avatar-macon.webp');
    background-size: 200%;
    /* Zoom in to crop transparency and fill the smaller box */
    /* Zoom in slightly to fill */
    background-repeat: no-repeat;
    background-position: center center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    /* Removed circle styles: background-color, border, border-radius, box-shadow */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    /* Shadow on the image itself */
    display: flex;
    justify-content: center;
    align-items: center;
}

#chatbot-launcher:hover {
    transform: scale(1.1);
}

#chatbot-launcher::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #4DB1B3;
    /* Online status dot */
    border: 2px solid white;
    border-radius: 50%;
    bottom: 5px;
    /* Moved slightly inwards */
    right: 5px;
    /* Moved slightly inwards */
}

/* Chat Window */
#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 450px;
    background: rgba(255, 255, 255, 0.9);
    /* Fallback */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    visibility: hidden;
}

#chatbot-window.visible {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Chat Header */
.chat-header {
    background: var(--color-primary, #1A2E49);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-close {
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
}

.chat-close:hover {
    opacity: 1;
}

/* Chat Content (Messages) */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(242, 240, 234, 0.3);
    /* Subtle bg hint */
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

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

.message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: var(--color-secondary, #4DB1B3);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Input Area */
.chat-input-area {
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-send {
    background: var(--color-primary, #1A2E49);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send:active {
    transform: scale(0.95);
}

/* Options (Buttons) */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.chat-option-btn {
    background: white;
    border: 1px solid var(--color-secondary, #4DB1B3);
    color: var(--color-secondary, #4DB1B3);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background: var(--color-secondary, #4DB1B3);
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 40px);
        bottom: 90px;
        right: 0;
    }
}