/* The image itself is chosen here (instead of hardcoded in LoginView) so the
   dark theme override below can swap it for a version that suits a dark background. */
.logo {
    content: url("../images/logoSimplifiedTransparent1048x1024.png");
}

body[theme~="dark"] .logo {
    content: url("../images/logoSimplifiedDarkTransparent2048x2048.png");
}



/* ==========================================================================
   Views
   Every view's content is given the .app-view-content class by BaseAppLayout.
   A view limits its own width (MAXWIDTH), so the class only centres it in the
   space that is left, and centres its top-level sections as well, without
   changing any of their widths.
   It also keeps a small distance to the edges of the window, so a card, a list
   row or a grid never sits directly against them; a view that pads its own
   content adds that on top of this.
   ========================================================================== */

.app-view-content {
    box-sizing: border-box;
    padding: 5px;
    margin-inline: auto;
}

vaadin-vertical-layout.app-view-content {
    align-items: center;
}

.simpleSearchLayout {
    --vaadin-app-layout-drawer-width: var(--simple-search-drawer-width, 400px);
}

/* ==========================================================================
   Navbar
   The page title next to the logo, which navigates back to the landing page.
   Its size is the theme's page title step (see the *-theme files); it is only
   as wide as its text, so the click target hugs the title instead of running
   on to the menu.
   ========================================================================== */

.pageTitleHeader {
    font-size: var(--app-page-title-font-size, inherit);
    width: fit-content;
}

/* The flag in the country dropdown (see CountryComboBox), with room before the
   ISO code next to it. */
.countryFlag {
    margin-inline-end: 0.25rem;
}

/* The marker on the chat menu item (see BaseAppLayout): how many conversations have
   something new to read. It sits right after the label (or after the icon, on a phone
   where the menu shows icons only), with a little room of its own so it does not touch
   the text; the theme colours the badge itself. */
.unreadChatBadge {
    margin-inline-start: 5px;
}

/* ==========================================================================
   App layout drawer pull-tabs
   Two tabs open and close the drawer (see BaseAppLayout): one floats in the
   top left corner of the window while the drawer is closed, the other in the
   top right corner of the drawer.
   Their placement is the same in every theme, so it is here and not in a
   *-specifics file; only the distance to the window edge differs, because a
   theme may inset the whole app layout (Aura floats it in a frame). That
   distance is the --app-drawer-inset role.
   ========================================================================== */

/* The pull-tab that closes the drawer floats in the top right corner of the
   drawer, instead of taking a row of vertical space above its content. It is
   slotted into the drawer (light DOM), so it is positioned relative to the
   drawer part, which Vaadin already positions `fixed`. */
.drawerSliderIn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    cursor: pointer;
    z-index: 1;
}

/* The pull-tab that opens the drawer floats in the top left corner of the
   window, shown while the drawer is closed. The tab may overlay photos, so
   the icon sits on a chip of the page's background colour to keep it visible. */
.drawerSliderOut {
    position: fixed;
    top: calc(var(--app-drawer-inset) + 60px);
    left: var(--app-drawer-inset);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    background: var(--app-background);
    cursor: pointer;
    z-index: 1;
}

/* ==========================================================================
   Lists
   A tappable row per entry, used by the chat, the search profiles and the
   admin overviews. The detail of an entry always opens on a page of its own,
   so everything stays usable on a phone.
   Only sizes and positions are set here; the colours (separator, hover, the
   unread marker, the selected row) are the theme's, see the *-specifics files.
   ========================================================================== */

.list {
    padding: 0;
}

