/* Theme picker in the header.
   Loaded on its own (not from theme.css) so it still works in the classic theme, where theme.css is disabled;
   every token therefore has a fallback for when theme.css is not loaded. */

/* Same 40px box, 8px padding and muted outline icon as the chat button next to it */
.ThemePicker {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

    .ThemePicker .btnTheme {
        width: 40px;
        height: 40px;
        padding: 8px;
        box-sizing: border-box;
        display: grid;
        place-items: center;
        border: none;
        border-radius: 8px;
        background: transparent;
        color: var(--header-text, currentColor);
        cursor: pointer;
    }

        .ThemePicker .btnTheme svg {
            width: 24px;
            height: 24px;
            opacity: .6;
            transition: opacity .2s;
        }

        .ThemePicker .btnTheme:hover svg,
        .ThemePicker.Open .btnTheme svg {
            opacity: 1;
        }

    .ThemePicker .Themes {
        display: none;
        position: absolute;
        top: 42px;
        left: 0;
        width: 220px;
        padding: 6px;
        background: #FFFFFF;
        border: 1px solid var(--border, #E2E8F0);
        border-radius: var(--radius, 8px);
        box-shadow: var(--shadow-md, 0 4px 12px -2px rgba(15, 23, 42, 0.10));
        color: var(--heading, #1E293B);
        font-family: IRANSansX;
        z-index: 1100;
    }

    .ThemePicker.Open .Themes {
        display: block;
    }

    .ThemePicker .Themes button {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 8px 10px;
        border: none;
        border-radius: var(--radius-sm, 6px);
        background: transparent;
        color: inherit;
        font: inherit;
        font-size: 10pt;
        text-align: right;
        cursor: pointer;
    }

        .ThemePicker .Themes button:hover {
            background-color: var(--hover, rgba(15, 23, 42, 0.05));
        }

        .ThemePicker .Themes button[aria-checked="true"] {
            background-color: var(--accent-soft, rgba(66, 165, 245, 0.12));
            color: var(--accent, #42A5F5);
        }

    /* FillForm runs $("button").button(), which adds jQuery UI margins and wraps the content in a padded span */
    .ThemePicker button.ui-button {
        margin: 0;
        font-weight: inherit;
    }

        .ThemePicker button.ui-button .ui-button-text {
            display: contents;
        }

    .ThemePicker .Swatch {
        width: 28px;
        height: 20px;
        border-radius: 4px;
        border: 1px solid var(--border, #E2E8F0);
        flex: none;
    }
