// (C) 2024-2025 GoodData Corporation
@use "../themeColorsMap";

.gd-ui-kit-icon {
    fill: var(--gd-icon-fill-color);

    @media (forced-colors: active) {
        fill: buttontext; // Force system colors in high contrast mode

        * {
            fill: buttontext; // Force system colors in high contrast mode
        }
    }

    &--layout {
        &-block {
            display: block;
        }

        &-inline {
            display: inline;
        }
    }

    &--color {
        @each $key, $value in themeColorsMap.$theme-colors-map {
            &-#{$key} {
                --gd-icon-fill-color: var(--gd-palette-#{$value});
            }
        }

        &-currentColor {
            --gd-icon-fill-color: currentColor;
        }
    }

    path {
        transition: var(--gd-transition-all);
    }

    &--disableAnimation {
        path {
            transition: none;
        }
    }
}

.gd-ui-kit-icon-background {
    display: flex;
    align-items: center;
    justify-content: center;
    fill: var(--gd-icon-background-color);
    $root: &;

    &--shape {
        &-circle {
            border-radius: 50%;
        }
    }

    &--color {
        @each $key, $value in themeColorsMap.$theme-colors-map {
            &-#{$key} {
                --gd-icon-background-color: var(--gd-palette-#{$value});
            }
        }
    }

    &--type {
        &-fill {
            background-color: var(--gd-icon-background-color);
        }

        &-border {
            border: 1px solid var(--gd-icon-background-color);
        }
    }
}
