@use 'design-system' as *;

.alert {
    --icon-size: 1.5rem;

    display: flex;
    gap: $spacing-size-2;
    align-items: center;
    padding: $spacing-size-2 $spacing-size-2 $spacing-size-2 $spacing-size-3;
    background-color: var(--color-util-brand-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-util-brand-100);
    color: var(--color-util-brand-700);
    margin-top: $spacing-size-5;
    margin-bottom: $spacing-size-8;

    #{$selector-darkmode} & {
        background-color: color-mix(in srgb, var(--color-util-brand-50), var(--color-bg-primary) 60%);
    }

    :global(.icon) {
        align-self: flex-start;
        position: relative;
        flex-shrink: 0;
        fill: var(--color-util-brand-700);
    }

    p :last-child {
        margin-bottom: 0;
    }

    a {
        font-weight: var(--text-semibold);
        text-decoration: underline;
    }

    kbd {
        margin: 0;
        padding-top: 0.075em;
        padding-bottom: 0.25em;
    }
}

.alert.idea {
    :global(.icon) {
        fill: orange;
    }
}

.alert.warning {
    color: var(--color-util-warning-700);
    background-color: var(--color-util-warning-50);
    border-color: color-mix(in srgb, var(--color-util-warning-600) 20%, var(--color-bg-primary));

    #{$selector-darkmode} & {
        border-color: color-mix(in srgb, var(--color-util-warning-600) 30%, var(--color-bg-primary));
    }

    :global(.icon) {
        fill: var(--color-util-warning-700);
    }
}

.alert.success {
    color: var(--color-success);
    background-color: color-mix(in srgb, var(--color-success) 6%, var(--color-bg-primary));
    border-color: color-mix(in srgb, var(--color-success) 20%, var(--color-bg-primary));

    #{$selector-darkmode} & {
        background-color: color-mix(in srgb, var(--color-success) 10%, var(--color-bg-primary));
        border-color: color-mix(in srgb, var(--color-success) 28%, var(--color-bg-primary));
    }

    :global(.icon) {
        fill: var(--color-success);
    }
}
