/*
 * DEV-HANDOFF COMMENT: public/assets/css/call-minimize.css
 * Purpose: CSS module controlling a focused part of the app UI. Keep selectors narrow and avoid broad overrides unless documented.
 * Handover guidance: Keep selectors narrow. Avoid broad mobile/app-shell overrides unless the target behavior is proven in the DOM.
 */
/* pass99-minimized-calls-video-upload-mirror
   Active direct calls can be minimized without ending WebRTC.
   The full overlay is restored from the ongoing-call bar or mini video preview. */
/* DEV-HANDOFF: Styles for `:root`. Keep this rule scoped to its feature. */
:root {
    --ongoing-call-bar-height: 0px;
}

/* DEV-HANDOFF: Styles for `body.has-minimized-call`. Keep this rule scoped to its feature. */
body.has-minimized-call {
    --ongoing-call-bar-height: 52px;
}

/* DEV-HANDOFF: Styles for `.ongoing-call-bar`. Keep this rule scoped to its feature. */
.ongoing-call-bar {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    z-index: 1400;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.96), rgba(37, 99, 235, 0.96));
    color: #fff;
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.34);
    font: 700 0.85rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ongoing-call-bar[hidden],
/* DEV-HANDOFF: Styles for `.floating-call-video[hidden]`. Keep this rule scoped to its feature. */
.floating-call-video[hidden] {
    display: none !important;
}

/* DEV-HANDOFF: Styles for `.ongoing-call-bar i`. Keep this rule scoped to its feature. */
.ongoing-call-bar i {
    flex: 0 0 auto;
}

/* DEV-HANDOFF: Styles for `.ongoing-call-bar strong`. Keep this rule scoped to its feature. */
.ongoing-call-bar strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* DEV-HANDOFF: Styles for `.ongoing-call-bar span`. Keep this rule scoped to its feature. */
.ongoing-call-bar span {
    opacity: 0.92;
    font-weight: 700;
    white-space: nowrap;
}

/* DEV-HANDOFF: Styles for `.floating-call-video`. Keep this rule scoped to its feature. */
.floating-call-video {
    position: fixed;
    z-index: 1390;
    right: max(12px, env(safe-area-inset-right));
    top: calc(50vh - 62px);
    width: 104px;
    height: 146px;
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
    border: 2px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* DEV-HANDOFF: Styles for `.floating-call-video video`. Keep this rule scoped to its feature. */
.floating-call-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #020617;
}