.listItem {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.listItemTexts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.listItemHeader {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.listItemName {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listItemExcerpt {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listItemTime {
    font-size: 0.8125rem;
    flex: none;
}

/* an entry with something new in it shouts a little louder */
.listItem.unread .listItemName,
.listItem.unread .listItemExcerpt {
    font-weight: 700;
}

.listItemUnreadMarker {
    flex: none;
}

.listEmpty {
    padding: 1rem;
    text-align: center;
}

/* the chosen entry of a list of choices (the context) is marked */
.listItemSelected .listItemName {
    font-weight: 600;
}

/* Scheduled jobs on the admin actions page: the failure message wraps
   underneath on a narrow screen instead of being cut off. */
.scheduledJobListItem {
    align-items: flex-start;
}

.scheduledJobListItem .listItemExcerpt,
.scheduledJobMessage {
    white-space: normal;
}

.scheduledJobMessage {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Chat
   A Whatsapp-like conversation: the balloons of the other participant(s) on
   the left, your own on the right, with the newest at the bottom.
   Only sizes and positions are set here; the colours of the balloons and of
   the separators are the theme's, see the *-specifics files.
   ========================================================================== */

/* -- the conversation ----------------------------------------------------- */

.chatConversationHeader {
    padding: 0.5rem 1rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

/* the name is the only thing in the header that may give: a long one is cut off with an ellipsis
   instead of pushing the buttons next to it off a phone's screen */
.chatConversationName {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.125rem;
    font-weight: 600;
}

.chatMessages {
    padding: 1rem;
    gap: 0.5rem;
}

.chatEmpty {
    padding: 1rem;
    text-align: center;
}

/* the conversation fills what is left below the navbar, so the input stays at the bottom */
.chatConversation {
    min-height: 60vh;
}

.chatBlockedNotice {
    padding: 0.5rem 1rem;
    margin: 0;
}

/* -- the composer (what you type, and the button that sends it) ------------- */

/* the field and the send button share one row at the bottom of the conversation; the field grows with
   what is typed (markdown, so a message may have several lines) instead of staying a single line */
.chatComposer {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    border-top-width: 1px;
    border-top-style: solid;
}

/* a long word must not push the send button off a phone's screen */
.chatComposerInput {
    min-width: 0;
}

.chatComposer vaadin-button {
    flex: none;
}

/* -- the balloons ---------------------------------------------------------- */

.chatBubbleRow {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* your own messages are drawn on the right, with the avatar on the outer side */
.chatBubbleRow.mine {
    flex-direction: row-reverse;
}

.chatBubbleAvatar {
    flex: none;
}

/* the profile icon of the other dancer is a link to his profile, without the look of one */
.chatBubbleAvatarLink {
    display: flex;
    flex: none;
    text-decoration: none;
}

.chatBubble {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    /* a long word or url must not stretch the balloon beyond the conversation */
    overflow-wrap: anywhere;
}

/* a small tail towards the sender, as the flattened corner of the balloon */
.chatBubbleRow.theirs .chatBubble {
    border-bottom-left-radius: 0.25rem;
}

.chatBubbleRow.mine .chatBubble {
    border-bottom-right-radius: 0.25rem;
}

.chatBubbleSender {
    font-size: 0.875rem;
    font-weight: 600;
}

.chatBubbleBody p:first-child {
    margin-top: 0;
}

.chatBubbleBody p:last-child {
    margin-bottom: 0;
}

.chatBubbleDeleted {
    font-style: italic;
}

.chatBubbleFooter {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    align-self: flex-end;
}

.chatBubbleTime,
.chatBubbleEdited {
    font-size: 0.75rem;
}

.chatBubbleEdited {
    font-style: italic;
}

/* the edit, delete and history icons only draw attention once the balloon is hovered */
.chatBubbleAction {
    opacity: 0;
    transition: opacity 0.1s;
}

.chatBubble:hover .chatBubbleAction,
.chatBubbleAction:focus {
    opacity: 1;
}

.chatBubbleEditorButtons {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

/* -- the history popup (administrators) ------------------------------------ */

/* the versions can be long; the list scrolls so the popup still fits a phone */
.chatHistoryList {
    max-height: 60vh;
    overflow-y: auto;
    gap: 1rem;
}

.chatHistoryEntry {
    overflow-wrap: anywhere;
}

.content {
    padding: 5px;
}

/* ==========================================================================
   Help
   The help texts are rendered from markdown into ordinary elements (see
   HelpContent), so their typography is set here instead of per element. This
   is the layout for every theme; the colours of the contents, the quote and
   the image frame are in the theme files.
   ========================================================================== */

/* the ? next to a component: a normal component in a horizontal wrapper, vertically centred on the
   component it belongs to (see HelpIconWrapperComponent) */
.helpIconWrapper {
    align-items: center;
    gap: 0;
}

/* the ? is a plain div (not a button), so it only takes the room of the icon itself; the small negative
   vertical margin keeps it off the text baseline of the label */
.helpIcon {
    flex: none;
    display: inline-flex;
    align-items: center;
    margin-left: 0.15rem;
    color: var(--app-secondary);
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
}

.helpIcon:focus-visible {
    outline: 2px solid var(--app-highlight);
    outline-offset: 2px;
}

/* the help page: the page shows one text at a time */
.helpPage {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.helpContent {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.helpContent h1 {
    margin: 1rem 0 0.5rem;
    font-size: 1.75rem;
}

.helpContent h2 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.375rem;
}

.helpContent h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.125rem;
}

.helpContent p,
.helpContent ul,
.helpContent ol {
    margin: 0.5rem 0;
}

.helpContent ul,
.helpContent ol {
    padding-left: 1.5rem;
}

.helpContent li {
    margin: 0.25rem 0;
}

.helpContent blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
}

.helpContent pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 0.25rem;
}

.helpContent code {
    font-family: monospace;
}

.helpImage {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
}

/* a link to a help topic that does not exist; only the content test should ever see it */
.helpMissingLink {
    text-decoration: underline dotted;
}

/* the field help in its popover must not run off the screen */
.helpPopoverContent {
    max-height: 60vh;
    overflow-y: auto;
}

/* a translation is never passed off as what the dancer wrote: the note sits above the text, styled as a
   label (small, spaced capitals, a hairline under it) instead of as prose */
.translationCaption {
    border-bottom: 1px solid var(--app-border);
    color: var(--app-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    margin-top: 0.375rem;
    margin-bottom: 0.375rem;
    padding-bottom: 0.25rem;
    text-transform: uppercase;
}

/* the two flags in the translate button: the language of the text, an arrow, the language of the reader */
.translateFlags {
    gap: 0.25rem;
    align-items: center;
}

.translateFlags vaadin-icon {
    width: 0.85em;
    height: 0.85em;
}
