@use '../../scss/theming' as *;

@mixin daff-toast-theme($theme) {
	$info: daff-get-palette($theme, informational);
	$warn: daff-get-palette($theme, warn);
	$critical: daff-get-palette($theme, critical);
	$success: daff-get-palette($theme, success);
	$neutral: daff-get-palette($theme, neutral);
	$base: daff-get-base-color($theme, base);
	$black: daff-get-base-color($theme, 'black');
	$white: daff-get-base-color($theme, 'white');
	$mode: daff-get-theme-mode($theme);

	.daff-toast {
		@include light($mode) {
			background: daff-color($neutral, 10);
			box-shadow: 0 -16px 24px -4px rgba($black, 0.04),
				0 8px 24px -4px rgba($black, 0.1);
			color: daff-text-contrast($base);

			&::before {
				background: daff-color($neutral, 40);
			}

			&.daff-success {
				background: daff-color($success, 10);
				color: $black;

				.daff-prefix {
					color: daff-color($success);
				}

				&::before {
					background: daff-color($success);
				}
			}

			&.daff-warn {
				background: daff-color($warn, 10);
				color: $black;

				.daff-prefix {
					color: daff-color($warn);
				}

				&::before {
					background: daff-color($warn);
				}
			}

			&.daff-critical {
				background: daff-color($critical, 10);
				color: $black;

				.daff-prefix {
					color: daff-color($critical);
				}

				&::before {
					background: daff-color($critical);
				}
			}
		}

		@include dark($mode) {
			background: daff-color($neutral, 90);
			box-shadow: 0 -16px 24px -4px rgba($black, 0.04),
				0 8px 24px -4px rgba($black, 0.1);
			color: daff-text-contrast($base);

			&::before {
				background: daff-color($neutral, 30);
			}

			&.daff-success {
				background: daff-color($success, 90);

				.daff-prefix {
					color: daff-color($success, 30);
				}

				&::before {
					background: daff-color($success, 30);
				}
			}

			&.daff-warn {
				background: daff-color($warn, 90);

				.daff-prefix {
					color: daff-color($warn, 30);
				}

				&::before {
					background: daff-color($warn, 30);
				}
			}

			&.daff-critical {
				background: daff-color($critical, 90);

				.daff-prefix {
					color: daff-color($critical, 30);
				}

				&::before {
					background: daff-color($critical, 30);
				}
			}
		}
	}
}
