@use "../../../../styles/abstracts/variables" as *;

.messageCard {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;

  width: 100%;

  margin-bottom: 1.25rem;

  padding: 1rem 1.1rem;

  border-radius: 14px;

  backdrop-filter: blur(14px);

  transition: all 0.25s ease;

  &__left {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;

    flex: 1;
    min-width: 0;
  }

  &__icon {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    svg {
      flex-shrink: 0;
    }
  }

  &__content {
    flex: 1;
    min-width: 0;
  }

  &__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    flex-wrap: wrap;

    margin-bottom: 0.4rem;

    h4 {
      margin: 0;

      color: #ffffff;

      font-size: 0.8rem;
      font-weight: 600;

      line-height: 1.3;

      letter-spacing: -0.01em;
    }

    span {
      font-size: 0.68rem;

      color: rgba(255, 255, 255, 0.55);

      font-weight: 500;
    }
  }

  p {
    margin: 0;

    color: rgba(255, 255, 255, 0.85);

    font-size: 0.8rem !important;

    line-height: 1.75;

    word-break: break-word;
  }

  &__close {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;

    background: rgba(255, 255, 255, 0.04);

    border-radius: 50%;

    color: rgba(255, 255, 255, 0.55);

    cursor: pointer;

    transition: all 0.2s ease;

    &:hover {
      background: rgba(255, 255, 255, 0.08);

      color: #ffffff;
    }
  }

  /* ========================================= */
  /* INFO */
  /* ========================================= */

  &--info {
    background: linear-gradient(
      180deg,
      rgba(59, 130, 246, 0.12) 0%,
      rgba(59, 130, 246, 0.08) 100%
    );

    border: 1px solid rgba(59, 130, 246, 0.18);

    box-shadow:
      0 6px 20px rgba(59, 130, 246, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);

    &:hover {
      background: linear-gradient(
        180deg,
        rgba(59, 130, 246, 0.16) 0%,
        rgba(59, 130, 246, 0.1) 100%
      );
    }

    .messageCard__icon {
      background: rgba(59, 130, 246, 0.18);

      border: 1px solid rgba(59, 130, 246, 0.22);

      color: #60a5fa;
    }
  }

  /* ========================================= */
  /* SUCCESS */
  /* ========================================= */

  &--success {
    background: linear-gradient(
      180deg,
      rgba(34, 197, 94, 0.12) 0%,
      rgba(34, 197, 94, 0.08) 100%
    );

    border: 1px solid rgba(34, 197, 94, 0.18);

    box-shadow:
      0 6px 20px rgba(34, 197, 94, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);

    &:hover {
      background: linear-gradient(
        180deg,
        rgba(34, 197, 94, 0.16) 0%,
        rgba(34, 197, 94, 0.1) 100%
      );
    }

    .messageCard__icon {
      background: rgba(34, 197, 94, 0.18);

      border: 1px solid rgba(34, 197, 94, 0.22);

      color: #22c55e;
    }
  }

  /* ========================================= */
  /* DANGER */
  /* ========================================= */

  &--danger {
    background: linear-gradient(
      180deg,
      rgba(239, 68, 68, 0.12) 0%,
      rgba(239, 68, 68, 0.08) 100%
    );

    border: 1px solid rgba(239, 68, 68, 0.18);

    box-shadow:
      0 6px 20px rgba(239, 68, 68, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);

    &:hover {
      background: linear-gradient(
        180deg,
        rgba(239, 68, 68, 0.16) 0%,
        rgba(239, 68, 68, 0.1) 100%
      );
    }

    .messageCard__icon {
      background: rgba(239, 68, 68, 0.18);

      border: 1px solid rgba(239, 68, 68, 0.22);

      color: #ef4444;
    }
  }

  /* ========================================= */
  /* WARNING */
  /* ========================================= */

  &--warning {
    background: linear-gradient(
      180deg,
      rgba(245, 158, 11, 0.12) 0%,
      rgba(245, 158, 11, 0.08) 100%
    );

    border: 1px solid rgba(245, 158, 11, 0.18);

    box-shadow:
      0 6px 20px rgba(245, 158, 11, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);

    &:hover {
      background: linear-gradient(
        180deg,
        rgba(245, 158, 11, 0.16) 0%,
        rgba(245, 158, 11, 0.1) 100%
      );
    }

    .messageCard__icon {
      background: rgba(245, 158, 11, 0.18);

      border: 1px solid rgba(245, 158, 11, 0.22);

      color: #f59e0b;
    }
  }

  @media (max-width: 768px) {
    padding: 0.9rem;

    gap: 0.75rem;

    &__left {
      gap: 0.75rem;
    }

    &__icon {
      width: 32px;
      height: 32px;
    }

    &__header {
      margin-bottom: 0.35rem;

      h4 {
        font-size: 0.85rem;
      }

      span {
        font-size: 0.65rem;
      }
    }

    p {
      font-size: 0.75rem;
      line-height: 1.65;
    }

    &__close {
      width: 28px;
      height: 28px;
    }
  }
}