/* ECNChat Theme U2F — Webchat Fullscreen Header Compatibility */

/*
  index.html uses body.chatActive while the room interface is open.
  The room client is position:fixed and designed to occupy the full viewport.
  Hide the shared website shell only in that state so it cannot cover the
  webchat toolbar. The shell returns automatically when chatActive is removed.
*/

body.chatActive #ecnUnifiedSiteShell {
  display: none !important;
}

body.chatActive {
  padding-top: 0 !important;
  margin-top: 0 !important;
  overflow: hidden !important;
}

body.chatActive #chat {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  z-index: 10020 !important;
}

/* Keep the webchat's own toolbar visible and above its room panels. */
body.chatActive #chatTopbar {
  position: relative !important;
  z-index: 4 !important;
  flex: 0 0 auto !important;
}

/* Ensure the room grid receives only the remaining viewport height. */
body.chatActive #chatShell {
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Prevent older fixed headers or menus from covering the open room. */
body.chatActive :is(
  #siteHeader,
  #navBar,
  .ecnLegacySiteHeaderHidden,
  .ecnLegacyMainMenuHidden
) {
  pointer-events: none;
}

/* The original portal remains hidden behind the full-screen chat. */
body.chatActive #portal {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Restore normal interaction when returning to the portal. */
body:not(.chatActive) #portal {
  visibility: visible;
  pointer-events: auto;
}
