/* Enquiry chat bubble (Views/Shared/_EnquiryBubble_Partial.cshtml, js/enquiry-bubble.js).
   Colours, radii and shadows follow the enquiry wizard (AssemblySoft.Enquiry/wwwroot/enquiry.css).
   z-index: above page content and the sticky header (#header 1000, the showcase pull-tab 1035), below the
   showcase player's fill-the-window mode (2147483000) and its game overlay (2147483001). */

.as-bubble {
    --as-navy: #0f172a;
    --as-accent: #00bfff;
    --as-accent-deep: #0284c7;
    --as-line: #e2e8f0;
    --as-edge-x: calc(20px + env(safe-area-inset-right, 0px));
    --as-edge-y: calc(20px + env(safe-area-inset-bottom, 0px));
    --as-size: 60px;
    font-family: 'Inter', 'Inter Fallback', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Launcher button ─────────────────────────────────────────── */
.as-bubble .as-bubble-btn {
    position: fixed; right: var(--as-edge-x); bottom: var(--as-edge-y); z-index: 2147482000;
    width: var(--as-size); height: var(--as-size); min-width: 0; margin: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; cursor: pointer;
    /* #0284c7 to #0369a1 keeps the white icon at 3:1 or better across the whole gradient. */
    background: linear-gradient(90deg, #0284c7, #0369a1);
    color: #fff; box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3), 0 2px 6px rgba(15, 23, 42, 0.18);
    text-transform: none; letter-spacing: normal; line-height: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, visibility 0s linear 0s;
    -webkit-tap-highlight-color: transparent;
}
.as-bubble .as-bubble-btn:hover { box-shadow: 0 10px 26px rgba(2, 132, 199, 0.4), 0 2px 6px rgba(15, 23, 42, 0.18); transform: translateY(-1px); }
.as-bubble .as-bubble-btn:active { transform: scale(0.96); }
.as-bubble .as-bubble-btn:focus { outline: none; }
.as-bubble .as-bubble-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px var(--as-accent-deep), 0 8px 20px rgba(2, 132, 199, 0.3); }
.as-bubble .as-bubble-btn svg { display: block; pointer-events: none; }
.as-bubble .as-bubble-btn .as-bubble-icon-close { display: none; }
.as-bubble.is-open .as-bubble-btn .as-bubble-icon { display: none; }
.as-bubble.is-open .as-bubble-btn .as-bubble-icon-close { display: block; }

/* Out of the way while a footer or page wizard is on screen (not while the panel is open), and while the showcase
   player hides it (html.sx-hide-chat), runs a game overlay or is in full screen (is-suppressed, set by script). */
.as-bubble.is-near-wizard:not(.is-open) .as-bubble-btn {
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
html.sx-hide-chat .as-bubble, .as-bubble.is-suppressed { display: none !important; }

/* ── Panel ───────────────────────────────────────────────────── */
.as-bubble .as-bubble-panel {
    position: fixed; z-index: 2147482001;
    right: var(--as-edge-x); bottom: calc(var(--as-edge-y) + var(--as-size) + 12px);
    width: 420px; max-width: calc(100vw - 40px);
    height: min(680px, 100dvh - 120px);
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--as-line); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), 0 10px 30px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    overflow: hidden; outline: none;
    opacity: 0; transform: translateY(12px) scale(0.98); transform-origin: bottom right;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.as-bubble .as-bubble-panel[hidden] { display: none; }
.as-bubble .as-bubble-panel.is-shown { opacity: 1; transform: none; }

.as-bubble .as-bubble-head {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 6px 6px 18px; min-height: 56px;
    background: var(--as-navy); color: #fff;
}
.as-bubble .as-bubble-title {
    font-size: 15px; font-weight: 700; line-height: 1.3; color: #fff;
    text-transform: none; letter-spacing: normal;
}
.as-bubble .as-bubble-close {
    flex: 0 0 44px; width: 44px; height: 44px; min-width: 0; margin: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #e2e8f0; border: 0; border-radius: 12px; cursor: pointer;
}
.as-bubble .as-bubble-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.as-bubble .as-bubble-close:focus { outline: none; }
.as-bubble .as-bubble-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--as-accent); }
.as-bubble .as-bubble-close svg { display: block; pointer-events: none; }

.as-bubble .as-bubble-scroll {
    flex: 1 1 auto; min-height: 0;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ── Phones: full-screen sheet, page scroll locked while open ── */
@media (max-width: 767.98px) {
    .as-bubble { --as-size: 56px; }
    .as-bubble .as-bubble-panel {
        inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh;
        border: 0; border-radius: 0;
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
        background: var(--as-navy);
        transform: translateY(24px); transform-origin: bottom center;
    }
    .as-bubble .as-bubble-scroll { background: #fff; }
    .as-bubble.is-open .as-bubble-btn { display: none; }
    html.as-bubble-locked, html.as-bubble-locked body { overflow: hidden !important; overscroll-behavior: none; }
    /* The cookie banner takes the bottom of the screen on phones; the launcher waits until it is answered. */
    html.as-consent-open .as-bubble .as-bubble-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .as-bubble .as-bubble-btn, .as-bubble .as-bubble-panel { transition: none !important; }
    .as-bubble .as-bubble-panel { transform: none; }
}

@media print {
    .as-bubble { display: none !important; }
}
