/* live-2026.css — additive styles for operations using live-2026.js.
   Loaded via $population['live_css'] (see LIVE_viewerFrontEnd::execute()).
   Keep this additive-only: it's loaded alongside live2.css / per-operation
   base_css, never instead of them. */

/* Fullscreen "ask a question" bubble — appended into the video.js player root so it
   survives native fullscreen (see live-2026.js, FSAskBubble). Hidden outside fullscreen
   and on desktop widths: there's no need for an escape hatch when the form is already
   on-screen alongside the video. */
/* Uses the operation's button theme pair (--actionbk-accent background +
   --action-accent text), same as .ui-button elsewhere in live2.css, so the
   bubble matches each operation's branding. A fixed fallback color is given
   for operations that don't define these tokens. Using ONLY --action-accent
   (as text AND background) previously made the bubble invisible on operations
   where that token is white-on-white for a bg-less text role — always pair it
   with --actionbk-accent, never use it alone as the background. */
/* font-size/padding use vw/vh (viewport-relative), not em/rem: live2.css sets a
   small base font-size on BODY (see AGENTS.md), and the player root's inherited
   font-size is unreliable for sizing this bubble — vw/vh scale with the actual
   screen instead of an ancestor's font-size. clamp() keeps it readable on both
   small phones and large tablets/desktops. */
.fs_ask_bubble {
    display: none;
    position: absolute;
    bottom: 18px;
    right: 18px;
    max-width: 92%;
    padding: 11px 18px; /* fallback: Safari < 13.1 has no clamp() */
    padding: clamp(8px, 1.8vw, 14px) clamp(14px, 3.2vw, 22px);
    border-radius: 999px;
    background: var(--actionbk-accent, #19a0cc);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: var(--action-accent, #fff);
    /* smaller vw ratio than before, on purpose: a one-line pill must fit a
       (possibly long, per-operation) fs_bubble_label even in narrow portrait
       fullscreen, where the player root can be much narrower than it is tall
       (letterboxed 16:9 video) */
    font-size: 18px; /* fallback: Safari < 13.1 has no clamp() */
    font-size: clamp(14px, 3vw, 22px);
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.2;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    cursor: grab;
    touch-action: none;
    z-index: 2147483647;
    user-select: none;
    -webkit-user-select: none;
}

.fs_ask_bubble.dragging {
    cursor: grabbing;
}

.fs_ask_bubble .fs_ask_bubble_text {
    pointer-events: none;
}

.fs_ask_bubble .fs_ask_bubble_badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #3f7a56;
    color: #fff;
    font-size: 0.65em;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid rgba(0, 0, 0, 0.6);
    display: none;
}

/* Shown whenever the player itself is fullscreen, regardless of viewport width —
   fullscreen on a phone is frequently landscape, which can exceed the 848px
   breakpoint used elsewhere for portrait/mobile layout decisions. Desktop fullscreen
   gets the bubble too; it's harmless there and avoids guessing desktop vs. mobile
   from width alone. */
.vjs-fullscreen .fs_ask_bubble {
    display: flex;
}

/* Set by FSAskBubble when #ask_question_panel isn't the visible/active panel
   (some operations/panels don't show the question form at all). Needs higher
   specificity than the rule above since both can match .fs_ask_bubble at once
   while in fullscreen. */
.vjs-fullscreen .fs_ask_bubble.fs_ask_bubble_hidden,
.vjs-fullscreen .fs_ask_bubble.fs_ask_bubble_off {
    display: none;
}

/* Settings of "Configuration des questions" (back office): size and "can't be moved".
   Same vw-based sizing as the default pill above (normal = no class rule needed). */
.fs_ask_bubble.fs_ask_bubble_small {
    padding: 8px 13px; /* fallback: Safari < 13.1 has no clamp() */
    padding: clamp(6px, 1.3vw, 10px) clamp(10px, 2.4vw, 16px);
    font-size: 13px; /* fallback: Safari < 13.1 has no clamp() */
    font-size: clamp(11px, 2.3vw, 16px);
}

