/* AI Chat Widget Styles */
.ai-chat-widget {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 1000;
	font-family: 'Inter', sans-serif;
	transition: all 0.3s ease;
}

.chat-toggle-btn {
	background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
	color: white;
	padding: 16px 24px;
	border-radius: 50px;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(26, 26, 26, 0.3);
	display: flex;
	align-items: center;
	gap: 12px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	min-width: 200px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	position: relative;
	overflow: hidden;
}

.chat-toggle-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	transition: left 0.5s ease;
}
body #aiChatInput:focus, body #aiChatInput:active{
    box-shadow: none;
}
.chat-toggle-btn:hover::before {
	left: 100%;
}

.chat-toggle-btn:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 8px 25px rgba(26, 26, 26, 0.4);
	background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
}

.chat-toggle-btn:active {
	transform: translateY(-1px) scale(0.98);
}

.chat-toggle-btn i {
	font-size: 16px;
	transition: transform 0.3s ease;
}

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

.chat-label {
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 0.5px;
}

.chat-interface {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 420px;
	height: 600px;
	background: white;
	border-radius: 20px;
	box-shadow: 0 20px 40px rgba(0,0,0,0.15);
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(0,0,0,0.08);
	overflow: hidden;
	backdrop-filter: blur(20px);
	animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

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

.chat-header {
	background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
	color: white;
	padding: 20px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
	display: flex;
	align-items: center;
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 0.5px;
}

.chat-title i {
	margin-right: 10px;
	font-size: 16px;
	opacity: 0.9;
}

.chat-header .btn {
	padding: 8px 12px;
	font-size: 12px;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header .btn:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: scale(1.1);
}

.chat-header .enquiry-btn {
    width:auto;
    border-radius: 20px;
}
.chat-header .enquiry-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: none;
}

.chat-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	background: #f8f9fa;
	border-bottom: none;
}

.message {
	margin-bottom: 15px;
	display: flex;
	align-items: flex-start;
}

.message.user {
	justify-content: flex-end;
}

.message-content {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 18px;
	word-wrap: break-word;
	font-size: 13px;
	line-height: 1.5; /* Better line spacing for readability */
	/* Note: We use <br> tags for line breaks, so white-space: pre-wrap is not needed */
}

.message.ai .message-content {
	background: white;
	border: 1px solid #e9ecef;
	border-radius: 18px 18px 18px 4px;
}

.message.user .message-content {
	background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
	color: #ffffff;
	border-radius: 18px 18px 4px 18px;
}

/* Ensure all text in user messages is white */
.message.user .message-content * {
	color: #ffffff;
}

.message-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 6px;
	font-size: 12px;
}

.message.ai .message-avatar {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	color: white;
}

.message.user .message-avatar {
	background: #e9ecef;
	color: #6c757d;
}

.chat-input-container {
	padding: 15px 20px;
	background: white;
	flex-shrink: 0;
}

.chat-input-container .input-group {
	border-radius: 25px;
	overflow: hidden;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	display: flex;
}

.chat-input-container .form-control {
	border: none;
	padding: 10px 15px;
	font-size: 13px;
	flex: 1;
}

.chat-input-container .btn {
	border: none;
}

.chat-input-container .btn-voice {
	background: #f8f9fa;
	color: #6c757d;
	padding: 10px 12px;
	border-left: 1px solid #e9ecef;
	transition: all 0.2s ease;
}