/* DEV-HANDOFF: Styles for `.floating-call-video::after`. Keep this rule scoped to its feature. */
.floating-call-video::after {
    content: "LIVE";
    position: absolute;
    left: 7px;
    bottom: 7px;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

body[data-stellar-theme^="terminal-"] .ongoing-call-bar,
/* DEV-HANDOFF: Styles for `html[data-stellar-theme^="terminal-"] .ongoing-call-bar`. Keep this rule scoped to its feature. */
html[data-stellar-theme^="terminal-"] .ongoing-call-bar {
    border-radius: 0 !important;
    border: 1px solid var(--terminal-fg, #00ff66) !important;
    background: var(--terminal-bg, #000) !important;
    color: var(--terminal-fg, #00ff66) !important;
    box-shadow: none !important;
    font-family: "Courier New", "Liberation Mono", monospace !important;
}

body[data-stellar-theme^="terminal-"] .floating-call-video,
/* DEV-HANDOFF: Styles for `html[data-stellar-theme^="terminal-"] .floating-call-video`. Keep this rule scoped to its feature. */
html[data-stellar-theme^="terminal-"] .floating-call-video {
    border-radius: 0 !important;
    border: 1px solid var(--terminal-fg, #00ff66) !important;
    box-shadow: none !important;
    background: var(--terminal-bg, #000) !important;
}

body[data-stellar-theme^="terminal-"] .floating-call-video::after,
/* DEV-HANDOFF: Styles for `html[data-stellar-theme^="terminal-"] .floating-call-video::after`. Keep this rule scoped to its feature. */
html[data-stellar-theme^="terminal-"] .floating-call-video::after {
    border-radius: 0 !important;
    background: var(--terminal-bg, #000) !important;
    color: var(--terminal-fg, #00ff66) !important;
    border: 1px solid var(--terminal-fg, #00ff66) !important;
}

/* Terminal fast-mode had broad transform resets. Local self preview must stay mirrored, including rear camera per current product requirement. */
body[data-stellar-theme^="terminal-"] [data-call-local-video],
html[data-stellar-theme^="terminal-"] [data-call-local-video],
/* DEV-HANDOFF: Styles for `[data-call-local-video][data-mirror="1"]`. Keep this rule scoped to its feature. */
[data-call-local-video][data-mirror="1"] {
    transform: scaleX(-1) !important;
    transform-origin: center center !important;
}

/* DEV-HANDOFF PASS165:
   The body-level full-call Back-to-chat button was retired. Back now lives inside
   the active call action row. The minimized green top bar below remains the only
   body-level return affordance. */
/* The minimized top bar returns to the call; it is not another Back to chat button. */
/* DEV-HANDOFF: Styles for `#ongoingCallBar.ongoing-call-bar`. Keep this rule scoped to its feature. */
#ongoingCallBar.ongoing-call-bar {
    cursor: pointer;
}

/* PASS149 global in-call strip
   Telegram-style behavior: one reserved top strip across the whole app while a call is minimized.
   Do not move the strip per screen and do not push headers into Android's status bar. */
/* DEV-HANDOFF: Styles for `:root`. Keep this rule scoped to its feature. */
:root {
    --stellar-call-strip-height: 0px;
}

/* DEV-HANDOFF: Styles for `body.has-minimized-call`. Keep this rule scoped to its feature. */
body.has-minimized-call {
    --ongoing-call-bar-height: 0px !important;
}

/* DEV-HANDOFF: Styles for `body.has-minimized-call #ongoingCallBar.ongoing-call-bar`. Keep this rule scoped to its feature. */
body.has-minimized-call #ongoingCallBar.ongoing-call-bar {
    position: fixed !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    width: auto !important;
    min-height: 42px !important;
    margin: 0 !important;
    z-index: 9075 !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call)`. Keep this rule scoped to its feature. */
html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call) {
    --stellar-call-strip-height: 44px;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call) #appShell`. Keep this rule scoped to its feature. */
html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call) #appShell {
    padding-top: calc(var(--mobile-top-gap, 24px) + var(--stellar-call-strip-height)) !important;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call) .app-screen`. Keep this rule scoped to its feature. */
html.is-mobile-app body:where(.has-minimized-call, .has-minimized-group-call) .app-screen {
    height: calc(100dvh - var(--mobile-top-gap, 24px) - var(--stellar-call-strip-height)) !important;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app.is-chat-thread-open body:where(.has-minimized-call, .has-minimized-group-call) #chatThreadView:not...`. Keep this rule scoped to its feature. */
html.is-mobile-app.is-chat-thread-open body:where(.has-minimized-call, .has-minimized-group-call) #chatThreadView:not(.is-hidden) {
    height: calc(100dvh - var(--mobile-top-gap, 24px) - var(--stellar-call-strip-height)) !important;
}

html.is-mobile-app body.has-minimized-call #ongoingCallBar.ongoing-call-bar,
/* DEV-HANDOFF: Styles for `html.is-mobile-app body.has-minimized-group-call #groupCallReturnButton.group-call-return-button`. Keep this rule scoped to its feature. */
html.is-mobile-app body.has-minimized-group-call #groupCallReturnButton.group-call-return-button {
    top: var(--mobile-top-gap, 24px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-height: var(--stellar-call-strip-height) !important;
    height: var(--stellar-call-strip-height) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22) !important;
    justify-content: center !important;
    padding: 0 14px !important;
    backdrop-filter: none !important;
}

html.is-mobile-app body.has-minimized-call #ongoingCallBar.ongoing-call-bar strong,
/* DEV-HANDOFF: Styles for `html.is-mobile-app body.has-minimized-group-call #groupCallReturnButton.group-call-return-button span`. Keep this rule scoped to its feature. */
html.is-mobile-app body.has-minimized-group-call #groupCallReturnButton.group-call-return-button span {
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app body.has-minimized-call #ongoingCallBar.ongoing-call-bar span[data-ongoing-call-time]`. Keep this rule scoped to its feature. */
html.is-mobile-app body.has-minimized-call #ongoingCallBar.ongoing-call-bar span[data-ongoing-call-time] {
    font-size: 12px !important;
    font-weight: 900 !important;
    opacity: 0.94 !important;
}

/* DEV-HANDOFF: Styles for `html.is-mobile-app.is-chat-thread-open body:where(.has-minimized-call, .has-minimized-group-call) #chatThreadView:not...`. Keep this rule scoped to its feature. */
html.is-mobile-app.is-chat-thread-open body:where(.has-minimized-call, .has-minimized-group-call) #chatThreadView:not(.is-hidden) .messages-list {
    padding-top: 8px !important;
    scroll-padding-top: 8px !important;
}

/* Full-screen viewers and modals must beat the minimized call bar. */
.chat-media-viewer,
.media-viewer,
.image-viewer,
.lightbox,
[data-media-viewer],
/* DEV-HANDOFF: Styles for `[data-image-viewer]`. Keep this rule scoped to its feature. */
[data-image-viewer] {
    z-index: 2147482000 !important;
}

/* The floating video preview is still allowed to float, but it must not outrank real media viewers. */
/* DEV-HANDOFF: Styles for `body.has-minimized-call .floating-call-video`. Keep this rule scoped to its feature. */
body.has-minimized-call .floating-call-video {
    z-index: 780 !important;
}

/* If the full call overlay is visible again, the minimized bar must never reserve space. */
/* DEV-HANDOFF: Styles for `body:not(.has-minimized-call)`. Keep this rule scoped to its feature. */
body:not(.has-minimized-call) {
    --ongoing-call-bar-height: 0px !important;
}


/* pass107-stable-callbar-disable-old-reserved-space */
/* pass107 moved the stable call-bar overrides to message-edit.css loaded last. */

