* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe", system-ui, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh;
  color: white;
  background: linear-gradient(45deg, #252525, #050505);
}

.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: 400px;
  background-image: url(bg.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 15px 5px #101010;
}

.chat__header {
  position: absolute;
  top: 7px;
  right: 7px;
  left: 7px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  padding: 5px;
  border-radius: 30px;
  background-color: rgba(50, 50, 50, 0.5);
  box-shadow: 0 -5px 15px 5px black;
  backdrop-filter: blur(5px);
  border-block-start: 1px solid rgba(150, 150, 150, 0.5);
  border-block-end: 1px solid rgba(150, 150, 150, 0.5);
}

.chat__avatar {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 10px rgb(0, 0, 0);
}

.chat__contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.chat__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #aaa;
}

.chat__status-text {
  font-size: 12px;
  color: #aaa;
}

.chat__dot {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.chat__dot--online {
  background: aquamarine;
  box-shadow: 0 0 10px aquamarine;
}

.chat__dot--offline {
  background: #555555;
  box-shadow: 0 0 10px #555555;
}

.chat__dot--typing {
  background: #fbbf24;
  animation: pulse 1s infinite;
  box-shadow: 0 0 10px #fbbf24;
}

.chat__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-block: 100px;
  padding-inline: 10px;
}

.chat__messages::-webkit-scrollbar {
  display: none;
}

.message-row {
  display: flex;
  gap: 10px;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.message-row--sent {
  justify-content: flex-end;
}

.message-row--received {
  justify-content: flex-start;
}

.message-bubble {
  position: relative;
  max-width: 80%;
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid rgba(150, 150, 150, 0.3);
  font-weight: 500;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}

.message-row--received .message-bubble {
  background: linear-gradient(45deg, #404040, #303030);
  border-bottom-left-radius: 3px;
}

.message-row--sent .message-bubble {
  background: linear-gradient(45deg, #0fae8c, #2383b3);
  border-bottom-right-radius: 3px;
}

.message-bubble__time {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: right;
  opacity: 0.75;
}

.chat__footer {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 20;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  width: auto;
  padding: 5px;
  border-radius: 30px;
  background-color: rgba(50, 50, 50, 0.5);
  box-shadow: 0 5px 15px 5px black;
  backdrop-filter: blur(5px);
  border-block-start: 1px solid rgba(150, 150, 150, 0.5);
  border-block-end: 1px solid rgba(150, 150, 150, 0.5);
}

.chat__input-field {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  background: transparent;
  border: none;
  outline: none;
}

.chat__input-field::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat__send-button {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  background: linear-gradient(45deg, #19ba96, #307fa7);
  box-shadow:
    0 0 15px rgba(30, 170, 120, 0.3),
    inset 0 0 10px rgba(255, 255, 255, 0.3);
  transition: transform 0.1s;
}

.chat__send-button:active {
  transform: scale(0.9);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
