/* Chat Widget Isolated Styles - Won't affect your website */
/* Only applies to chat widget elements */

#chat-toggle,
#chat-widget,
#chat-widget * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Toggle Button */
#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #FEE227;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#chat-toggle svg {
    width: 28px;
    height: 28px;
}

#chat-toggle svg path {
    fill: #000;
}

/* Chat Widget Container */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-size: 14px;
}

#chat-widget.active {
    display: flex;
}

/* Chat Header */
#chat-widget .chat-header {
    background: #000;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#chat-widget .chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#chat-widget #close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.2s;
}

#chat-widget #close-chat:hover {
    opacity: 0.7;
}

#chat-widget #clear-chat-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 16px;
    transition: all 0.2s;
}

#chat-widget #clear-chat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Chat Body */
#chat-widget #chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

#chat-widget #chat-body::-webkit-scrollbar {
    width: 6px;
}

#chat-widget #chat-body::-webkit-scrollbar-track {
    background: transparent;
}

#chat-widget #chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Chat Messages */
#chat-widget .message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

#chat-widget .message.user {
    align-items: flex-end;
}

#chat-widget .message.bot {
    align-items: flex-start;
}

#chat-widget .message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 0;
}

#chat-widget .message.user .message-content {
    background: #FEE227;
    color: #000;
}

#chat-widget .message.bot .message-content {
    background: white;
    color: #333;
}

#chat-widget .timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 8px;
}

/* Typing Indicator */
#chat-widget .typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px;
}

#chat-widget .typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

#chat-widget .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
#chat-widget .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Property Cards */
#chat-widget .property-card-chat {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
}

#chat-widget .property-card-chat img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

#chat-widget .property-card-chat .info {
    padding: 12px;
}

#chat-widget .property-card-chat h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

#chat-widget .property-card-chat .location {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#chat-widget .property-card-chat .price {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

#chat-widget .property-card-chat .view-btn {
    display: inline-block;
    background: #FEE227;
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

#chat-widget .property-card-chat .view-btn:hover {
    background: #f5d600;
}

/* Chat Input */
#chat-widget .chat-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#chat-widget #chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#chat-widget #chat-input:focus {
    border-color: #FEE227;
}

#chat-widget #send-btn {
    width: 44px;
    height: 44px;
    background: #FEE227;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

#chat-widget #send-btn:hover {
    background: #f5d600;
}

#chat-widget #send-btn svg {
    width: 20px;
    height: 20px;
}

#chat-widget #send-btn svg path {
    fill: #000;
}

/* Feedback Buttons */
#chat-widget .feedback-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

#chat-widget .feedback-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
}

#chat-widget .feedback-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

#chat-widget .feedback-btn.selected.thumbs-up {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

#chat-widget .feedback-btn.selected.thumbs-down {
    background: #f44336;
    border-color: #f44336;
    color: white;
}

#chat-widget .feedback-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#chat-widget .feedback-thank-you {
    font-size: 12px;
    color: #4caf50;
    margin-left: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Feedback Form */
#chat-widget .feedback-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin: 10px 0;
}

#chat-widget .feedback-form textarea:focus {
    outline: none;
    border-color: #FEE227;
}

#chat-widget .feedback-form button {
    background: #FEE227;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

#chat-widget .feedback-form button:hover {
    background: #f5d600;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chat-toggle {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
    
    #chat-widget {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
