/* =============================================================================
   CHAT — AI Property Assistant page
   CR: fysh-chat-2026-06-27
   Loaded only by chat.php via $page_css.
============================================================================= */

/* ── n8n chat CSS variable overrides ────────────────────────────────────────
   Applied to :root so they cascade into the n8n widget wherever it renders.  */
:root {
    --chat--color-primary:             var(--navy,  #0F2340);
    --chat--color-primary-shade-50:    #1A3A6E;
    --chat--color-primary-shade-100:   var(--blue,  #1E5BA8);
    --chat--color-secondary:           var(--gold,  #C9A84C);
    --chat--color-secondary-shade-50:  #B8933E;
    --chat--color-white:               #ffffff;
    --chat--color-light:               var(--cream, #F6F5F2);
    --chat--color-light-shade-50:      #EDEBE7;
    --chat--color-light-shade-100:     #E4E2DD;
    --chat--color-dark:                var(--navy,  #0F2340);

    --chat--font-family:               'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --chat--border-radius:             10px;
    --chat--spacing:                   16px;

    --chat--header--background:        var(--navy, #0F2340);
    --chat--header--color:             #ffffff;
    --chat--heading--font-size:        1rem;
    --chat--subtitle--font-size:       0.78rem;

    --chat--message--bot--background:  var(--cream, #F6F5F2);
    --chat--message--bot--color:       var(--navy,  #0F2340);
    --chat--message--user--background: var(--blue,  #1E5BA8);
    --chat--message--user--color:      #ffffff;

    --chat--toggle--background:        var(--navy, #0F2340);
    --chat--toggle--hover--background: #1A3A6E;
    --chat--toggle--active--background:var(--blue, #1E5BA8);
    --chat--toggle--color:             #ffffff;
    --chat--toggle--size:              56px;

    --chat--window--width:             420px;
    --chat--window--height:            620px;

    --chat--input--background:         #ffffff;
    --chat--input--border-color:       #DDE3ED;
    --chat--input--border-color-active:var(--blue, #1E5BA8);
    --chat--input--placeholder--color: #9DAFC4;

    --chat--send-button--background:   var(--gold, #C9A84C);
    --chat--send-button--color:        var(--navy, #0F2340);
}

/* ── Page chrome ─────────────────────────────────────────────────────────── */
.chat-hero {
    background: var(--navy);
    padding: 3.5rem 0 2.75rem;
    text-align: center;
}

.chat-hero__inner {
    max-width: 660px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.chat-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold-lt, #E8C96A);
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
}

.chat-hero__heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.12;
    margin: 0;
}
.chat-hero__heading em { font-style: italic; color: var(--gold-lt, #E8C96A); }

.chat-hero__sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.65;
    margin: 0;
    max-width: 44ch;
}

/* Prompt pills */
.chat-hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.chat-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    color: rgba(255, 255, 255, 0.80);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
    white-space: nowrap;
}
.chat-pill:hover {
    background: rgba(201, 168, 76, 0.20);
    border-color: rgba(201, 168, 76, 0.55);
    color: var(--gold-lt, #E8C96A);
}

/* ── Chat widget stage ───────────────────────────────────────────────────── */
.chat-stage {
    background: var(--cream);
    padding: 3rem 0 4rem;
}

.chat-wrap {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

/* Ensure the n8n window renders inline, not floating */
#n8n-chat {
    min-height: 580px;
    position: relative;
}

/* Force the n8n chat window to render open and positioned within our container */
#n8n-chat .n8n-chat-window {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 580px !important;
    border-radius: var(--radius-lg, 12px) !important;
    box-shadow: var(--shadow-lg, 0 16px 48px rgba(15,35,64,.18)) !important;
    overflow: hidden;
}

/* Hide the floating toggle button — window is always visible on this page */
#n8n-chat .n8n-chat-window-toggle {
    display: none !important;
}

.chat-noscript {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── Reassurance strip ───────────────────────────────────────────────────── */
.chat-trust {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

.chat-trust__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
}
@media (min-width: 768px) {
    .chat-trust__grid { grid-template-columns: repeat(4, 1fr); }
}

.chat-trust__item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.45;
}
.chat-trust__item svg { flex-shrink: 0; color: var(--gold); margin-top: 1px; }
