/**
 * SocialJet admin styles.
 *
 * This stylesheet is enqueued ONLY on the SocialJet admin page (see
 * Frontend::setup), where the whole screen is an Ant Design (antd) app.
 *
 * WordPress admin CSS (wp-admin/css/forms.css, common.css, …) targets form
 * controls with attribute/element selectors such as `input[type="text"]`,
 * `textarea`, `select` and `.wp-core-ui .button`. Those selectors carry more
 * specificity than antd's class selectors, so they leak into — and override —
 * antd's controls (including the modals/messages antd renders into <body>).
 *
 * `StyleProvider hashPriority="high"` (in Menu/main.tsx) already removes antd's
 * zero-specificity `:where()` wrapper. The rules below finish the job for the
 * controls WordPress styles most aggressively, re-asserting the antd look from
 * its design tokens (exposed as CSS variables by `theme.cssVar`). We keep this
 * to the handful of properties WordPress forces and leave box-shadow alone so
 * antd's focus ring keeps working.
 */

#socialjet,
#socialjet *,
#socialjet *::before,
#socialjet *::after {
    box-sizing: border-box;
}

/* antd controls live both inside #socialjet and in body-level popup portals. */
:is(#socialjet,
    .ant-modal-root,
    .ant-drawer,
    .ant-popover,
    .ant-dropdown,
    .ant-picker-dropdown,
    .ant-select-dropdown,
    .ant-image-preview-root)
:is(.ant-input,
    .ant-input-affix-wrapper,
    .ant-input-number,
    .ant-input-number-input,
    .ant-picker,
    .ant-select-selector,
    textarea.ant-input) {
    border: 1px solid var(--ant-color-border, #d9d9d9) !important;
    border-radius: var(--ant-border-radius, 6px) !important;
    background: var(--ant-color-bg-container, #fff) !important;
    color: var(--ant-color-text, rgba(0, 0, 0, 0.88)) !important;
    min-height: 0 !important;
    line-height: var(--ant-line-height, 1.5714285714285714) !important;
}

/* The affix wrapper draws the border; its inner <input> must stay borderless
   so we don't get a double border. */
:is(#socialjet, .ant-modal-root, .ant-drawer, .ant-popover, .ant-dropdown)
.ant-input-affix-wrapper > .ant-input {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    min-height: 0 !important;
}

/* Borderless variant must not get WordPress's default border back. */
:is(#socialjet, .ant-modal-root, .ant-drawer, .ant-popover, .ant-dropdown)
.ant-input-borderless {
    border-color: transparent !important;
    background: transparent !important;
}
