﻿/* Ask AI: the first-question dialog (PM 2026-11-29).
   Markup: Pages/Shared/Partials/_WzAskAiDialog.cshtml, behaviour: wwwroot/js/wz-askai.js.
   The dialog is the shared .wz-modal (wz-components.css); this file only adds what is inside it. The suggestion pills
   and the microphone follow the AI search page (aiSearch.css: .ai-suggest__chip, .ai-roundbtn--mic) so the two look alike. */

body.wz2 .wz-askai .modal-dialog { max-width: 560px; }

body.wz2 .wz-askai .modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

    body.wz2 .wz-askai .modal-title svg {
        flex: none;
        color: var(--wz-p);
    }

body.wz2 .wz-askai-lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--wz-muted);
}

/* ---- suggested questions (above the field) ---- */

body.wz2 .wz-askai-sugg-h {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wz-muted);
}

body.wz2 .wz-askai-sugg {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

    /* Waiting a moment for the visitor's place: the row keeps its space, so nothing below it moves. */
    body.wz2 .wz-askai-sugg.is-wait { visibility: hidden; }

    body.wz2 .wz-askai-sugg button {
        max-width: 100%;
        min-height: 36px;
        padding: 7px 14px;
        border: 1px solid var(--wz-line2);
        border-radius: 18px;
        background: #fff;
        color: var(--wz-ink2);
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.3;
        text-align: left;
        overflow-wrap: anywhere;
        cursor: pointer;
        transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    }

        body.wz2 .wz-askai-sugg button:hover {
            border-color: var(--wz-p);
            background: var(--wz-tint2);
            color: var(--wz-p);
        }

        body.wz2 .wz-askai-sugg button:focus-visible {
            outline: none;
            border-color: var(--wz-p);
            box-shadow: var(--wz-focus-ring);
        }

/* ---- the question field with the microphone ---- */

body.wz2 .wz-askai-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--wz-line2);
    border-radius: var(--wz-r);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    body.wz2 .wz-askai-box:focus-within {
        border-color: var(--wz-p);
        box-shadow: var(--wz-focus-ring);
    }

    body.wz2 .wz-askai-box textarea {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 60px;
        max-height: 160px;
        padding: 4px 0;
        border: 0;
        outline: 0;
        resize: none;
        background: transparent;
        color: var(--wz-ink);
        font-family: inherit;
        font-size: 14.5px;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

        body.wz2 .wz-askai-box textarea::placeholder { color: var(--wz-faint); }

body.wz2 .wz-askai-mic {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--wz-tint);
    color: var(--wz-p);
    font-size: 17px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

    body.wz2 .wz-askai-mic[hidden] { display: none; }
    body.wz2 .wz-askai-mic:hover { background: var(--wz-p); color: #fff; }
    body.wz2 .wz-askai-mic:focus-visible { outline: none; box-shadow: var(--wz-focus-ring); }

    body.wz2 .wz-askai-mic.is-listening {
        background: var(--wz-err-bg);
        color: var(--wz-err);
        animation: wz-askai-pulse 1.4s ease-out infinite;
    }

@keyframes wz-askai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(163, 49, 42, .35); }
    100% { box-shadow: 0 0 0 10px rgba(163, 49, 42, 0); }
}

@media (prefers-reduced-motion: reduce) {
    body.wz2 .wz-askai-mic.is-listening { animation: none; }
}

/* ---- status line (listening, microphone errors) and the speech language ---- */

body.wz2 .wz-askai-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px; /* two lines of status: a message never pushes the buttons down */
    margin-top: 8px;
}

/* No speech recognition in this browser: no microphone, no language list, no messages, so the row takes no room. */
body.wz2 .wz-askai:not(.has-voice) .wz-askai-foot { display: none; }

body.wz2 .wz-askai-status {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--wz-muted);
}

    body.wz2 .wz-askai-status.is-err { color: var(--wz-err); }

body.wz2 .wz-askai-lang {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12.5px;
    color: var(--wz-muted);
}

    body.wz2 .wz-askai-lang[hidden] { display: none; }

    body.wz2 .wz-askai-lang select {
        max-width: 150px;
        padding: 2px 2px 2px 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--wz-ink2);
        font-family: inherit;
        font-size: 12.5px;
        cursor: pointer;
    }

        body.wz2 .wz-askai-lang select:focus-visible { outline: none; box-shadow: var(--wz-focus-ring); }

