/* Vector Assistant Chat Styling */
.assistant-header {
    height: 200px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: var(--primary-dark);
}

.assistant-header img {
    max-height: 100%;
    width: auto;
    opacity: 0.85;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 700px; /* Increased height for more chat space */
    overflow: hidden;
    background-color: var(--primary-dark);
    border-radius: 0;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-input-container {
    padding: 15px 20px;
    background-color: var(--primary-light);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.4;
    position: relative;
    font-size: 0.95rem;
    margin-bottom: 12px; /* Increased space between all messages */
}

.message.user {
    align-self: flex-end;
    background-color: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.message.user:hover {
    background-color: rgba(42, 127, 255, 0.9); /* Slightly darker on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.assistant {
    align-self: flex-start;
    background-color: var(--primary-light);
    color: var(--text-light);
    border-bottom-left-radius: 4px;
    margin-left: 40px; /* Make space for the profile icon */
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 10px; /* Increased space between messages */
}

.message.assistant:hover {
    background-color: rgba(42, 127, 255, 0.2); /* Slightly darker on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.assistant::before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    left: -40px;
    top: 12px; /* Position the icon lower to align with text */
    background-image: url('/static/images/ai-assistant-galaxy.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

/* Typing indicator container */
.chat-messages-container {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    pointer-events: none; /* Allow clicking through to messages beneath */
    z-index: 10;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-items: center;
    background-color: var(--primary-light);
    padding: 14px 24px; /* Increased padding for taller bubble */
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    margin-left: 40px; /* Add margin to align with assistant messages */
    margin-top: 15px; /* Add space above the typing indicator */
    transition: all 0.2s ease;
    cursor: pointer;
    width: auto; /* Only as wide as needed */
    display: inline-flex; /* Inline flex to maintain width */
    pointer-events: auto; /* Re-enable pointer events just for the indicator */
    position: relative; /* For the before pseudo-element */
}

.typing-indicator:hover {
    background-color: rgba(42, 127, 255, 0.2); /* Slightly darker on hover */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator::before {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    left: -40px;
    top: 6px; /* Adjusted position for the taller bubble */
    background-image: url('/static/images/ai-assistant-galaxy.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

.typing-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin: 0 3px; /* Slightly more space between dots */
    animation: typing-animation 1.2s infinite ease-in-out;
}

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

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

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

@keyframes typing-animation {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Styles for property cards in chat */
.listing-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
    max-width: 100%;
}

.listing-card {
    display: flex;
    background-color: rgba(42, 127, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(42, 127, 255, 0.2);
    cursor: pointer;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: rgba(42, 127, 255, 0.2); /* Darker background on hover */
}

.listing-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.listing-img i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.listing-img .property-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.listing-details {
    padding: 10px;
    flex: 1;
}

.listing-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-info {
    font-size: 0.8rem;
    display: flex;
    gap: 10px;
}

.listing-info span {
    display: flex;
    align-items: center;
}

.listing-info i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.listing-price {
    font-weight: 500;
    color: var(--accent);
}

.listing-action {
    display: flex;
    margin-top: 5px;
}

.listing-action a {
    font-size: 0.75rem;
    padding: 2px 8px;
    transition: all 0.2s ease;
}

.listing-action a:hover {
    background-color: var(--accent);
    color: white;
    transform: scale(1.05);
}

/* Listing count badge in modal header */
.listing-count-badge {
    font-size: 0.8rem;
    padding: 5px 10px;
    margin-right: 10px;
    background-color: var(--accent) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-weight: 500;
}

/* Listings Styling */
.listings-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    max-width: 100%;
}

.listing-card {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: transform 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.listing-image {
    width: 120px;
    min-width: 120px;
    height: 120px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-details {
    padding: 10px 15px;
    flex-grow: 1;
}

.listing-address {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.listing-neighborhood {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.listing-specs {
    font-size: 14px;
    color: #444;
    margin-bottom: 5px;
}

.listing-rent {
    font-size: 16px;
    font-weight: 600;
    color: #2c7be5;
    margin-bottom: 5px;
}

.listing-amenities {
    font-size: 12px;
    color: #777;
}

.amenities-title {
    font-weight: 600;
    margin-top: 5px;
}

.amenities-list {
    font-style: italic;
}

.no-listings {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Make listings responsive */
@media (max-width: 576px) {
    .listing-card {
        flex-direction: column;
    }
    
    .listing-image {
        width: 100%;
        height: 180px;
    }
}
