@use "../../../Assets/sass/devtoys" as *;

.info-bar {
    @include flex($align: center);
    position: relative;
    min-block-size: 48px;
    box-sizing: border-box;
    user-select: none;
    background-clip: padding-box;
    border: var(--info-bar-border-thickness) solid var(--info-bar-border);
    border-radius: var(--info-bar-border-corner-radius);

    &.severity- {
        &success {
            background-color: var(--info-bar-success-severity-background);
        }

        &warning {
            background-color: var(--info-bar-warning-severity-background);
        }

        &error {
            background-color: var(--info-bar-error-severity-background);
        }

        &informational {
            background-color: var(--info-bar-informational-severity-background);
        }
    }

    &-content-container {
        @include flex($align: center);
        width: 100%;
        justify-content: center;
        position: relative;
        padding-top: 12px;
        padding-left: 16px;
        padding-bottom: 12px;
        padding-right: 0px;
    }

    &-icon {
        align-self: flex-start;
        display: flex;
        flex: 0 0 auto;
        margin-right: 6px;
        margin-top: 2px;

        .info-badge {
            @include flex($inline: true, $align: center, $justify: center);
            box-sizing: border-box;
            user-select: none;
            min-inline-size: 16px;
            min-block-size: 16px;
            border-radius: 16px;
            padding: 2px 4px;
            margin-inline-end: 0px;

            &.severity- {
                &informational {
                    background-color: var(--info-bar-informational-severity-icon-background);
                    color: var(--info-bar-informational-severity-icon-foreground);
                    fill: var(--info-bar-informational-severity-icon-foreground) !important;
                }

                &success {
                    background-color: var(--info-bar-success-severity-icon-background);
                    color: var(--info-bar-success-severity-icon-foreground);
                    fill: var(--info-bar-success-severity-icon-foreground) !important;
                }

                &warning {
                    background-color: var(--info-bar-warning-severity-icon-background);
                    color: var(--info-bar-warning-severity-icon-foreground);
                    fill: var(--info-bar-warning-severity-icon-foreground) !important;
                }

                &error {
                    background-color: var(--info-bar-error-severity-icon-background);
                    color: var(--info-bar-error-severity-icon-foreground);
                    fill: var(--info-bar-error-severity-icon-foreground) !important;
                }
            }

            svg {
                line-height: 12px;
                font-size: 12px;
                inline-size: 8px;
                block-size: 8px;
                fill: inherit;

                path {
                    fill: inherit;
                }
            }
        }
    }

    &-content {
        @include flex($align: center, $wrap: true);
        position: relative;
        box-sizing: border-box;
        flex: 1 1 auto;
        margin-left: 6px;

        h5,
        span {
            margin: 0;
            line-height: 20px;
        }

        h5 {
            margin-inline-end: 12px;
            color: var(--info-bar-title-foreground);
        }

        span {
            flex: 1 1 auto;
            margin-inline-end: 15px;
            color: var(--info-bar-message-foreground);
        }
    }

    &-button {
        margin-right: 6px;
        margin-top: 6px;
        margin-bottom: auto;

        &.action {
            margin-top: 7px;
        }

        .close-button {
            height: 36px;
            width: 36px;
        }
    }
}

// Compact mode
div[data-compactmode] {
    .info-bar {
        min-block-size: 34px;

        &-content-container {
            padding-top: 6px;
            padding-left: 16px;
            padding-bottom: 6px;
            padding-right: 0px;
        }

        &-button {
            margin-top: 4px;
            margin-bottom: auto;

            &.action {
                margin-top: 3px;
            }

            .close-button {
                height: 16px;
                width: 24px;
            }
        }
    }
}
