/* ==========================================================================
   Chat.Application - base styles shared by every page.
   Colours come from Bootstrap 5 CSS variables, so light and dark mode work
   automatically (data-bs-theme on <html>, set by theme.js).
   ========================================================================== */

:root {
    --app-navbar-height: 56px;
    --app-accent: #2563eb;
}

html,
body {
    height: 100%;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.app-navbar {
    background-color: var(--bs-tertiary-bg);
    min-height: var(--app-navbar-height);
}

.app-logo {
    margin-right: 0.25rem;
}

.app-user-name {
    display: inline-block;
    max-width: 160px;
    vertical-align: middle;
}

/* Many menu items: wrap to a second line instead of making the page scroll sideways. */
.app-navbar .navbar-collapse {
    flex-wrap: wrap;
    row-gap: 0.25rem;
}

/* Wide screens have room for the full "name (organization - role)" text. */
@media (min-width: 1400px) {
    .app-user-name {
        max-width: 280px;
    }
}

/* Pages such as the chat screens use the full window height below the navbar. */
body.app-full-height {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.app-full-height > header {
    flex: 0 0 auto;
}

body.app-full-height > .app-main {
    flex: 1 1 auto;
    min-height: 0;
}

.min-width-0 {
    min-width: 0;
}

/* Visible keyboard focus for accessibility. */
:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
}

/* Chat notifications (chat-notify.js): unread counts in the menu and the bell at the top right. */
.chat-nav-badge {
    display: inline-block;
    min-width: 1.25rem;
    margin-inline-start: .25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
}

.chat-nav-badge[hidden],
.chat-notify-count[hidden] {
    display: none;
}

.chat-notify-bell {
    position: relative;
}

.chat-notify-count {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    min-width: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.15rem;
}

.chat-notify-menu {
    width: min(22rem, calc(100vw - 2rem));
    max-height: 70vh;
    overflow-y: auto;
}

.chat-notify-item {
    white-space: normal;
}

.chat-notify-empty {
    padding: .5rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

/* PDF preview inside the chat (chat-attachments.js). */
.pdf-viewer-body {
    min-height: 60vh;
}

.pdf-viewer-frame {
    display: block;
    width: 100%;
    height: 80vh;
    border: 0;
}

/* Profile photo from the website instead of initials (chat-render.js). */
.chat-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
