:root {
    --module-bg: #fcfeff;
    --scaffold-header-height: 48px;

    /*
       Override ZDS font size variables to match ZDS theme styling.
       TYPO3 uses a 16px base, and ZDS uses a 14px base, but we can’t change TYPO3’s base font size without affecting the entire backend styling.
    */
    --zds-font-size-xxs: 10px;
    --zds-font-size-xs: 11px;
    --zds-font-size-sm: 12px;
    --zds-font-size-md: 14px;
    --zds-font-size-lg: 16px;
    --zds-font-size-xl: 18px;
    --zds-font-size-xxl: 20px;
    --zds-font-size-xxxl: 22px;
    --zds-font-size-xxxxl: 29px;
    --zds-font-size-base: 12.25px;
}

body {
    font-family: var(--zds-typography-body-md-font-family);
    font-style: var(--zds-typography-body-md-font-style);
    font-weight: var(--zds-typography-body-md-font-weight);
    letter-spacing: var(--zds-typography-body-md-letter-spacing);
    line-height: var(--zds-typography-body-md-line-height);
    text-transform: var(--zds-typography-body-md-text-transform);
}

.scaffold-modulemenu, .scaffold-header, .dropdown-menu {
    background-color: var(--zds-color-white);
}

.scaffold-header {
    padding: 0;
}

.scaffold-topbar {
    font-size: var(--zds-typography-body-md-font-size);
    color: var(--zds-text-color-base);
    height: var(--scaffold-header-height);
}

.scaffold-topbar .topbar {
    height: var(--scaffold-header-height);
    --topbar-item-height: 48px;
    --topbar-item-width: 48px;
}

.zig-version-badge__version {
    line-height: 1.5;
}

.toolbar-item-link {
    --icon-size-small: 20px;
}

.zig365-icon::after {
    background: var(--zds-text-color-base);
    content: "";
    height: 16px;
    margin-left: var(--zds-space-2);
    width: 1px;
}

.topbar-button-modulemenu {
    background: transparent;
    border: none;
    border-radius: 0;
}

.topbar-button-modulemenu:hover {
    background: var(--zds-color-support-04);
}

#typo3-cms-backend-backend-toolbaritems-usertoolbaritem zds-avatar {
    --zds-avatar-background: color-mix(in srgb, var(--zds-color-primary) 20%, var(--zds-color-white));
    --zds-avatar-border-color: color-mix(in srgb, var(--zds-color-primary) 20%, var(--zds-color-white));
    --zds-avatar-color: var(--zds-color-primary-subtle-foreground);
}

#typo3-cms-backend-backend-toolbaritems-usertoolbaritem {
    --zds-avatar-background: color-mix(in srgb, var(--zds-color-primary) 20%, var(--zds-color-white));
    --zds-avatar-border-color: color-mix(in srgb, var(--zds-color-primary) 20%, var(--zds-color-white));
    --zds-avatar-color: var(--zds-color-primary-subtle-foreground);
}

.toolbar-item-link svg, .modulemenu-icon svg {
    fill: currentColor;
}

.toolbar-item-link:focus {
    --toolbar-item-link-color-state: inherit;
    --toolbar-item-link-bg-state: transparent;
    --toolbar-item-link-border-color-state: transparent;
}

.toolbar-item-link:hover, .toolbar-item-link.show {
    --toolbar-item-link-color-state: var(--zds-color-primary-dark);
    --toolbar-item-link-bg-state: color-mix(in srgb, var(--zds-color-primary-subtle) 30%, transparent);
    --toolbar-item-link-border-color-state: transparent;
}

.modulemenu {
    --modulemenu-padding-x: 3px;
    --modulemenu-padding-y: 3px;
}

.modulemenu-action {
    --modulemenu-action-color-state: var(--zds-text-color-base);
}

.modulemenu-indicator {
    display: block !important;
}

.modulemenu-icon .icon {
    --icon-size: 24px;
    height: 32px;
}
.modulemenu-icon .icon-markup svg {
    margin-top: 1px;
    height: 30px;
}

li[data-modulemenu-level="1"] > button:first-of-type > .modulemenu-icon {
    display: none;
}

.modulemenu-name {
    -webkit-margin-start: 0.5em;
    margin-inline-start: 0.5em;
}

button span.modulemenu-name {
    margin: 0;
    gap: 8px;
    text-transform: uppercase
}

.modulemenu-action:hover, .modulemenu-action:focus, .modulemenu-action.modulemenu-action-active:not(:has(~ul.collapse.show)) {
    --modulemenu-action-color-state: var(--zds-color-primary-dark);
    color: var(--modulemenu-action-color-state);
    --modulemenu-action-bg-state: color-mix(in srgb, var(--zds-color-primary-subtle) 30%, transparent);
    --modulemenu-action-border-color-state: transparent;
}

.typo3-modulemenu-toggle-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 19px;
    height: 19px;
    background-color: var(--zds-color-primary-dark);
    mask: url('../Icons/modulemenu-icon-right.svg') no-repeat center;
    mask-size: contain;
}

.scaffold-modulemenu-expanded .typo3-modulemenu-toggle-icon {
    mask: url('../Icons/modulemenu-icon.svg') no-repeat center;
    mask-size: contain;
}

/* The nodes overlay may not have a higher z-index than the zds-appbar-sidebar */
.nodes-loader {
    z-index: 989 !important;
}

/* Adjust badge position because of --scaffold-header-height 48px  */
@media (min-width: 992px) {
    .toolbar-item-badge {
        inset-inline-end: -.25rem;
        top: -.25rem;
    }
}

.toolbar zds-avatar {
    font-size: var(--zds-font-size-md);
    font-weight: var(--zds-typography-headline-md-font-weight);
}