.chat-input-container .btn-voice:hover {
	background: #e9ecef;
	color: var(--primary-color, #007bff);
}

.chat-input-container .btn-voice.recording {
	background: #dc3545;
	color: white;
	animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

.btn-new-chat {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	margin-top: 10px;
	padding: 8px 16px;
	background: transparent;
	border: 1px dashed #dee2e6;
	border-radius: 20px;
	color: #6c757d;
	font-size: 12px;
	font-weight: 500;
	transition: all 0.2s ease;
	cursor: pointer;
}

.btn-new-chat:hover {
	background: #f8f9fa;
	border-color: var(--primary-color, #007bff);
	color: var(--primary-color, #007bff);
}

.btn-new-chat i {
	font-size: 11px;
}

/* AI Empty State */
.ai-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 30px 20px;
	height: 100%;
	animation: fadeInEmpty 0.5s ease;
}

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

.empty-state-icon {
	position: relative;
	width: 80px;
	height: 80px;
	background: linear-gradient(135deg, var(--primary-color, #1a1a1a) 0%, var(--secondary-color, #2c2c2c) 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.empty-state-icon > i {
	font-size: 32px;
	color: white;
}

.empty-state-icon .sparkle {
	position: absolute;
	color: var(--primary-color, #007bff);
	font-size: 14px;
	animation: sparkle 2s infinite;
}

.sparkle-1 {
	top: -5px;
	right: -5px;
	animation-delay: 0s;
}

.sparkle-2 {
	bottom: 0;
	left: -8px;
	animation-delay: 1s;
}

@keyframes sparkle {
	0%, 100% { opacity: 0; transform: scale(0.8); }
	50% { opacity: 1; transform: scale(1.1); }
}

.ai-empty-state h4 {
	margin: 0 0 8px 0;
	font-size: 20px;
	font-weight: 600;
	color: #212529;
}

.empty-state-subtitle {
	margin: 0 0 12px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--primary-color, #007bff);
}

.empty-state-description {
	margin: 0 0 20px 0;
	font-size: 13px;
	color: #6c757d;
	line-height: 1.5;
	max-width: 280px;
}

.empty-state-suggestions {
	width: 100%;
}

.suggestion-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: #868e96;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
}

.suggestion-chips {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.suggestion-chip {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: white;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	font-size: 12px;
	color: #495057;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
}

.suggestion-chip:hover {
	background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
	border-color: transparent;
	color: #ffffff !important;
	transform: translateX(5px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.suggestion-chip i {
	font-size: 14px;
	width: 18px;
	opacity: 0.7;
}

.suggestion-chip:hover i {
	opacity: 1;
}

/* Property bar CSS removed - replaced with button to view properties on search page */

/* Property Detail Panel */
.property-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 235px; /* Leave space for chat button + 15px spacing */
    bottom: 300px; /* Leave more space, make panel shorter */
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 9999;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.property-detail-panel.show {
    display: block !important;
    transform: translateY(0);
}

/* Adjust detail panel when chat is open */
.property-detail-panel.chat-open {
    right: 435px; /* Adjust when chat is open */
}

.property-detail-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.property-detail-header .btn {
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.property-detail-header .btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.property-detail-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.property-detail-content {
    padding: 20px;
}

.property-detail-images {
    margin-bottom: 20px;
}

.property-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.property-image-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.no-images {
    background: #f8f9fa;
    padding: 40px;
    text-align: center;
    color: #6c757d;
    border-radius: 8px;
}

.property-detail-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.property-detail-location {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-detail-description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.property-detail-features {
    margin-bottom: 20px;
}

.property-detail-features h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.property-detail-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.property-detail-features li {
    padding: 4px 0;
    font-size: 13px;
    position: relative;
    padding-left: 16px;
}

.property-detail-features li:before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.property-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.favourite-detail-btn.active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 24px;
    color: var(--primary-color);
}

/* Favourite Notification */
.favourite-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1002;
}

.favourite-notification.show {
    transform: translateX(0);
}

.favourite-notification i {
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .property-detail-panel {
        left: 0;
        right: 20px;
        bottom: 300px;
    }
    
    .property-detail-panel.chat-open {
        right: 20px;
        bottom: 300px;
    }
    
    .favourite-notification {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Loading Animation - Same as other widgets */
.message-content .typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    max-width: 100%;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
    flex-shrink: 0;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .chat-interface {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 60px;
        right: 0;
        left: auto;
    }

    .chat-toggle-btn {
        min-width: 150px;
        padding: 12px 16px;
    }

    .chat-label {
        font-size: 12px;
    }
}

/* Animation for widget appearance */
@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-chat-widget {
    animation: slideIn 0.5s ease-out;
}

/* View Properties Button in Chat */
.message-content .btn {
    color: #212529;
}

.message-content .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    text-decoration: none;
}

.message-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: #ffffff;
    text-decoration: none;
}

.message-content .btn-outline-secondary {
    color: #6c757d;
    border-color: #dee2e6;
}

.message-content .btn-primary .badge {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
}

.message-content .btn-primary i {
    font-size: 14px;
}

/* AI Suggestions Widget */
.ai-suggestions-widget {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    display: none; /* Hidden by default, shown by JS when chat is empty */
    flex-shrink: 0; /* Don't shrink in flex layout */
}

.ai-suggestions-widget h6 {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-suggestions-widget .suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-suggestions-widget .suggestion-tag {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.ai-suggestions-widget .suggestion-tag:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.ai-suggestions-widget .suggestion-tag:active {
    transform: translateY(0);
}