/* Apple / iMessage-style theme for Zulip 12.x.
   Served from /local-static/custom-theme.css, injected by nginx sub_filter.
   Overrides Zulip's own CSS variables; light-dark() follows the user's theme setting.
   :root:root beats Zulip's .dark-theme:root at equal specificity because this file loads later. */

:root:root {
    /* Apple system palette */
    --apple-blue: light-dark(#007aff, #0a84ff);
    --apple-bg: light-dark(#f2f2f7, #000000);
    --apple-surface: light-dark(#ffffff, #1c1c1e);
    --apple-surface-2: light-dark(#f9f9fb, #2c2c2e);
    --apple-label: light-dark(#1c1c1e, #f2f2f7);
    --apple-separator: light-dark(rgb(60 60 67 / 12%), rgb(84 84 88 / 45%));

    /* Base surfaces and text */
    --color-background: var(--apple-bg);
    --color-background-navbar: light-dark(rgb(249 249 251 / 85%), rgb(28 28 30 / 85%));
    --color-background-stream-message-content: var(--apple-surface);
    --color-background-modal: var(--apple-surface);
    --color-background-popover-menu: var(--apple-surface);
    --color-background-search: var(--apple-surface-2);
    --color-text-default: var(--apple-label);
    --color-text-message-default: var(--apple-label);
    --color-message-list-border: var(--apple-separator);
    --color-message-header-contents-border: var(--apple-separator);

    /* Direct messages: soft iMessage blue */
    --color-background-private-message-content: light-dark(#eef5ff, #0f1f33);
    --color-background-private-message-header: light-dark(#dcebff, #16304f);

    /* Compose box */
    --color-compose-box-background: var(--apple-surface-2);
    --color-compose-message-content-background: var(--apple-surface);
    --color-compose-send-button-background: var(--apple-blue);
    --color-compose-send-button-background-interactive: light-dark(#0062cc, #409cff);
    --color-compose-focus-ring: var(--apple-blue);

    /* Accent: Zulip purple -> Apple blue */
    --color-background-brand-solid-action-button: var(--apple-blue);
    --color-background-brand-solid-action-button-hover: light-dark(#0062cc, #409cff);
    --color-background-brand-solid-action-button-active: light-dark(#0051a8, #66b0ff);
    --color-text-brand-text-action-button: var(--apple-blue);
    --color-text-brand-subtle-action-button: var(--apple-blue);
    --color-unread-marker: var(--apple-blue);
    --color-outline-focus: var(--apple-blue);
}

/* System font (SF Pro on Apple devices, Segoe UI / Roboto elsewhere) */
body,
input,
textarea,
button,
select {
    font-family:
        -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
        "Helvetica Neue", "Source Sans 3 VF", sans-serif;
}

/* Frosted top bar */
#navbar-fixed-container {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Rounded message groups, buttons, popovers */
.recipient_row {
    border-radius: 14px;
    overflow: hidden;
}

.action-button,
.popover-menu,
.modal__container {
    border-radius: 12px;
}

.message_reaction {
    border-radius: 999px;
}

#compose-textarea,
.message_edit_content {
    border-radius: 18px;
}
