/* Professional Chatbot UI Styles */
:root {
    --chat-primary: #071d3a;
    --chat-secondary: #0b2a4f;
    --chat-bg: #ffffff;
    --chat-text: #132033;
    --chat-light-text: #667085;
    --chat-border: #f3f4f6;
    --chat-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

.chat-button {
    width: 64px;
    height: 64px;
    background: var(--chat-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(255, 107, 0, 0.39);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
}

.chat-button:hover {
    transform: scale(1.05);
    background: #e55a00;
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
}

.chat-button i {
    font-size: 1.8rem;
}

.chat-container {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: chatSlideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.chat-container.active {
    display: flex;
}

/* Professional Header */
.chat-header {
    background: var(--chat-secondary);
    color: #fff;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--chat-primary), transparent);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--chat-primary);
}

.chat-header-info {
    flex: 1;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chat-status {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.close-chat {
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Professional Messages */
.chat-messages {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #e5e7eb;
    border-radius: 10px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.message.bot {
    align-self: flex-start;
    background: #f3f4f6;
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.15);
}

.message-time {
    font-size: 0.7rem;
    color: var(--chat-light-text);
    margin: 0 5px;
}

.message.user + .message-time {
    align-self: flex-end;
}

.message.bot + .message-time {
    align-self: flex-start;
}

.message a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Professional Property Card in Chat */
.chat-property-card {
    background: #fff;
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    margin-top: 12px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.chat-property-card:hover {
    border-color: var(--chat-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.chat-property-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--chat-text);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.chat-property-title i {
    color: var(--chat-primary);
    margin-top: 3px;
    font-size: 0.85rem;
}

.chat-property-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--chat-light-text);
    margin-bottom: 4px;
}

.chat-property-detail i {
    width: 14px;
    text-align: center;
    color: var(--chat-primary);
}

.chat-property-price {
    font-weight: 700;
    color: var(--chat-primary);
    margin-top: 4px;
}

.chat-property-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f9fafb;
    border-top: 1px solid var(--chat-border);
    color: var(--chat-secondary);
    text-align: center;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.chat-property-btn:hover {
    background: var(--chat-primary);
    color: #fff;
}

/* Typing Indicator */
.typing-container {
    display: none;
    align-self: flex-start;
    background: #f3f4f6;
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    margin-bottom: 10px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Professional Input Area */
.chat-input-area {
    padding: 20px;
    background: #fff;
    border-top: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid var(--chat-border);
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--chat-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.05);
}

.chat-input-area input {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--chat-text);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--chat-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #e55a00;
    transform: translateY(-2px);
}

.chat-send-btn:disabled {
    background: #e5e7eb;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }
    .chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 80px;
    }
}
