//@use 'variables';

.flash-message {
  position: fixed;
  top: 80px;
  right: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem 1rem 70px;
  margin: 1rem auto;
  max-width: 600px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: #222;
  //overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-out;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  z-index: 10000;

  &__icon {
    position: absolute;
    top: -20px;
    left: 10px;
    //background: #004E32;
    flex-shrink: 0;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &__text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;

    .headline {
      font-size: 1.1rem;
      font-weight: 600;
      margin-bottom: 2px;
    }

    .subtext {
      font-size: 0.85rem;
      color: #e2e2e2;
    }
  }

  &__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.7;
    }
  }

  svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 50px;
    border-bottom-left-radius: 10px;
  }

  &--success {
    background-color: #0C7040;

    svg * {
      fill: #004E32;
    }

    .flash-message__icon {
      background-color: #004E32;
    }

  }

  &--error {
    background-color: #C72C41;

    svg * {
      fill: #801336;
    }

    .flash-message__icon {
      background-color: #801336;
    }

  }

  &--warning {
    background-color: #FC8621;

    svg * {
      fill: #C24914;
    }

    .flash-message__icon {
      background-color: #C24914;
    }
  }

  &--info {
    background-color: #0070E0;

    svg * {
      fill: #05478A;
    }

    .flash-message__icon {
      background-color: #05478A;
    }
  }

  &.is-hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