.fs_ask_bubble.fs_ask_bubble_large {
    padding: 14px 23px; /* fallback: Safari < 13.1 has no clamp() */
    padding: clamp(10px, 2.3vw, 18px) clamp(18px, 4.2vw, 28px);
    font-size: 22px; /* fallback: Safari < 13.1 has no clamp() */
    font-size: clamp(17px, 3.8vw, 28px);
}

.fs_ask_bubble.fs_ask_bubble_fixed {
    cursor: pointer;
}

/* Confirmation overlay shown after a question is sent, when the viewer is
   returned to fullscreen (see FSAskBubble.notifyQuestionSent()). Centered,
   same color pairing as the bubble so it reads as part of the same feature.
   Fades in/out via opacity + a class toggle rather than show()/hide() so it
   doesn't fight the 3s auto-hide timer with abrupt visibility jumps. */
.fs_ask_overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    padding: 14px 22px; /* fallback: Safari < 13.1 has no clamp() */
    padding: clamp(10px, 2.4vw, 18px) clamp(16px, 4vw, 28px);
    border-radius: 16px;
    background: var(--actionbk-accent, #19a0cc);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: var(--action-accent, #fff);
    font-size: 17px; /* fallback: Safari < 13.1 has no clamp() */
    font-size: clamp(14px, 3vw, 20px);
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 2147483647;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vjs-fullscreen .fs_ask_overlay.fs_ask_overlay_visible {
    display: block;
    opacity: 1;
}

/* Stream error overlay (see live-2026.js, StreamErrorOverlay) — replaces the
   ugly native/player "media could not be loaded" screen with an "old TV
   static" look + localized message while VIDEOPLAYER's adapter retries the
   stream in the background.

   Mounted into #custom_html_player_div rather than the player root: that div
   already carries .vjs-16-9 (padding-top: 56.25% box, see vjs-round.css) and
   exists regardless of which VDO_* adapter is active, so the overlay keeps
   16:9 and correct stacking no matter the underlying player.

   #custom_html_player_div itself has no position set in live2.css (only the
   inner <video>/.video-js gets sized), so position:relative is forced here —
   without it the overlay's position:absolute would escape to the nearest
   *other* positioned ancestor instead of filling the player box. */
#custom_html_player_div {
    position: relative;
}

/* #custom_html_player_div is visible from the very first paint (shown
   unconditionally by live.tpl's 'display' handler, before VIDEOPLAYER even
   starts constructing the player) — but the raw, unstyled <video> tag inside
   it only gets video.js's actual look (controls, big-play button, 16:9
   sizing) once the async videojs() constructor finishes. On the very first
   video panel of a session this gap is wide enough to be visible as a bare
   black box, which reads like a page reload. Opacity (not display:none, to
   avoid a layout jump once revealed) keeps the box invisible until
   live-2026.js's 'vjs_ready' handler (see StreamErrorOverlay/FSAskBubble,
   both already wait for this same event) adds .player_ready. */
#custom_html_player_div {
    opacity: 0;
    transition: opacity 0.15s ease;
}

#custom_html_player_div.player_ready {
    opacity: 1;
}

.stream_error_overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    z-index: 2147483647;
}

.stream_error_overlay.stream_error_overlay_visible {
    display: block;
}

/* Old-TV "snow": a true random-grain layer (SVG feTurbulence, not a repeating
   geometric pattern — a diagonal weave reads as a texture, not noise) under
   faint horizontal scanlines and a vignette, with a slight overall flicker.
   Everything is inline/data-URI or gradients, no asset to host or localize. */
.stream_error_overlay_static {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: stream_error_flicker 0.15s steps(2) infinite;
}

.stream_error_overlay_noise {
    position: absolute;
    /* oversize + negative offset: lets steps() jump the grain to a new
       random-looking position each frame without ever exposing an edge */
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    /* Lower baseFrequency than a "fine grain" turbulence gives chunky blobs
       instead of fine sand; feComponentTransfer pushes each blob toward pure
       black/white (a steep S-curve) instead of the smooth grey fractal
       feTurbulence produces on its own — that contrast is what reads as
       "old TV snow" rather than a noise texture. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 0 1 1'/%3E%3CfeFuncG type='discrete' tableValues='0 0 1 1'/%3E%3CfeFuncB type='discrete' tableValues='0 0 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: screen;
    opacity: 0.9;
    animation: stream_error_static_jump 0.08s steps(1) infinite;
}

/* Cool blue-white cast over the black/white grain, like a CRT's phosphor
   glow — multiplied over the noise rather than baked into the SVG so the
   tint can be tweaked without touching the data URI. */
.stream_error_overlay_tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a1a3a 0%, #142a52 55%, #1f3a6b 100%);
    mix-blend-mode: multiply;
    opacity: 0.85;
}

