/* File: assets/css/ai-search.css */

body.ai-modal-open {
    overflow: hidden; /* Prevent background scroll when modal is open */
}

.ai-search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d2c20; /* Dark green background */
    background-image: url('https://www.buy.ca/cdn-cgi/image/quality=75,format=auto/https://www.buy.ca/assets/images/bg-noise.png'); /* Noise texture */
    color: #fff;
    display: none; /* Initially hidden */
    flex-direction: column;
    font-family: 'Jost', sans-serif;
    z-index: 2000;
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.ai-search-header {
    padding: 1rem 1.5rem;
    text-align: right;
    flex-shrink: 0;
}

.ai-close-btn {
    font-size: 2.5rem;
    color: #fff;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.ai-close-btn:hover { opacity: 1; }

.ai-search-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    overflow-y: auto;
}

.ai-intro {
    margin-bottom: auto; /* Pushes everything else down */
    padding-top: 5vh;
}
.ai-intro .ai-logo img { width: 60px; height: 60px; margin-bottom: 1rem; }
.ai-intro h1 { font-size: 2.5rem; font-weight: 600; max-width: 600px; margin: 0 auto 1rem auto; }
.ai-intro .disclaimer-text { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

.ai-chat-area {
    margin-top: 1rem;
    max-width: 700px;
    width: 100%;
    margin-bottom: auto; /* Pushes footer down */
}

.chat-bubble {
    display: flex; /* Changed to flex for icon alignment */
    align-items: flex-start; /* Align icon with top of text */
    gap: 10px;
    max-width: 90%;
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    text-align: left;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chat-bubble.user {
    background-color: #0B1B3C;
    color: #fff;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}
.chat-bubble.ai {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-left-radius: 5px;
    margin-right: auto;
}
.chat-bubble .chat-icon {
    font-size: 1.2rem;
    padding-top: 2px;
}

/* ADD THIS TO THE END OF assets/css/ai-search.css */

/* .ai-results-area is now a container for the list */
.ai-results-area {
    display: grid; /* Keep as grid to allow single column */
    gap: 1rem;
    width: 100%;
    padding: 1rem;
}

.ai-property-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    color: #181616;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: popIn 0.5s ease-out;
    width: 100%;
}

.ai-list-item-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.ai-list-item-info {
    flex-grow: 1;
    text-align: left;
}

.ai-list-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ai-list-item-address {
    font-size: 1rem;
    font-weight: 500;
}

.ai-list-item-city {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.ai-list-item-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #495057;
}

.ai-list-item-details span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ai-list-item-button {
    background-color: #0B1B3C;
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.ai-list-item-button:hover {
    background-color: #1C2F5C;
    color: #fff;
}


.ai-property-card {
    background-color: #fff;
    color: #181616;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.ai-property-card img { width: 100%; height: 180px; object-fit: cover; }
.ai-property-card-info { padding: 1rem; }
.ai-property-card-price { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.25rem; }
.ai-property-card-address { font-size: 0.95rem; color: #555; margin-bottom: 0.75rem; }
.ai-property-card-button { display: block; text-align: center; background-color: #0B1B3C; color: #fff; padding: 0.5rem; text-decoration: none; border-radius: 4px; font-weight: 500; font-size: 0.9rem; transition: background-color 0.2s; }
.ai-property-card-button:hover { background-color: #1C2F5C; }


.ai-search-footer {
    padding: 1rem;
    flex-shrink: 0;
    background-color: rgba(0,0,0,0.1);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.ai-input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background-color: rgba(255,255,255,0.95);
    border-radius: 50px;
    padding: 0.5rem;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}
.ai-input-wrapper:focus-within {
    border-color: #0B1B3C;
}

.ai-input-wrapper input[type="text"] { flex-grow: 1; border: none; background: transparent; padding: 0 1rem; font-size: 1.1rem; color: #181616; }
.ai-input-wrapper input[type="text"]:focus { outline: none; }
.btn-ai-action { background: none; border: none; font-size: 1.5rem; color: #6c757d; cursor: pointer; padding: 0.5rem; transition: color 0.2s ease; }
.btn-ai-action:hover { color: #0B1B3C; }

.header-actions-new {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between AI button and Login/Profile */
}
.btn-ai-search-toggle {
    background: linear-gradient(135deg, #FF416C, #2ECC71, #3498DB);
    background-size: 200% 200%;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: gradient-animation 4s ease infinite;
}
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.btn-ai-search-toggle:hover {
    transform: scale(1.1);
}

.header-actions-new {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between AI button and Login/Profile */
}
.btn-ai-search-toggle {
    background: linear-gradient(135deg, #FF416C, #2ECC71, #3498DB);
    background-size: 200% 200%;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: gradient-animation 4s ease infinite;
}
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.btn-ai-search-toggle:hover {
    transform: scale(1.1);
}
    /* CSS for AI Search Popup */
    .ai-search-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #1C2F5C; 
        color: #fff;
        display: flex;
        flex-direction: column;
        font-family: 'Jost', sans-serif;
        z-index: 2000;
        animation: fadeInModal 0.3s ease-out;
    }

    @keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

    .ai-search-header { padding: 1rem 1.5rem; text-align: right; }
    .ai-close-btn { font-size: 2.5rem; color: #fff; text-decoration: none; opacity: 0.7; transition: opacity 0.2s ease; background: none; border: none; cursor: pointer; }
    .ai-close-btn:hover { opacity: 1; }
    .ai-search-content { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 1rem; overflow-y: auto; }
    .ai-intro .ai-logo img { margin-bottom: 1rem; }
    .ai-intro h1 { font-size: 2.5rem; font-weight: 600; max-width: 600px; margin: 0 auto 1rem auto; }
    .ai-intro .disclaimer-text { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
    .ai-chat-area { margin-top: 2rem; max-width: 700px; width: 100%; }
    .ai-search-footer { padding: 1rem; flex-shrink: 0; background-color: rgba(0,0,0,0.1); border-top: 1px solid rgba(255,255,255,0.1); }
    .ai-input-wrapper { max-width: 800px; margin: 0 auto; display: flex; align-items: center; background-color: #fff; border-radius: 50px; padding: 0.5rem; }
    .ai-input-wrapper input[type="text"] { flex-grow: 1; border: none; background: transparent; padding: 0 1rem; font-size: 1.1rem; color: #181616; }
    .ai-input-wrapper input[type="text"]:focus { outline: none; }
    .btn-ai-action { background: none; border: none; font-size: 1.5rem; color: #6c757d; cursor: pointer; padding: 0.5rem; transition: color 0.2s ease; }
    .btn-ai-action:hover { color: #0B1B3C; }

    /* ADD THIS TO THE END OF assets/css/ai-search.css */

.chat-bubble .chat-thumbnail {
    max-width: 150px;
    border-radius: 6px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* === NEW: CUSTOM SCROLLBAR STYLES === */
.ai-search-content::-webkit-scrollbar {
    width: 10px;
}

.ai-search-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); /* Faint track inside the blue popup */
    border-radius: 10px;
}

.ai-search-content::-webkit-scrollbar-thumb {
    background-color: #1c2f5c; /* A muted blue, slightly lighter than the background */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.ai-search-content::-webkit-scrollbar-thumb:hover {
    background-color: #2f457c; /* Lighter on hover */
}
