/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --accent-color: #fbbf24;
    --accent-hover: #f59e0b;
    --text-color: #334155;
    --text-light: #94a3b8;
    --background-color: #f8fafc;
    --white: #ffffff;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --card-hover-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    display: flex;
    gap: 2rem;
}

nav a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.7)), url('../assets/images/hero-bg.jpg'); /* Placeholder if image missing */
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 8rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Search Bar */
.search-container {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
}

.search-container input, .search-container select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    flex: 1;
    font-family: inherit;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
}

/* Property Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.property-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.property-image {
    height: 200px;
    background-color: #cbd5e1;
    background-size: cover;
    background-position: center;
    position: relative;
}

.price-tag {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
}

.property-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.property-location {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.property-features {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--card-hover-shadow);
    font-size: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-hover-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.chat-window.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    background: var(--primary-color);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.message.ai {
    background: var(--white);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

.chat-input-area {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    outline: none;
}

.chat-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Property Carousel in Chat */
.chat-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
    scroll-behavior: smooth;
}

.chat-property-card {
    min-width: 220px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.chat-property-image {
    height: 120px;
    background-size: cover;
    background-position: center;
}

.chat-property-details {
    padding: 0.75rem;
}

.chat-property-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-property-price {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 700;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loading-dots:after {
    content: ' .';
    animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);}
    40% { color: var(--text-color); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);}
    60% { text-shadow: .25em 0 0 var(--text-color), .5em 0 0 rgba(0,0,0,0);}
    80%, 100% { text-shadow: .25em 0 0 var(--text-color), .5em 0 0 var(--text-color);}
}
