/* Chatbot Container */
.chat-widget {
    position: fixed;
    bottom: 100px;
    /* Moved up to avoid overlap with scroll-to-top button */
    right: 30px;
    z-index: 9999;
    font-family: 'Futura', sans-serif;
}

/* Toggle Button (Floating Icon) */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background-color: #00a896;
    /* Teal */
    border-radius: 50%;
    color: white;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid white;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-toggle-icon {
    transition: transform 0.3s ease;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 5px 30px 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.175, 0.885, 0.32, 1.275);
    border: 1px solid #f0f0f0;
}

.chat-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.chat-header {
    background-color: #00a896;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.chat-title span {
    font-size: 0.8rem;
    opacity: 0.9;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f9f9f9;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

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

.message.bot {
    background-color: white;
    color: #000000 !important;
    /* Force black text */
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.message.user {
    background-color: #00a896;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, a8, 150, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 15px;
    background-color: white;
    border-radius: 20px;
    align-self: flex-start;
    display: none;
    /* Hidden by default */
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #bbb;
    border-radius: 50%;
    animation: typing 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 typing {

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

    40% {
        transform: scale(1);
    }
}

/* Chat Input Area (for Options) */
.chat-input-area {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 150px;
    overflow-y: auto;
}

.chat-option-btn {
    background-color: white;
    border: 1px solid #00a896;
    color: #00a896;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    /* For anchor tags */
    display: inline-block;
    /* For anchor tags */
}

/* Chat Input Field */
.chat-input-wrapper {
    padding: 10px 15px 15px 15px;
    background-color: white;
    border-top: 1px solid #f0f0f0;
}

#chatInput {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

#chatInput:focus {
    border-color: #00a896;
}

/* Update Options Area to remove top border as Input now handles separation */
.chat-input-area {
    border-top: none;
    padding-bottom: 5px;
    /* Reduce padding slightly */
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        right: -20px;
        /* Shift slightly to better fit small screens */
        bottom: 70px;
        height: 450px;
    }
}