/* AI Chatbot Styles */

/* Chat Widget Container */
.ai-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.ai-chat-widget.open {
    transform: scale(1);
}

/* Chat Toggle Button */
.ai-chat-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ai-chat-toggle-button:hover {
    transform: scale(1.1);
    background-color: #0056b3;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Messages Area */
.chat-messages {
    background-color: #f8f9fa;
}

.message-bubble-wrapper {
    display: flex;
    margin-bottom: 10px;
    max-width: 90%;
}

.message-bubble-wrapper.sent {
    margin-left: auto;
    justify-content: flex-end;
}

.message-bubble-wrapper.received {
    margin-right: auto;
    justify-content: flex-start;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message-bubble-wrapper.sent .message-bubble {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-bubble-wrapper.received .message-bubble {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #ced4da;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Property Card */
.property-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    max-width: 280px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.2s ease;
}
.property-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.property-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.property-card-body {
    padding: 15px;
}
.property-card-title {
    font-weight: bold;
    margin-bottom: 5px;
}
.property-card-price {
    color: #007bff;
    font-weight: 600;
}

/* Agent Card */
.agent-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    max-width: 280px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.2s ease;
}
.agent-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.agent-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.agent-card-body {
    padding: 15px;
}
.agent-card-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #212529;
}
.agent-card-title {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.agent-card-phone {
    color: #007bff;
    font-weight: 600;
    font-size: 0.9em;
}
.agent-card-email {
    color: #6c757d;
    font-size: 0.8em;
    margin-top: 3px;
    margin-bottom: 10px;
}

.chat-with-agent-btn {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s ease;
    text-align: center;
    margin-top: 8px;
}

.chat-with-agent-btn:hover {
    background-color: #218838;
    color: white;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 100px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        max-height: 60vh;
    }
    
    .ai-chat-toggle-button {
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 110px;
        max-height: 55vh;
    }
}