body.wz2 .wz-askai #wzAskAiNext svg { flex: none; }

@media (max-width: 575.98px) {
    /* 16px keeps a phone browser from zooming into the field. */
    body.wz2 .wz-askai-box textarea { font-size: 16px; }
    body.wz2 .wz-askai .modal-footer > .wz-btn { flex: 1 1 0; }
    /* Narrow: the language sits right under the field, the status line gets the full width below it (three lines kept). */
    body.wz2 .wz-askai-foot { flex-direction: column-reverse; align-items: stretch; gap: 4px; min-height: 0; }
    body.wz2 .wz-askai-lang { align-self: flex-end; }
    body.wz2 .wz-askai-status { min-height: 53px; }
}

/* Floating "Ask Wiz" button (PM 2026-12-01): bottom-right corner of every page except Home, the map and AI search.
   Sits under dialogs and sheets (1050+) and above the page; moves up over the phone bottom bar and the app banner. */
body.wz2 .wz-askfab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1029;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 20px 0 16px;
    border-radius: 999px;
    background: var(--wz-p);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .12);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

    body.wz2 .wz-askfab svg { flex: none; }
    body.wz2 .wz-askfab:hover { background: var(--wz-p-d); color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16, 24, 40, .26), 0 3px 8px rgba(16, 24, 40, .14); }
    body.wz2 .wz-askfab:focus-visible { outline: 3px solid rgba(var(--wz-p-rgb), .45); outline-offset: 3px; }

body.wz2.has-wz-mbar .wz-askfab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.wz2.has-pwa-prompt .wz-askfab { bottom: calc(var(--wz-appban-h, 96px) + 16px); }
body.wz2.has-wz-mbar.has-pwa-prompt .wz-askfab { bottom: calc(var(--wz-appban-h, 96px) + 88px); }
body.wz2.modal-open .wz-askfab, body.wz2.wz-msheet-open .wz-askfab { display: none; }

@media (max-width: 575.98px) {
    body.wz2 .wz-askfab { right: 14px; height: 48px; padding: 0 16px 0 13px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    body.wz2 .wz-askfab { transition: none; }
    body.wz2 .wz-askfab:hover { transform: none; }
}

@media print {
    body.wz2 .wz-askfab { display: none; }
}

/* The chat pages keep their composer clear (same rule as the app banner). */
body.wz2:has(.wz-chat-shell) .wz-askfab,
body.wz2:has(.wz-am-compose) .wz-askfab { display: none; }

/* === 2026-12-02: qa2 === */
/* QA BUG-118: characters used under the box (like the review box), a short message at the limit. */
body.wz2 .wz-askai-count { margin: 6px 0 0; font-size: 12px; color: var(--wz-muted); font-variant-numeric: tabular-nums; }
body.wz2 .wz-askai-count.is-full { color: var(--wz-err); }
/* QA BUG-116: a guest whose free AI searches are used up: the note, Sign in / Create a Free Account instead of Next. */
body.wz2 .wz-askai-limit { display: flex; gap: 10px; align-items: flex-start; margin: -4px 0 16px; padding: 10px 12px; border: 1px solid var(--wz-line2); border-radius: 10px; background: var(--wz-tint2); color: var(--wz-ink2); font-size: 13px; line-height: 1.45; }
body.wz2 .wz-askai-limit[hidden] { display: none; }
body.wz2 .wz-askai-limit .bi { color: var(--wz-p); margin-top: 1px; }
body.wz2 .wz-askai.is-guest-out .modal-footer > [data-bs-dismiss] { display: none; }
@media (max-width: 420px) {
    body.wz2 .wz-askai.is-guest-out .modal-footer { flex-wrap: wrap; }
    body.wz2 .wz-askai.is-guest-out .modal-footer > .wz-btn { flex: 1 1 100%; margin: 0; }
    body.wz2 .wz-askai.is-guest-out .modal-footer > .wz-btn + .wz-btn { margin-top: 8px; }
}
/* === end === */