.stream_error_overlay_scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.35) 0,
            rgba(0, 0, 0, 0.35) 1px,
            transparent 1px,
            transparent 3px
    );
    mix-blend-mode: multiply;
}

.stream_error_overlay_vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

@keyframes stream_error_static_jump {
    /* random-ish offsets (not a smooth sweep) so the grain reads as noise,
       not a sliding texture */
    0% {
        transform: translate(0, 0);
    }
    20% {
        transform: translate(-12%, 6%);
    }
    40% {
        transform: translate(9%, -15%);
    }
    60% {
        transform: translate(-6%, -8%);
    }
    80% {
        transform: translate(14%, 11%);
    }
    100% {
        transform: translate(0, 0);
    }
}

@keyframes stream_error_flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.88;
    }
}

.stream_error_overlay_message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    padding: 14px 22px; /* fallback: Safari < 13.1 has no clamp() */
    padding: clamp(10px, 2.4vw, 18px) clamp(16px, 4vw, 28px);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 15px; /* fallback: Safari < 13.1 has no clamp() */
    font-size: clamp(13px, 2.6vw, 18px);
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@media (prefers-reduced-motion: reduce) {
    .stream_error_overlay_static,
    .stream_error_overlay_noise {
        animation: none;
    }
}

/* MutedNotice (live-2026.js): big tappable "sound is off" banner over the video, also in fullscreen. Fallback value
   before each clamp(): Safari < 13.1 has no clamp(). Only the banner takes clicks, the player controls stay usable. */
.muted_notice {
    display: none;
    position: absolute;
    top: 12%;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    top: var(--mn-y, 12%);
    left: var(--mn-x, 50%);
    -webkit-transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1));
    transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1));
    /* own content width: an absolutely positioned box is otherwise sized to the room left to its right, so it shrank near the right edge */
    width: -webkit-max-content;
    width: max-content;
    max-width: 90%;
    padding: 12px 20px;
    padding: clamp(10px, 2.4vw, 18px) clamp(16px, 4vw, 28px);
    border-radius: 14px;
    background: #19a0cc;
    background: var(--actionbk-accent, #19a0cc);
    border: 3px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    color: var(--action-accent, #fff);
    font-size: 20px;
    font-size: clamp(16px, 3.6vw, 28px);
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    z-index: 2147483646;
    -webkit-animation: muted_notice_pulse 1.4s ease-in-out infinite;
    animation: muted_notice_pulse 1.4s ease-in-out infinite;
}

.muted_notice.muted_notice_visible {
    display: block;
}

.muted_notice .muted_notice_icon {
    margin-right: 0.4em;
}

@-webkit-keyframes muted_notice_pulse {
    0%, 100% { -webkit-transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1)) scale(1); }
    50% { -webkit-transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1)) scale(1.06); }
}

@keyframes muted_notice_pulse {
    0%, 100% { transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1)) scale(1); }
    50% { transform: translate(calc(var(--mn-x, 50%) * -1), calc(var(--mn-y, 12%) * -1)) scale(1.06); }
}


/* the pulse stops after the configured delay (MutedNotice.startCalm); the banner stays tappable */
.muted_notice.muted_notice_calm {
    -webkit-animation: none;
    animation: none;
}

/* Portrait (phone held upright): the video is narrow and short, so the banners get proportionally bigger text instead of the
   16 px floor. Plain value first (Safari < 13.1 has no clamp()). */
@media (orientation: portrait) {
    .muted_notice {
        font-size: 24px;
        font-size: clamp(22px, 7vw, 34px);
        padding: 14px 18px;
        padding: clamp(12px, 3.4vw, 22px) clamp(14px, 4.4vw, 26px);
        max-width: 94%;
    }
}
