/* Ask mindzie (public help bot) - the docs front door.
   Design: an "ask-first" identity. The ask box is the signature element - an elevated,
   softly glowing centerpiece under a confident hero, with the four starter questions as
   inviting prompt cards. On-brand with the docs (Inter), calm and disciplined.
   The same ask-* classes style BOTH the live Blazor component and the server prerender
   so there is no flash between first paint and hydration. */

/* Design tokens shared by every top-level Ask wrapper. Defined on all three because
   the live component (.ask-page), the server prerender (.ask-landing) and the invalid-route
   view (.ask-notfound) are separate mount roots - scoping the vars to only .ask-page left
   the prerender's var() references unresolved (the pre-hydration title fell back to a link style). */
.ask-page,
.ask-landing,
.ask-notfound {
    --ask-ink: #0d1526;
    --ask-muted: #59647a;
    --ask-faint: #7a8296;
    --ask-primary: #0b63e5;
    --ask-primary-2: #3b86ff;
    --ask-border: #dde4f0;
    --ask-surface: #ffffff;
}

.ask-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ask-ink);
    background:
        radial-gradient(900px 520px at 50% -10%, #e7effe 0%, rgba(231,239,254,0) 60%),
        #f6f8fd;
}

/* ---- Transcript (scroll area) ---- */
.ask-transcript {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.ask-transcript-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================
   LANDING (empty state): center the hero + ask box + starters
   as one confident group. "safe center" keeps the top from
   clipping when content is taller than the viewport.
   ============================================================ */
.ask-page--landing {
    justify-content: center;
    justify-content: safe center;
    overflow-y: auto;
    text-align: center;
}
.ask-page--landing .ask-transcript {
    flex: 0 0 auto;
    overflow: visible;
}
.ask-page--landing .ask-transcript-inner {
    padding: 8px 20px 0;
    gap: 0;
}

/* ---- Hero (badge / title / promise) ---- */
.ask-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: ask-rise .5s cubic-bezier(.22,.61,.36,1) both;
}

.ask-hero-mark {
    width: 60px; height: 60px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: linear-gradient(150deg, #0b63e5 0%, #3b86ff 100%);
    box-shadow: 0 12px 28px -10px rgba(11,99,229,.6), inset 0 1px 0 rgba(255,255,255,.25);
    margin-bottom: 22px;
}

.ask-hero-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.04;
    margin: 0 0 12px;
    color: var(--ask-ink);
    text-decoration: none;
    border-bottom: none;
}
.ask-hero-sub {
    font-size: 16.5px;
    color: var(--ask-muted);
    margin: 0 auto;
    max-width: 52ch;
    line-height: 1.6;
}

/* ============================================================
   ASK BOX. The composer is the centerpiece on the landing and
   the pinned input bar once a conversation starts.
   ============================================================ */
.ask-composer {
    flex: none;
    border-top: 1px solid #e6eaf0;
    background: #fff;
    padding: 14px 20px 10px;
}
.ask-composer-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--ask-border);
    border-radius: 14px;
    padding: 8px 8px 8px 14px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.ask-composer-inner:focus-within { border-color: var(--ask-primary); }

/* Landing variant: elevated, glowing, front-and-centre. */
.ask-page--landing .ask-composer {
    border-top: none;
    background: transparent;
    padding: 0 20px;
    margin-top: 28px;
    animation: ask-rise .5s cubic-bezier(.22,.61,.36,1) .06s both;
}
.ask-page--landing .ask-composer-inner {
    max-width: 640px;
    border-width: 1.5px;
    border-radius: 16px;
    padding: 10px 10px 10px 18px;
    box-shadow: 0 12px 34px -14px rgba(13,21,38,.22);
}
.ask-page--landing .ask-composer-inner:focus-within {
    border-color: var(--ask-primary);
    box-shadow: 0 12px 34px -12px rgba(11,99,229,.32), 0 0 0 4px rgba(11,99,229,.10);
}
.ask-page--landing .ask-input { font-size: 16px; }

