/* =========================
   Alerts
   Figma: Alerts / Banner.
========================= */

@use "../kit-deps" as *;

.alert {
  display: flex;
  align-items: flex-start;
  gap: $space-3;
  width: 100%;
  max-width: 760px;
  padding: $space-3 $space-4;
  border: $border-width-base $border-style-base transparent;
  border-radius: $radius-md;
  background-color: $neutral-100;
  color: $neutral-900;
  font-family: $font-family-base;
  font-size: 14px;
  line-height: 1.4;

  .vmk-icon {
    flex-shrink: 0;
    font-size: $icon-size-lg;
    color: currentColor;
  }

  .alert-content {
    flex: 1;
  }

  .alert-title {
    font-weight: $font-weight-semibold;
    margin-bottom: $space-1;
  }

  // Variants
  &.alert-primary {
    background-color: $neutral-900;
    color: $neutral-25;
  }

  &.alert-secondary {
    background-color: $mint-300;
    color: $neutral-900;
  }

  &.alert-accent {
    background-color: $yellow-300;
    color: $neutral-900;
  }

  &.alert-success {
    background-color: $success-bg;
    color: $success-text;
  }

  &.alert-warning {
    background-color: $warning-bg;
    color: $warning-text;
  }

  &.alert-info {
    background-color: $info-bg;
    color: $info-text;
  }

  &.alert-danger,
  &.alert-error {
    background-color: $danger-bg;
    color: $danger-text;
  }

  .alert-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: -$space-1 0;
    border: 0;
    border-radius: $radius-full;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity $motion-base $motion-ease, background-color $motion-base $motion-ease;

    &:hover {
      opacity: 1;
      background-color: rgba($neutral-900, 0.08);
    }

    &:focus-visible {
      @include focus_ring;
    }
  }
}
