#chatbot-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 500px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.2);
    background: linear-gradient(to bottom right, #ffffff, #f0f0f0);
}

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

#chat-header {
    background: #007bff;
    color: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
}

#chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#chat-header::after {
    content: "Ask me about apartments, renovations, or city info!";
    font-size: 12px;
    color: #e6e6e6;
    margin-top: 2px;
}

#chat-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

#chat-history {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-size: 14px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

/* Message wrapper */
.chat-message-wrapper {
    display: inline-block;
    max-width: 80%;
    margin-bottom: 15px;
    position: relative;
    clear: both;
}

.chat-message-wrapper.user {
    float: right;
    background: #D9F2FB;
    border-radius: 15px 15px 0 15px;
    padding: 8px 12px;
    margin-left: 20%;
    animation: fadeIn 0.2s ease-in;
}

.chat-message-wrapper.bot {
    float: left;
    background: #ebebeb;
    border-radius: 15px 15px 15px 0;
    padding: 8px 12px;
    margin-right: 20%;
    animation: fadeIn 0.2s ease-in;
}

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

.chat-message {
    word-wrap: break-word;
    color: #333;
}

.chat-message-wrapper.user .chat-message {
    color: #007bff;
}

.chat-timestamp {
    display: block;
    font-size: 10px;
    color: #999;
    text-align: right;
    margin-top: 2px;
}

/* Typing Indicator */
.typing-indicator .chat-message {
    display: inline-block;
    color: #333;
    text-align: left;
}

.typing-dots {
    display: inline-block;
    width: 1em;
    text-align: center;
    color: #555;
    font-size: 20px;
    letter-spacing: -0.2em;
    animation: blink 1s infinite steps(1,start);
}

.typing-dots span {
    display: inline-block;
    animation: dotsAnimation 1.3s infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotsAnimation {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#chat-input {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #ddd;
}

#chat-input-field {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

#chat-input-field:focus {
    border-color: #007bff;
}

#chat-send-btn {
    margin-left: 10px;
    padding: 8px 12px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#chat-send-btn:hover {
    background: #0056b3;
}

#chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
    transition: background 0.2s ease;
}

#chat-toggle-btn:hover {
    background: #0056b3;
}