.ask-input {
    flex: 1;
    border: 0; background: transparent; outline: none;
    resize: none;
    font-family: inherit; font-size: 15px; line-height: 1.5;
    color: var(--ask-ink);
    max-height: 160px;
    padding: 6px 0;
    text-align: left;
}
.ask-input:disabled { color: var(--ask-faint); }
.ask-input::placeholder { color: #97a0b2; }

.ask-send {
    flex: none;
    width: 42px; height: 42px; border-radius: 11px;
    border: 0; color: #fff;
    background: linear-gradient(150deg, #0b63e5 0%, #3b86ff 100%);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: filter .14s ease, box-shadow .14s ease;
    box-shadow: 0 6px 16px -6px rgba(11,99,229,.6);
}
.ask-send:hover:not(:disabled) { filter: brightness(1.06); }
.ask-send:disabled { background: #c2ccda; box-shadow: none; cursor: default; }

.ask-send-spinner {
    width: 17px; height: 17px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45);
    border-top-color: #fff;
    animation: ask-spin 0.7s linear infinite;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }

.ask-disclaimer {
    max-width: 820px;
    margin: 8px auto 0;
    text-align: center;
    font-size: 11.5px;
    color: #9aa2ae;
}
.ask-page--landing .ask-disclaimer { margin-top: 14px; }

/* ============================================================
   STARTERS: prompt cards + section links, below the ask box.
   ============================================================ */
.ask-starters {
    flex: 0 0 auto;
    width: 100%;
    max-width: 640px;
    margin: 22px auto 0;
    padding: 0 20px 30px;
    animation: ask-rise .5s cubic-bezier(.22,.61,.36,1) .12s both;
}

/* Starter question cards - two columns of inviting, clearly-clickable prompts. */
.ask-suggestions,
.ask-landing-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.ask-chip,
.ask-landing-example {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    padding: 13px 15px;
    border-radius: 13px;
    border: 1px solid var(--ask-border);
    background: #fff;
    color: #354052;
    box-shadow: 0 1px 2px rgba(13,21,38,.04);
}
.ask-chip {
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.ask-chip:hover:not(:disabled) {
    border-color: #b9d0f6;
    background: #f7faff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -10px rgba(11,99,229,.4);
}
.ask-chip:focus-visible {
    outline: 2px solid var(--ask-primary);
    outline-offset: 2px;
}
.ask-chip:disabled { opacity: .55; cursor: default; }

/* Section links - quiet, secondary navigation. */
.ask-landing-sections-heading {
    margin: 30px 0 12px;
    font-size: 12.5px;
    letter-spacing: .01em;
    color: var(--ask-faint);
}
.ask-landing-sections {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.ask-landing-section-link {
    font-size: 13px; font-weight: 600;
    padding: 7px 13px; border-radius: 999px;
    border: 1px solid #e2e8f2; background: #fff; color: #37536f;
    text-decoration: none; transition: all .12s ease;
}
.ask-landing-section-link:hover { background: #eef4ff; border-color: #b9d0f6; color: var(--ask-primary); }
.ask-landing-overview {
    margin: 20px 0 0; font-size: 13.5px;
}
.ask-landing-overview a { color: var(--ask-primary); text-decoration: none; font-weight: 600; }
.ask-landing-overview a:hover { text-decoration: underline; }

/* ============================================================
   SERVER PRERENDER wrapper (.ask-landing) - a static hero shown
   before the Blazor bundle loads. Styled to match the live look
   so hydration is seamless. Its .ask-landing-box is a visual
   stand-in for the composer.
   ============================================================ */
.ask-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 20px 40px;
}
.ask-landing .ask-hero-mark {
    width: 60px; height: 60px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: linear-gradient(150deg, #0b63e5 0%, #3b86ff 100%);
    box-shadow: 0 12px 28px -10px rgba(11,99,229,.6), inset 0 1px 0 rgba(255,255,255,.25);
    margin-bottom: 22px;
}
.ask-landing-box {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    width: 100%; max-width: 640px;
    margin: 28px auto 0;
    background: #fff;
    border: 1.5px solid var(--ask-border);
    border-radius: 16px;
    padding: 15px 12px 15px 18px;
    box-shadow: 0 12px 34px -14px rgba(13,21,38,.22);
}
.ask-landing-box-text { color: #97a0b2; font-size: 16px; }
.ask-landing-box-btn {
    flex: none;
    width: 42px; height: 42px; border-radius: 11px;
    background: linear-gradient(150deg, #0b63e5 0%, #3b86ff 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px -6px rgba(11,99,229,.6);
}
.ask-landing-examples { margin: 22px auto 0; width: 100%; }

/* Invalid single-segment route (garbage caught by the "/{lang}" front-door route). */
.ask-notfound {
    max-width: 560px; margin: 60px auto; padding: 0 20px; text-align: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ask-ink);
}
.ask-notfound h1 { font-size: 24px; margin: 0 0 10px; color: var(--ask-ink); }
.ask-notfound p { color: var(--ask-muted); margin: 0 0 20px; }
.ask-notfound-home {
    display: inline-block; padding: 10px 18px; border-radius: 8px;
    background: var(--ask-primary); color: #fff; text-decoration: none; font-weight: 600;
}

/* ---- Turns ---- */
.ask-turn { display: flex; gap: 12px; align-items: flex-start; }
.ask-turn-user { justify-content: flex-end; }

.ask-avatar {
    flex: none;
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(150deg, #0b63e5 0%, #3b86ff 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; line-height: 1;
    margin-top: 2px;
}

.ask-bubble {
    max-width: 100%;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.ask-bubble-user {
    background: var(--ask-primary);
    color: #fff;
    border-bottom-right-radius: 5px;
    max-width: 80%;
    white-space: pre-wrap;
}
.ask-bubble-assistant {
    background: #fff;
    color: var(--ask-ink);
    border: 1px solid #e9edf4;
    border-bottom-left-radius: 5px;
    flex: 1;
    min-width: 0;
}

/* ---- Thinking indicator ---- */
.ask-thinking { display: flex; align-items: center; gap: 6px; }
.ask-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #9aa2ae;
    animation: ask-bounce 1.2s infinite ease-in-out both;
}
.ask-dot:nth-child(1) { animation-delay: -0.24s; }
.ask-dot:nth-child(2) { animation-delay: -0.12s; }
.ask-thinking-text { font-size: 13.5px; color: var(--ask-faint); margin-left: 4px; }
@keyframes ask-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ---- Error ---- */
.ask-error {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #a12b2b;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
}

/* ---- Rendered markdown answer ---- */
.ask-markdown > *:first-child { margin-top: 0; }
.ask-markdown > *:last-child { margin-bottom: 0; }
.ask-markdown p { margin: 0 0 10px; }
.ask-markdown h1, .ask-markdown h2, .ask-markdown h3, .ask-markdown h4 {
    margin: 16px 0 8px; font-weight: 700; color: var(--ask-ink); line-height: 1.3;
}
.ask-markdown h1 { font-size: 20px; }
.ask-markdown h2 { font-size: 18px; }
.ask-markdown h3 { font-size: 16px; }
.ask-markdown a { color: var(--ask-primary); text-decoration: none; }
.ask-markdown a:hover { text-decoration: underline; }
.ask-markdown ul, .ask-markdown ol { margin: 0 0 10px; padding-left: 22px; }
.ask-markdown li { margin: 3px 0; }
.ask-markdown code {
    font-family: 'Consolas', ui-monospace, monospace; font-size: 13px;
    background: #eef1f6; border-radius: 4px; padding: 1px 5px;
}
.ask-markdown pre {
    background: #0d1526; color: #e6eaf0; border-radius: 10px;
    padding: 13px 15px; overflow-x: auto; margin: 0 0 12px;
}
.ask-markdown pre code { background: transparent; color: inherit; padding: 0; font-size: 13px; }
.ask-markdown blockquote {
    margin: 0 0 10px; padding: 4px 14px; border-left: 3px solid var(--ask-border); color: var(--ask-muted);
}
.ask-markdown table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; width: 100%; }
.ask-markdown th, .ask-markdown td { border: 1px solid #e0e4eb; padding: 7px 10px; text-align: left; }
.ask-markdown th { background: #f1f4f8; font-weight: 600; }

/* ---- Motion ---- */
@keyframes ask-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .ask-hero, .ask-page--landing .ask-composer, .ask-starters { animation: none; }
    .ask-chip:hover:not(:disabled) { transform: none; }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .ask-transcript-inner { padding: 20px 14px 18px; gap: 16px; }
    .ask-bubble-user { max-width: 88%; }
    .ask-composer { padding: 10px 12px 8px; }
    .ask-hero-title { font-size: 32px; }
    .ask-hero-sub { font-size: 15px; }
    .ask-page--landing .ask-transcript-inner { padding: 4px 14px 0; }
    .ask-suggestions, .ask-landing-examples { grid-template-columns: 1fr; }
    .ask-landing { padding: 28px 16px 28px; }
    .ask-landing-box { padding: 13px 10px 13px 16px; }
}

/* ---- "Ask mindzie" header link (Ask/landing header only) ----
   Sits right next to the mindzie logo as the page's identity + entry point, in a warm gold
   accent so it stands out on the blue header without being loud. Replaces the old logo
   subtitle + the far-right nav button. Text is the localized nav.ask string. */
.logo-ask-link {
    display: inline-flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
    color: #ffd24a;
    text-decoration: none;
    padding: 6px 13px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 210, 74, 0.5);
    white-space: nowrap;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.logo-ask-link:hover {
    background: rgba(255, 210, 74, 0.18);
    border-color: rgba(255, 210, 74, 0.85);
    color: #ffde79;
}
.logo-ask-link:focus-visible {
    outline: 2px solid #ffd24a;
    outline-offset: 2px;
}
@media (max-width: 640px) {
    .logo-ask-link { font-size: 1.02rem; padding: 5px 10px; }
}
