@use "core/functions" as *;
@use "core/mixins" as *;

.sw-update-notification {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 1.5rem;
  display: none;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.625rem 1rem;
  background-color: fi-var(global-background-color);
  border: 1px solid fi-var(global-border-color);
  border-radius: 0.5rem;
  color: fi-var(global-font-color);
  font-size: 0.875rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
  translate: 0 1rem;
  opacity: 0;
  transition:
    display 0.3s allow-discrete,
    translate 0.3s,
    opacity 0.3s;
  @include z-index(fixed);

  &.visible {
    display: flex;
    translate: 0 0;
    opacity: 1;
  }

  @starting-style {
    &.visible {
      translate: 0 1rem;
      opacity: 0;
    }
  }

  @include media('print') {
    display: none !important;
  }
}

.sw-update-content {
  flex: 1;
  min-width: 0;
}

.sw-update-title {
  margin: 0;
  font-weight: 600;
}

.sw-update-text {
  margin: 0.125rem 0 0;
  opacity: 0.8;
}

.sw-update-btn {
  flex-shrink: 0;
  padding: 0.375rem 0.75rem;
  border: none;
  background-color: fi-var(primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  @include border-radius;

  &:hover {
    opacity: 0.85;
  }
}
