/* MF AI Concierge widget styles — matches the MoveFaster "myagent" glass window (transparent + #007bff bubbles) */

#mf-ai-root, #mf-ai-root * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

#mf-ai-root {
    --ink: #1a1a1a;
    --ink-soft: rgba(0, 0, 0, 0.45);
    --blue: #007bff;
    --blue-dark: #0062c4;
    position: fixed;
    z-index: 2147483000;
}

/* Launcher button — #007bff pill, labeled, matches the myagent bubble color */
.mf-ai-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: #007bff;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.40);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.mf-ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(0, 123, 255, 0.50); }
.mf-ai-launcher:active { transform: translateY(0); }

.mf-ai-launcher .icon {
    width: 22px; height: 22px; flex: 0 0 22px;
    background: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #007bff; font-size: 11px; font-weight: 800;
}

.mf-ai-pulse {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.45);
    animation: mf-ai-pulse 2.4s infinite;
    pointer-events: none;
}
@keyframes mf-ai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.45); }
    70% { box-shadow: 0 0 0 16px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.mf-ai-dot {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 19px; height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30; color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

/* Chat window — frosted glass, matches the myagent modal */
.mf-ai-chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 360px;
    max-width: calc(100vw - 28px);
    height: 520px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.90);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--ink);
    transform-origin: bottom right;
    animation: mf-ai-pop 0.22s ease;
    transition: width 0.25s ease, height 0.25s ease;
}
@keyframes mf-ai-pop {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.mf-ai-chat.hidden { display: none; }
.mf-ai-chat.mf-ai-expanded {
    width: min(1120px, calc(100vw - 40px));
    height: min(88vh, 920px);
    max-width: none;
    max-height: none;
}

.mf-ai-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.mf-ai-hdr-left { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.mf-ai-hdr-loc {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
    color: var(--ink-soft);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px; padding: 2px 10px;
}
.mf-ai-hdr-title { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.2; }
.mf-ai-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mf-ai-expand, .mf-ai-close {
    border: none; background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
    font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}
.mf-ai-expand:hover, .mf-ai-close:hover { background: rgba(0, 0, 0, 0.12); }
.mf-ai-expand svg { width: 15px; height: 15px; }
.mf-ai-expand .icon-compress { display: none; }
.mf-ai-chat.mf-ai-expanded .mf-ai-expand .icon-expand { display: none; }
.mf-ai-chat.mf-ai-expanded .mf-ai-expand .icon-compress { display: block; }

/* Messages */
.mf-ai-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    background: transparent;
}
.mf-ai-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.mf-ai-msg.bot {
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 4px;
}
.mf-ai-msg.user {
    align-self: flex-end;
    background: #007bff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.mf-ai-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 16px; background: rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 16px; border-bottom-left-radius: 4px; }
.mf-ai-typing span { width: 7px; height: 7px; background: rgba(0, 0, 0, 0.35); border-radius: 50%; animation: mf-ai-blink 1.2s infinite; }
.mf-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.mf-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mf-ai-blink { 0%,80%,100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Intro empty state — "What would you like to explore?" hero */
.mf-ai-intro {
    display: flex; flex-direction: column; gap: 10px;
    padding: 6px 2px 2px;
}
.mf-ai-intro-headline {
    font-size: 22px; font-weight: 800; line-height: 1.2;
    color: var(--ink); letter-spacing: -0.01em;
}
.mf-ai-intro-sub { font-size: 14px; color: var(--ink-soft); margin-top: -4px; }

/* Chips — stacked full-width question pills */
.mf-ai-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; background: transparent; }
.mf-ai-chip {
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.10); background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    border-radius: 14px; padding: 12px 15px; font-size: 13.5px; line-height: 1.4; cursor: pointer;
    transition: all 0.12s ease;
    font-weight: 500;
}
.mf-ai-chip:hover { border-color: #007bff; color: #007bff; background: #fff; }

/* Input — matches the myagent input */
.mf-ai-input {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.60);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.mf-ai-input .field {
    flex: 1;
    display: flex; align-items: center;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.90);
    padding: 0 14px;
    transition: border-color 0.2s ease;
}
.mf-ai-input .field:focus-within { border-color: #0071e3; background: #fff; }
.mf-ai-input input {
    flex: 1; border: none; background: transparent;
    padding: 10px 0; font-size: 14px; outline: none; color: var(--ink);
    min-width: 0;
}
.mf-ai-input input::placeholder { color: var(--ink-soft); }
.mf-ai-send {
    border: none; border-radius: 50%; width: 38px; height: 38px;
    background: #007bff; color: #fff;
    cursor: pointer; font-size: 16px; flex: 0 0 38px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.mf-ai-send:hover { background: #0062c4; transform: scale(1.06); }

@media (max-width: 480px) {
    .mf-ai-launcher { right: 14px; bottom: 14px; }
    .mf-ai-chat { right: 14px; bottom: 14px; width: calc(100vw - 28px); }
}

/* Listing cards (live RAE matches dropped into chat) */
.mf-ai-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.mf-ai-cards-title {
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--ink-soft); text-transform: uppercase; padding: 0 2px;
}
.mf-ai-card {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--ink);
    border-radius: 14px; overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 8px;
}
.mf-ai-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); }
.mf-ai-card-thumb {
    width: 72px; height: 72px; flex: 0 0 72px;
    border-radius: 10px;
    background-size: cover; background-position: center;
    background-color: rgba(0, 0, 0, 0.06);
}
.mf-ai-card-body { flex: 1; min-width: 0; }
.mf-ai-card-price { font-weight: 700; font-size: 15px; }
.mf-ai-card-meta { font-size: 13px; font-weight: 600; margin-top: 1px; }
.mf-ai-card-addr { font-size: 12px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Map with the returned properties */
.mf-ai-map {
    position: relative;
    z-index: 0;
    height: 210px;
    border-radius: 14px;
    overflow: hidden;
    margin: 2px 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    background: #e8e6e1;
}
.mf-ai-map .leaflet-container { height: 100%; width: 100%; }
.mf-ai-chat.mf-ai-expanded .mf-ai-map { height: 380px; }

/* Mobile bottom nav bar (Search / Saved Homes / My Account / Talk to Us) */
#mf-mobile-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    z-index: 2147482900;
}
.mf-nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    text-decoration: none;
    background: none; border: none;
    color: rgba(0, 0, 0, 0.45);
    font-size: 11px; font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mf-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.mf-nav-item.active { color: #007bff; }

@media (max-width: 900px) {
    #mf-mobile-nav { display: flex; }
    body { padding-bottom: 72px !important; }
    .mf-ai-launcher { bottom: 82px; }
    .mf-ai-chat { bottom: 82px; height: calc(100vh - 118px); }
}

/* Hide the legacy bottom-right on-site chat bubble + modal.
   Replaced by the centered urgent popup and the myaccount page. */
body #gln-chat-bubble { display: none !important; }
body #gln-chat-modal { display: none !important; }

/* ── AI Concierge: Market Report infographic ───────────────────────────── */
.mf-ai-msg--market { background: transparent !important; padding: 0 !important; max-width: 100% !important; box-shadow: none !important; }
.mf-ai-market {
  background: linear-gradient(160deg, rgba(124,58,237,.14), rgba(0,123,255,.07)), #0b0b16;
  border: 1px solid rgba(124,58,237,.28);
  border-radius: 16px;
  padding: 16px;
  color: #e9e9f2;
  font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 10px 34px rgba(0,0,0,.38);
}
.mf-ai-market__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.mf-ai-market__eyebrow { width: 100%; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #9aa0c3; }
.mf-ai-market__area { font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.mf-ai-market__badge { margin-left: auto; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.mf-ai-market__badge--sellers { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(74,222,128,.4); }
.mf-ai-market__badge--balanced { background: rgba(250,204,21,.13); color: #facc15; border: 1px solid rgba(250,204,21,.4); }
.mf-ai-market__badge--buyers { background: rgba(248,113,113,.14); color: #f87171; border: 1px solid rgba(248,113,113,.4); }
.mf-ai-market__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mf-ai-market__kpi { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 12px; }
.mf-ai-market__kpi-label { font-size: 11px; color: #9aa0c3; letter-spacing: .04em; }
.mf-ai-market__kpi-value { font-size: 23px; font-weight: 700; margin: 4px 0 2px; background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mf-ai-market__kpi-sub { font-size: 11px; color: #7c82a0; }
.mf-ai-market__foot { margin-top: 14px; }
.mf-ai-market__gauge-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.mf-ai-market__gauge-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #facc15, #f87171); }
.mf-ai-market__gauge-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: #7c82a0; letter-spacing: .04em; }
